:root {
  color-scheme: light;
  --ink: #15202b;
  --muted: #657385;
  --line: #d8e0e8;
  --team-primary: #17313a;
  --team-accent: #187b85;
  --team-surface: #f7f9fb;
  --ice: var(--team-surface);
  --white: #ffffff;
  --navy: var(--team-primary);
  --red: #b94a55;
  --teal: var(--team-accent);
  --gold: #d7a72f;
  --shadow: 0 16px 40px rgba(21, 32, 43, 0.1);
}

/* Final mobile app footer polish. */
@media (max-width: 720px) {
  .mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    min-height: calc(76px + env(safe-area-inset-bottom)) !important;
    padding: 0 max(2px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(2px, env(safe-area-inset-right)) !important;
    overflow: hidden !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: #1669a9 !important;
    box-shadow: 0 -10px 24px rgba(9, 31, 48, 0.22) !important;
  }

  body.dark-mode .mobile-bottom-nav {
    background: #125b93 !important;
  }

  .mobile-nav-tab {
    display: grid !important;
    grid-template-rows: 30px 18px !important;
    align-content: center !important;
    justify-items: center !important;
    min-width: 0 !important;
    min-height: 76px !important;
    gap: 2px !important;
    padding: 7px 1px 6px !important;
    border: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: clamp(8px, 2.45vw, 10px) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
  }

  .mobile-nav-tab:first-child {
    border-left: 0 !important;
  }

  .mobile-nav-tab.active {
    background: #0e5a92 !important;
    color: #ffffff !important;
    box-shadow: inset 0 3px 0 var(--team-accent) !important;
  }

  .mobile-nav-tab > span:last-child {
    color: currentColor !important;
    max-width: 100% !important;
    text-align: center !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .mobile-nav-icon,
  .mobile-nav-tab.active .mobile-nav-icon {
    width: 30px !important;
    height: 30px !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: currentColor !important;
  }

  .mobile-nav-icon::before {
    content: "" !important;
    display: block !important;
    width: clamp(20px, 6vw, 24px) !important;
    height: clamp(20px, 6vw, 24px) !important;
    background: currentColor !important;
    opacity: 1 !important;
    -webkit-mask-repeat: no-repeat !important;
    mask-repeat: no-repeat !important;
    -webkit-mask-position: center !important;
    mask-position: center !important;
    -webkit-mask-size: 24px 24px !important;
    mask-size: 24px 24px !important;
  }

  .home-nav-icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 11.5 12 4l9 7.5v8a1 1 0 0 1-1 1h-5.5v-6h-5v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 11.5 12 4l9 7.5v8a1 1 0 0 1-1 1h-5.5v-6h-5v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E") !important;
  }

  .schedule-nav-icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h3zm12 8H5v9h14zM7 12h3v3H7zm5 0h3v3h-3z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h3zm12 8H5v9h14zM7 12h3v3H7zm5 0h3v3h-3z'/%3E%3C/svg%3E") !important;
  }

  .roster-nav-icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8m8.5 1a3.5 3.5 0 1 1 .01-7.01A3.5 3.5 0 0 1 16.5 12M2 20c0-4 2.7-7 6-7s6 3 6 7v1H2zm12.7 1c.2-.5.3-1 .3-1.6 0-2.1-.8-4-2.1-5.4 1-.6 2.2-1 3.6-1 3 0 5.5 2.7 5.5 6v2z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8m8.5 1a3.5 3.5 0 1 1 .01-7.01A3.5 3.5 0 0 1 16.5 12M2 20c0-4 2.7-7 6-7s6 3 6 7v1H2zm12.7 1c.2-.5.3-1 .3-1.6 0-2.1-.8-4-2.1-5.4 1-.6 2.2-1 3.6-1 3 0 5.5 2.7 5.5 6v2z'/%3E%3C/svg%3E") !important;
  }

  .chat-nav-icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H8l-5 4V5a1 1 0 0 1 1-1m3 5h10V7H7zm0 4h7v-2H7z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H8l-5 4V5a1 1 0 0 1 1-1m3 5h10V7H7zm0 4h7v-2H7z'/%3E%3C/svg%3E") !important;
  }

  .attendance-nav-icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h3zm12 8H5v9h14zm-4.2 2.2 1.4 1.4-4.8 4.8-2.8-2.8 1.4-1.4 1.4 1.4z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h3zm12 8H5v9h14zm-4.2 2.2 1.4 1.4-4.8 4.8-2.8-2.8 1.4-1.4 1.4 1.4z'/%3E%3C/svg%3E") !important;
  }

  .funds-nav-icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M13 2v3c2 .2 3.8.9 5 2.2l-2.2 2.2C15 8.6 14 8.1 13 8v3.1c3.3.8 5 2.1 5 4.8 0 2.8-2.1 4.5-5 4.8V23h-2v-2.3c-2.5-.3-4.6-1.3-6-3l2.4-2.1c1 1.1 2.2 1.8 3.6 2.1v-3.5c-3.2-.8-5-2-5-4.7C6 6.8 8 5.2 11 5V2zm-2 5.8c-1 .2-1.6.7-1.6 1.5 0 .7.4 1.1 1.6 1.5zm2 10c1-.2 1.6-.7 1.6-1.6 0-.8-.4-1.2-1.6-1.6z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M13 2v3c2 .2 3.8.9 5 2.2l-2.2 2.2C15 8.6 14 8.1 13 8v3.1c3.3.8 5 2.1 5 4.8 0 2.8-2.1 4.5-5 4.8V23h-2v-2.3c-2.5-.3-4.6-1.3-6-3l2.4-2.1c1 1.1 2.2 1.8 3.6 2.1v-3.5c-3.2-.8-5-2-5-4.7C6 6.8 8 5.2 11 5V2zm-2 5.8c-1 .2-1.6.7-1.6 1.5 0 .7.4 1.1 1.6 1.5zm2 10c1-.2 1.6-.7 1.6-1.6 0-.8-.4-1.2-1.6-1.6z'/%3E%3C/svg%3E") !important;
  }

  .branding-nav-icon::before,
  .admin-nav-icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 4 5.5v6.3c0 4.6 3.3 8.8 8 10.2 4.7-1.4 8-5.6 8-10.2V5.5zm0 5a2.5 2.5 0 0 1 1 4.8V17h-2v-5.2A2.5 2.5 0 0 1 12 7'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 4 5.5v6.3c0 4.6 3.3 8.8 8 10.2 4.7-1.4 8-5.6 8-10.2V5.5zm0 5a2.5 2.5 0 0 1 1 4.8V17h-2v-5.2A2.5 2.5 0 0 1 12 7'/%3E%3C/svg%3E") !important;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fbfcfd 0, var(--ice) 52%, #edf3f6 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

img,
svg {
  max-width: 100%;
}

body.dark-mode {
  color-scheme: dark;
  --ink: #f4f7fb;
  --muted: #a9b7c7;
  --line: #263c4a;
  --team-surface: #071924;
  --ice: #071924;
  --white: #0f2530;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #132f3c;
  border-color: #345261;
  color: var(--ink);
}

body.dark-mode .auth-card,
body.dark-mode .top-strip,
body.dark-mode .panel,
body.dark-mode .member-form,
body.dark-mode .event-form,
body.dark-mode .fund-form,
body.dark-mode .roster-card,
body.dark-mode .schedule-item,
body.dark-mode .permission-row {
  background: #0f2530;
}

body.dark-mode .secondary-button,
body.dark-mode .soft-remove-button,
body.dark-mode .home-status-button,
body.dark-mode .settings-row,
body.dark-mode .search-result-button,
body.dark-mode .filter-chip {
  background: #132f3c;
  color: var(--ink);
  border-color: #345261;
}

body.dark-mode .chat-window,
body.dark-mode .chat-form,
body.dark-mode .chat-side,
body.dark-mode .chat-thread-button,
body.dark-mode .chat-conversation-header,
body.dark-mode .mobile-settings-panel,
body.dark-mode .mobile-utility-panel,
body.dark-mode .mobile-team-menu-panel,
body.dark-mode .fund-total,
body.dark-mode .attendance-group,
body.dark-mode .csv-import-panel {
  background: #0f2530;
  color: var(--ink);
  border-color: #263c4a;
}

body.dark-mode .message:not(.mine),
body.dark-mode .contact-list,
body.dark-mode .mobile-bottom-nav {
  background: #132f3c;
  border-color: #345261;
}

body.dark-mode #schedule,
body.dark-mode #chat,
body.dark-mode #roster,
body.dark-mode #attendance {
  background: var(--ice);
}

body.dark-mode a,
body.dark-mode .contact-item a {
  color: #8bd8ff;
}

body.auth-required .app-shell {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background: var(--ice);
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 24px;
  box-shadow: 0 18px 48px rgba(21, 32, 43, 0.12);
}

.auth-card h1 {
  margin: 0;
  font-size: 30px;
}

.auth-card .brand-logo-wrap {
  margin-bottom: 4px;
}

button,
input,
select,
textarea {
  font: inherit;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

button,
select,
input,
textarea {
  touch-action: manipulation;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: var(--navy);
  color: var(--white);
  border-top: 6px solid var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-header-actions,
.mobile-bottom-nav,
.mobile-roster-count,
.mobile-fab,
.member-avatar {
  display: none;
}

.brand h1,
.brand p,
.summary-copy h2,
.summary-copy p,
.section-heading h2,
.section-heading p {
  margin: 0;
}

.brand h1 {
  color: var(--gold);
  font-size: 28px;
}

.brand p,
.identity-panel p {
  color: rgba(255, 255, 255, 0.76);
}

.puck-mark {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #eaf4f3;
  border: 1px solid var(--teal);
  color: var(--navy);
  box-shadow: none;
}

.puck-mark::before {
  content: attr(data-initials);
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  font-weight: 800;
}

.brand-logo-wrap {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}

.brand-logo-wrap.large {
  width: 86px;
  height: 86px;
}

.team-logo {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: contain;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 5px;
}

.brand-logo-wrap .puck-mark {
  grid-area: 1 / 1;
}

.brand-logo-wrap .team-logo {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
}

.has-team-logo .brand-logo-wrap .puck-mark {
  display: none;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tab {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  text-align: left;
  padding: 0 14px;
}

.nav-tab.active,
.nav-tab:hover {
  background: var(--white);
  color: var(--navy);
  box-shadow: inset 5px 0 0 var(--gold);
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5f6368;
}

.search-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 4px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(13px, 13px) rotate(45deg);
}

.filter-icon::before,
.filter-icon::after {
  content: "";
  position: absolute;
  right: 10px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.filter-icon::before {
  top: 14px;
  width: 24px;
  box-shadow: 0 9px 0 currentColor;
}

.filter-icon::after {
  top: 32px;
  width: 14px;
}

.more-icon::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -11px 0 currentColor, 0 11px 0 currentColor;
}

.close-settings-icon::before,
.close-settings-icon::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.close-settings-icon::before {
  transform: rotate(45deg);
}

.close-settings-icon::after {
  transform: rotate(-45deg);
}

.mobile-settings-overlay,
.mobile-settings-panel,
.mobile-utility-overlay,
.mobile-utility-panel,
.mobile-team-menu-button {
  display: none;
}

.identity-panel {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.identity-panel h2 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
}

.identity-panel select {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
}

.main-content {
  padding: 28px;
  overflow: auto;
}

.top-strip {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  min-height: 220px;
  margin-bottom: 28px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.rink-visual {
  display: none;
}

.blue-line,
.center-line,
.faceoff {
  position: absolute;
}

.blue-line {
  top: 0;
  bottom: 0;
  width: 5px;
  background: #2677b8;
}

.blue-line.left {
  left: 27%;
}

.blue-line.right {
  right: 27%;
}

.faceoff {
  border: 3px solid var(--red);
  border-radius: 50%;
}

.faceoff.center {
  width: 92px;
  height: 92px;
  left: calc(50% - 46px);
  top: calc(50% - 46px);
}

.faceoff.dot-a,
.faceoff.dot-b {
  width: 44px;
  height: 44px;
  top: 38%;
}

.faceoff.dot-a {
  left: 12%;
}

.faceoff.dot-b {
  right: 12%;
}

.summary-copy,
.quick-stats {
  position: relative;
  z-index: 1;
}

.summary-copy {
  align-self: end;
  max-width: 620px;
}

.hero-logo {
  width: 86px;
  height: 86px;
  margin-bottom: 12px;
  border-color: var(--line);
  box-shadow: 0 10px 24px rgba(21, 32, 43, 0.12);
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.summary-copy h2 {
  margin-top: 6px;
  font-size: 42px;
}

.summary-copy p:last-child {
  margin-top: 10px;
  color: #34475a;
  line-height: 1.5;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 92px);
  gap: 10px;
  align-self: end;
}

body:not(.is-admin) .quick-stats {
  display: none;
}

.quick-stats div,
.panel,
.member-form,
.event-form,
.roster-card,
.permission-row,
.schedule-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.panel,
.member-form,
.event-form,
.fund-form,
.roster-card,
.permission-row,
.schedule-item {
  box-shadow: 0 8px 22px rgba(21, 32, 43, 0.05);
}

.quick-stats div {
  padding: 14px;
  text-align: center;
}

.quick-stats strong {
  display: block;
  font-size: 26px;
}

.quick-stats span {
  color: var(--muted);
  font-size: 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-top: 4px;
  font-size: 28px;
}

.home-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.home-install-status {
  margin: -8px 0 16px;
  text-align: right;
}

.dashboard-grid,
.chat-layout,
.permission-layout,
.attendance-layout,
.invite-layout,
.funds-layout,
.branding-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.chat-layout {
  grid-template-columns: minmax(0, 860px);
  align-items: start;
}

.permission-layout {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  align-items: start;
}

.upcoming-panel,
.attendance-panel {
  min-height: 100%;
}

.attendance-layout {
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

.invite-layout {
  grid-template-columns: 360px minmax(0, 1fr);
  align-items: start;
}

.funds-layout {
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
}

.funds-side {
  display: grid;
  gap: 18px;
}

.branding-layout {
  grid-template-columns: 420px minmax(0, 1fr);
  align-items: start;
}

.panel {
  padding: 18px;
  box-shadow: 0 8px 24px rgba(21, 32, 43, 0.06);
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.stacked-form,
.member-form,
.event-form,
.attendance-list,
.invite-form,
.fund-form,
.branding-form {
  display: grid;
  gap: 12px;
}

.brand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-panel {
  display: grid;
  gap: 12px;
  margin: 2px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.color-panel legend {
  padding: 0 6px;
  color: var(--ink);
  font-weight: 800;
}

.color-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.color-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.color-controls input {
  width: 100%;
  height: 42px;
  padding: 4px;
  border-radius: 8px;
  cursor: pointer;
}

.color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-preset {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 72px;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 3px;
}

.color-preset span {
  min-width: 0;
}

.color-preset span:first-child {
  border-radius: 999px 0 0 999px;
}

.color-preset span:last-child {
  border-radius: 0 999px 999px 0;
}

.preview-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfdff;
}

.preview-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 22px;
}

.member-form {
  grid-template-columns: 1fr;
  align-items: start;
  margin-bottom: 18px;
  padding: 18px;
}

.member-form-header,
.member-form-grid {
  display: grid;
  gap: 14px;
}

.member-form-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.member-form-header h3 {
  margin: 0;
}

.member-form-section {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.member-form-section legend {
  padding: 0 6px;
  font-weight: 800;
}

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

.member-form-section textarea {
  width: 100%;
}

.admin-warning {
  margin: 0;
  font-size: 13px;
}

.csv-import-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
}

.csv-import-panel h3,
.csv-import-panel p {
  margin: 0;
}

.csv-import-panel p {
  margin-top: 4px;
}

.csv-file-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

#csvImportResult {
  grid-column: 1 / -1;
  margin: 0;
}

.fund-summary {
  display: grid;
  gap: 10px;
}

.fund-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.fund-total span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.fund-total strong {
  font-size: 18px;
}

.fund-total.balance {
  border-color: color-mix(in srgb, var(--teal) 45%, var(--line));
  background: color-mix(in srgb, var(--teal) 9%, #ffffff);
}

.fund-ledger {
  display: grid;
  gap: 10px;
}

.fund-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.fund-row:last-child {
  border-bottom: 0;
}

.fund-row strong,
.fund-row span,
.fund-row small {
  display: block;
}

.fund-row span,
.fund-row small,
.fund-row p {
  color: var(--muted);
  font-size: 13px;
}

.fund-row p {
  margin: 6px 0 0;
}

.fund-amount {
  min-width: 96px;
  text-align: right;
  font-weight: 900;
}

.fund-row-side,
.fund-row-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.fund-row-actions {
  grid-auto-flow: column;
}

.fund-row.collected .fund-amount {
  color: #0f684f;
}

.fund-row.expense .fund-amount {
  color: #9c2430;
}

.event-form {
  grid-template-columns: 1.4fr 170px 140px 1fr auto;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: #304155;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
}

.event-picker {
  min-width: 320px;
}

textarea {
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
}

.primary-button {
  border: 0;
  background: var(--teal);
  color: #0f2338;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
}

.inline-link-button {
  display: inline;
  width: auto;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  padding: 0;
  font-weight: 800;
  text-decoration: underline;
}

.compact-button {
  min-height: 36px;
  padding: 0 12px;
}

.simple-list,
.member-list,
.schedule-list,
.invite-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.simple-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.simple-list li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

#announcementList li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

#announcementList span {
  min-width: 0;
}

.soft-remove-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 32px;
  border: 1px solid #ead0d3;
  border-radius: 999px;
  background: #fff8f8;
  color: #8e3340;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  padding: 0 11px;
}

.soft-remove-button:hover {
  border-color: #d9aeb4;
  background: #fff1f2;
}

.message-delete {
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
}

.next-event strong,
.schedule-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.next-event span,
.schedule-item span {
  color: var(--muted);
}

.access-snapshot {
  display: grid;
  gap: 10px;
}

.admin-reminders,
.admin-email-form,
.admin-phone-alert-form,
.phone-alert-panel {
  display: grid;
  gap: 12px;
}

.reminder-summary,
.reminder-list,
.email-summary,
.phone-alert-list {
  display: grid;
  gap: 10px;
}

.event-reminder-controls {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.event-reminder-controls label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.event-reminder-controls select {
  width: 100%;
}

.event-reminder-controls .secondary-button.is-active {
  border-color: rgba(34, 137, 145, 0.45);
  background: rgba(34, 137, 145, 0.12);
}

.phone-alert-item {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.phone-alert-item strong,
.phone-alert-item span {
  display: block;
}

.phone-alert-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.reminder-item strong,
.reminder-item span {
  display: block;
}

.reminder-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.home-event-list,
.home-attendance-list,
.home-contact-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-event-list li,
.home-attendance-item,
.home-contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.home-event-list li:last-child,
.home-attendance-item:last-child,
.home-contact-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.home-event-list strong,
.home-attendance-item strong,
.home-contact-item strong {
  display: block;
  margin-bottom: 4px;
}

.home-event-list span,
.home-attendance-item span:not(.status-badge),
.home-contact-item span {
  color: var(--muted);
  font-size: 12px;
}

.home-status-button {
  min-width: 56px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 12px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.home-status-button.status-yes {
  background: #1f8f63;
}

.home-status-button.status-no {
  background: #d95c66;
}

.home-status-button.status-maybe {
  background: #e6b64d;
  color: #35260a;
}

.home-status-button.status-pending {
  background: #dde3e7;
  color: #42505a;
}

.home-status-button.status-mixed {
  background: var(--navy);
}

.home-event-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 250px;
}

.home-event-actions.compact-actions {
  grid-template-columns: auto auto;
  justify-content: start;
  min-width: 0;
  margin-top: 10px;
}

.home-rsvp-stack {
  display: grid;
  gap: 6px;
  min-width: 132px;
}

.home-rsvp-player {
  display: grid;
  gap: 4px;
}

.home-rsvp-player > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.home-rsvp-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.home-rsvp-buttons.expanded {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  overflow: hidden;
  border-radius: 999px;
  gap: 0;
}

.home-rsvp-buttons.expanded .quick-rsvp-button {
  width: auto;
  min-width: 0;
  min-height: 32px;
  border-radius: 0;
  opacity: 0.62;
}

.home-rsvp-buttons.collapsed .quick-rsvp-button.current {
  min-width: 76px;
  min-height: 32px;
}

.map-button {
  display: inline-grid;
  min-width: 58px;
  min-height: 36px;
  place-items: center;
  border: 1px solid rgba(31, 139, 143, 0.34);
  border-radius: 999px;
  background: #ffffff;
  color: var(--team-primary);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.map-button:hover,
.map-button:focus-visible {
  border-color: var(--team-accent);
  background: rgba(31, 139, 143, 0.08);
  transform: translateY(-1px);
}

body.is-admin[data-view="dashboard"] .dashboard-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

body.is-admin[data-view="dashboard"] .upcoming-panel {
  grid-row: span 2;
}

body.is-admin[data-view="dashboard"] .phone-alert-panel,
body.is-admin[data-view="dashboard"] .parent-quick-panel,
body.is-admin[data-view="dashboard"] .team-contacts-panel {
  min-height: 0;
}

.access-row,
.permission-row,
.roster-card,
.schedule-item,
.attendance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.access-row {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.access-row:last-child {
  border-bottom: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.status-badge.allowed {
  background: #e8f7f1;
  color: #0f684f;
}

.status-badge.blocked {
  background: #fdecec;
  color: #9c2430;
}

.status-badge.warning {
  background: #fff4d8;
  color: #7b5810;
}

.chat-window {
  display: grid;
  grid-template-rows: minmax(360px, 58vh) auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  max-width: 100%;
}

.chat-thread-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 14px;
}

.chat-thread-button {
  display: grid;
  gap: 2px;
  min-height: 48px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 900;
  text-align: left;
}

.chat-thread-button span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thread-button.active {
  border-color: var(--team-primary);
  background: var(--team-primary);
  color: #ffffff;
}

.chat-thread-button.active span {
  color: rgba(255, 255, 255, 0.86);
}

.chat-conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.chat-conversation-header div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.chat-conversation-header strong {
  font-size: 1rem;
}

.chat-conversation-header span:not(.conversation-badge) {
  color: var(--muted);
  font-size: 0.86rem;
}

.conversation-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 1000;
}

.conversation-badge.group {
  background: #e7f0ff;
  color: #1856a7;
}

.conversation-badge.private {
  background: #fff2c7;
  color: #725209;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
  background: #ffffff;
}

.message {
  max-width: min(76%, 620px);
  padding: 12px 14px;
  border: 0;
  border-radius: 18px;
  background: #eef2f4;
  box-shadow: none;
}

.message.mine {
  align-self: flex-end;
  background: #1767bd;
  color: #ffffff;
}

.message.private-message {
  border-style: dashed;
}

.message-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.message strong {
  display: block;
  margin-bottom: 4px;
}

.message em {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 10%, #ffffff);
  color: var(--teal);
  padding: 2px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.message span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.message.mine .message-header,
.message.mine .message-header span,
.message.mine em,
.message.mine > span {
  color: rgba(255, 255, 255, 0.82);
}

.empty-messages {
  margin: auto;
  color: var(--muted);
  font-weight: 700;
}

.chat-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--team-primary);
}

.chat-form.locked {
  background: #4e2730;
}

.chat-recipient-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-weight: 800;
}

.chat-recipient-row select {
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-input-row input {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 16px;
}

.chat-input-row button {
  min-width: 70px;
  border-radius: 999px;
}

.member-list {
  display: grid;
  gap: 10px;
}

.member-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compact li {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.roster-grid,
.permission-list {
  display: grid;
  gap: 12px;
}

.roster-grid {
  grid-template-columns: 1fr;
}

.permission-row,
.schedule-item,
.attendance-row {
  padding: 16px;
}

.roster-card {
  min-height: 58px;
  padding: 12px 14px;
}

.roster-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border-color: #e1ebea;
  background: #ffffff;
}

.roster-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-width: 0;
}

.roster-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  justify-content: end;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.roster-main strong {
  display: block;
  line-height: 1.15;
}

.roster-subtitle {
  margin: 3px 0 0;
}

.roster-card .member-avatar,
.attendance-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid #d7e8e6;
  border-radius: 50%;
  background: #f2fbfa;
  color: #1f5960;
  font-size: 14px;
  font-weight: 800;
}

.contact-list {
  grid-column: 2 / -1;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.roster-contact-details {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 18px;
  width: 100%;
}

.contact-list + .contact-list {
  margin-top: 8px;
}

#roster .role-pill {
  display: none;
}

.contact-list p {
  margin: 0 0 6px;
}

.contact-heading {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-item {
  display: inline-grid;
  gap: 2px;
  min-width: min(240px, 100%);
  margin: 4px 14px 0 0;
  vertical-align: top;
  font-size: 13px;
}

.contact-item a {
  color: #176eb5;
  text-decoration: none;
}

.contact-action-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.contact-action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid currentColor;
  border-radius: 10px;
  background: #ffffff;
  padding: 0;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(18, 49, 58, 0.06);
}

.roster-chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--team-primary);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.roster-chat-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.roster-chat-toggle:has(input:focus-visible) {
  outline: 2px solid var(--team-accent);
  outline-offset: 2px;
}

.roster-chat-toggle i {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #c7d2da;
}

.roster-chat-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 160ms ease;
}

.roster-chat-toggle input:checked + i {
  background: #3b82f6;
}

.roster-chat-toggle input:checked + i::after {
  transform: translateX(14px);
}

.contact-action-badge::before {
  content: none;
}

.contact-action-badge .action-icon {
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
}

.call-action {
  color: #1a8a4b;
  background: #f7fff9;
}

.text-action {
  color: #1f73d8;
  background: #f7fbff;
}

.email-action {
  color: #7a54b9;
  background: #fbf8ff;
}

.private-action {
  color: #3e4a55;
  background: #f8fafb;
}

.contact-action-badge:hover,
.contact-action-badge:focus-visible {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(31, 139, 143, 0.12);
  transform: translateY(-1px);
}

.attendance-row {
  border: 1px solid #e1ebea;
  border-radius: 8px;
  background: var(--white);
}

.attendance-row.locked {
  background: #ffffff;
}

.attendance-summary {
  border-color: #cfe0df;
}

.attendance-summary .next-event {
  position: relative;
  border-radius: 8px;
  background: #12313a;
  color: #ffffff;
  padding: 14px 14px 14px 22px;
}

.attendance-summary .next-event::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: #d6a629;
}

.attendance-summary .next-event span,
.attendance-summary .next-event .muted {
  color: #dce9e8;
}

.schedule-item {
  border-color: #e1ebea;
}

.schedule-actions .secondary-button {
  border-color: #cfe0df;
  color: #12313a;
}

.attendance-group {
  display: grid;
  gap: 10px;
}

.attendance-group-title {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  margin: 4px 0 0;
  border-radius: 999px;
  background: #e8f4f3;
  color: #0f5960;
  padding: 0 12px;
  font-size: 16px;
}

.attendance-player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.attendance-player strong span {
  margin-left: 6px;
  font-weight: 500;
}

.attendance-note-button {
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: #1f8b8f;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
}

.attendance-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.attendance-count-card {
  appearance: none;
  border: 1px solid #cfe0df;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.attendance-count-card:hover,
.attendance-count-card:focus-visible,
.attendance-count-card.active {
  border-color: #1f8b8f;
  box-shadow: 0 0 0 3px rgba(31, 139, 143, 0.14);
}

.attendance-count-card:active {
  transform: translateY(1px);
}

.attendance-counts strong {
  display: block;
  font-size: 24px;
}

.attendance-counts span,
.attendance-mini {
  color: var(--muted);
  font-size: 12px;
}

.attendance-mini {
  margin-top: 8px;
}

.schedule-detail {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.arrival-time {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  background: #edf6f5;
  color: #0f5960;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 900;
}

.schedule-actions,
.rsvp-control,
.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.is-admin .schedule-actions {
  justify-content: flex-end;
}

body.is-admin .schedule-actions .map-button,
body.is-admin .schedule-actions .compact-button,
body.is-admin .schedule-actions .soft-remove-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 74px;
}

.schedule-quick-rsvp {
  display: grid;
  gap: 8px;
  width: 100%;
}

.schedule-rsvp-player {
  display: grid;
  gap: 6px;
}

.schedule-rsvp-player > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.schedule-rsvp-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.quick-rsvp-button {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  opacity: 0.86;
  transition: opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.quick-rsvp-button.selected {
  opacity: 1;
  outline: 0;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(31, 139, 143, 0.32);
}

.quick-rsvp-button.current {
  width: auto;
  min-width: 54px;
  opacity: 1;
  padding: 0 12px;
  color: #ffffff;
}

.quick-rsvp-button:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

.quick-rsvp-button span {
  display: none;
}

.quick-rsvp-button.current span {
  display: inline;
}

.quick-rsvp-button.current::before {
  content: "";
}

.quick-rsvp-button.status-yes {
  background: #218768;
}

.quick-rsvp-button.status-no {
  background: #c97880;
}

.quick-rsvp-button.status-maybe {
  background: #d8b34e;
  color: #35260a;
}

.quick-rsvp-button.status-pending {
  background: #a2adb2;
  color: #ffffff;
}

.quick-rsvp-button.status-yes::before {
  content: "IN";
}

.quick-rsvp-button.status-no::before {
  content: "OUT";
  font-size: 10px;
}

.quick-rsvp-button.status-maybe::before {
  content: "?";
}

.quick-rsvp-button.status-pending::before {
  content: "?";
}

@media (min-width: 721px) {
  .schedule-item {
    display: grid;
    grid-template-columns: 58px minmax(220px, 1fr) minmax(270px, 360px) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
  }

  .schedule-date-tile {
    display: grid;
    place-items: center;
    width: 52px;
    min-height: 58px;
    border-radius: 10px;
    background: #f2f6f8;
  }

  .schedule-date-tile strong {
    margin: 0;
    color: #102331;
    font-size: 20px;
    line-height: 1;
  }

  .schedule-date-tile span {
    color: #536978;
    font-size: 13px;
    font-weight: 800;
  }

  .schedule-item-main {
    min-width: 0;
  }

  .schedule-item-main > strong,
  .schedule-item-main > span,
  .schedule-detail {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .schedule-item-main > strong {
    white-space: normal;
  }

  .schedule-item-main > span {
    display: block;
  }

  .schedule-detail {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .schedule-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .schedule-quick-rsvp {
    gap: 8px;
    min-width: 0;
  }

  .schedule-rsvp-title {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .schedule-rsvp-player {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
  }

  .schedule-rsvp-player > span {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .schedule-rsvp-buttons {
    flex-wrap: nowrap;
    flex: 0 0 auto;
  }

  .schedule-actions .quick-rsvp-button {
    width: auto;
    min-width: 86px;
    min-height: 38px;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 13px;
    opacity: 0.62;
  }

  .schedule-actions .quick-rsvp-button span {
    display: inline;
  }

  .schedule-actions .quick-rsvp-button::before {
    content: "";
  }

  .schedule-actions .quick-rsvp-button.selected,
  .schedule-actions .schedule-rsvp-buttons.collapsed .quick-rsvp-button {
    opacity: 1;
  }

  .schedule-actions .schedule-rsvp-buttons.collapsed .quick-rsvp-button {
    min-width: 98px;
  }

  .schedule-actions > .secondary-button {
    width: auto;
    min-height: 38px;
    white-space: nowrap;
  }

  .event-availability-row .schedule-compact-rsvp {
    gap: 6px;
  }

  .event-availability-row .schedule-compact-rsvp.expanded {
    grid-template-columns: repeat(3, minmax(78px, 1fr));
  }

  .event-availability-row .schedule-compact-rsvp.collapsed {
    grid-template-columns: minmax(78px, auto);
  }

  .event-availability-row .schedule-compact-rsvp .quick-rsvp-button {
    width: auto;
    min-width: 78px;
    min-height: 38px;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 12px;
    opacity: 0.62;
  }

  .event-availability-row .schedule-compact-rsvp .quick-rsvp-button span {
    display: inline;
  }

  .event-availability-row .schedule-compact-rsvp .quick-rsvp-button::before {
    content: "";
  }

  .event-availability-row .schedule-compact-rsvp .quick-rsvp-button.selected {
    opacity: 1;
  }
}

.schedule-detail-screen {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.event-detail-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--team-primary);
  color: #ffffff;
}

.event-detail-topbar strong {
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-text-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.event-detail-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--team-primary);
}

.event-detail-tabs button {
  min-height: 46px;
  border: 0;
  border-bottom: 4px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.event-detail-tabs button.active {
  border-bottom-color: var(--team-accent);
  color: #ffffff;
}

.event-detail-panel,
.event-availability-panel {
  background: #ffffff;
}

.event-map-preview {
  position: relative;
  display: grid;
  min-height: 180px;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.62) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.62) 1px, transparent 1px),
    linear-gradient(135deg, #e7f1f5, #f7f9f4);
  background-size: 42px 42px, 42px 42px, auto;
  color: #2f6170;
  font-weight: 900;
  text-align: center;
}

.map-pin {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 50% 0;
  background: #d83a3a;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  transform: rotate(-45deg);
}

.map-pin::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 13px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #9d1f1f;
}

.event-map-preview span {
  display: inline-flex;
  max-width: 85%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  padding: 7px 14px;
}

.event-detail-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 22px 18px;
  text-align: center;
}

.event-detail-card strong {
  font-size: 24px;
  font-weight: 600;
}

.event-detail-card > span {
  color: #243844;
  font-size: 22px;
}

.event-detail-rsvp {
  display: grid;
  width: min(420px, 100%);
  gap: 12px;
}

.event-segmented-rsvp {
  display: grid;
  gap: 8px;
  width: 100%;
}

.event-segmented-rsvp > span {
  color: var(--ink);
  font-weight: 900;
}

.event-segmented-rsvp > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #d7dfe7;
  border-radius: 10px;
  background: #eef1f4;
}

.event-segmented-rsvp .quick-rsvp-button {
  width: auto;
  min-width: 0;
  min-height: 46px;
  border-radius: 0;
  color: #ffffff;
  opacity: 0.5;
}

.event-segmented-rsvp .quick-rsvp-button span {
  display: inline;
}

.event-segmented-rsvp .quick-rsvp-button::before {
  content: "";
}

.event-segmented-rsvp .quick-rsvp-button.selected {
  opacity: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.event-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 70px;
  border: 0;
  border-top: 1px solid #d8e0e8;
  background: #ffffff;
  color: #25485a;
  cursor: pointer;
  font: inherit;
  padding: 14px 18px;
  text-align: left;
  text-decoration: none;
}

.event-detail-row strong {
  color: #1767bd;
  font-weight: 900;
}

.event-availability-panel {
  padding: 0 16px 18px;
}

.event-availability-heading {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d8e0e8;
  color: #263843;
}

.event-availability-heading strong {
  font-size: 22px;
}

.event-availability-heading span {
  color: var(--muted);
  font-size: 13px;
}

.event-availability-group h3 {
  margin: 18px 0 10px;
  color: #1767bd;
  font-size: 22px;
}

.event-availability-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
}

.event-availability-row strong {
  display: block;
  overflow: hidden;
  color: #263843;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-availability-row strong span {
  margin-left: 6px;
  font-weight: 500;
}

.schedule-compact-rsvp {
  display: grid;
  gap: 5px;
}

.schedule-compact-rsvp.expanded {
  grid-template-columns: repeat(3, 36px);
}

.schedule-compact-rsvp.collapsed {
  grid-template-columns: 54px;
}

.schedule-compact-rsvp .quick-rsvp-button {
  width: 36px;
  min-width: 36px;
  min-height: 34px;
  border-radius: 9px;
}

.invite-list {
  display: grid;
  gap: 12px;
}

.roster-invite-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.roster-invite-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.roster-invite-layout h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.invite-item div:first-child {
  display: grid;
  gap: 4px;
}

.invite-item a {
  color: #176eb5;
  text-decoration: none;
}

.invite-item span:not(.status-badge) {
  color: var(--muted);
  font-size: 12px;
}

.invite-status-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 8px;
  border-radius: 999px;
  background: #eef8f5;
  color: var(--teal);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 900;
}

.invite-status-summary strong {
  color: var(--ink);
  font-size: 15px;
}

.rsvp-option {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: #87949a;
  color: #ffffff;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.34;
}

.rsvp-option input {
  display: none;
}

.rsvp-option span {
  display: none;
}

.rsvp-option.selected {
  outline: 2px solid #d6a629;
  outline-offset: 2px;
  opacity: 1;
}

.rsvp-option.disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.rsvp-option::before {
  font-weight: 900;
}

.rsvp-option.status-yes {
  background: #1f8b5f;
}

.rsvp-option.status-no {
  background: #b9474f;
}

.rsvp-option.status-maybe {
  background: #d6a629;
}

.rsvp-option.status-pending {
  background: #87949a;
}

.rsvp-option.status-yes::before {
  content: "IN";
}

.rsvp-option.status-no::before {
  content: "OUT";
  font-size: 10px;
}

.rsvp-option.status-maybe::before {
  content: "?";
  font-size: 14px;
}

.rsvp-option.status-pending::before {
  content: "--";
}

.jersey-number {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
}

.role-pill {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  background: #eef2f6;
  color: #42556b;
  padding: 4px 9px;
  font-size: 12px;
}

.toggle {
  position: relative;
  display: inline-flex;
  width: 54px;
  height: 30px;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle span {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #c6d0da;
}

.toggle span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 160ms ease;
}

.toggle input:checked + span {
  background: var(--teal);
}

.toggle input:checked + span::after {
  transform: translateX(24px);
}

.schedule-list {
  display: grid;
  gap: 12px;
}

.schedule-readonly-note {
  margin: 0 0 14px;
}

.schedule-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.schedule-month-picker {
  display: inline-grid;
  gap: 5px;
  min-width: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.schedule-month-picker select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 0 12px;
}

.schedule-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 4px;
}

.schedule-page-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-right: 4px;
}

.schedule-page-button {
  min-height: 38px;
  min-width: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  padding: 0 13px;
}

.schedule-page-button.active {
  border-color: var(--team-primary);
  background: var(--team-primary);
  color: #ffffff;
}

.schedule-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.schedule-page-gap {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  padding: 0 4px;
}

.schedule-page-size {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  margin-left: 4px;
}

.schedule-page-size select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  padding: 0 10px;
}

.schedule-score-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  border-radius: 6px;
  background: #405d72;
  color: #ffffff;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.danger-button {
  border: 1px solid #f1b9bd;
  border-radius: 8px;
  background: #fff4f5;
  color: #9c2430;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 700;
}

@media (max-width: 1080px) {
  .app-shell {
    align-content: start;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 14px;
    padding: 14px 18px;
    box-shadow: 0 10px 28px rgba(21, 32, 43, 0.16);
  }

  .brand {
    min-width: 0;
  }

  .brand h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand p {
    display: none;
  }

  .nav-tabs {
    display: flex;
    gap: 8px;
    margin: 0 -18px;
    padding: 0 18px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 0 0 auto;
    min-width: 104px;
    min-height: 46px;
    text-align: center;
    scroll-snap-align: start;
  }

  .dashboard-grid,
  .chat-layout,
  .permission-layout,
  .attendance-layout,
  .invite-layout,
  .funds-layout,
  .branding-layout,
  .roster-grid {
    grid-template-columns: 1fr;
  }

  .member-form,
  .event-form,
  .fund-form {
    grid-template-columns: 1fr 1fr;
  }

  .member-form,
  .member-form-grid {
    grid-template-columns: 1fr;
  }

  .contact-field {
    grid-column: 1 / -1;
  }

  .identity-panel {
    margin-top: 0;
    padding-top: 12px;
  }
}

@media (max-width: 720px) {
  body {
    background: #ffffff;
  }

  body.dark-mode {
    background: #071924;
  }

  .sidebar {
    min-height: 0;
    padding: 8px 12px;
    background: #ffffff;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(21, 32, 43, 0.08);
  }

  body.dark-mode .sidebar,
  body.dark-mode .mobile-bottom-nav {
    background: #0f2530;
    border-color: #263c4a;
  }

  body.dark-mode .brand h1,
  body.dark-mode .mobile-nav-tab,
  body.dark-mode .icon-button {
    color: var(--ink);
  }

  .main-content {
    max-width: 100vw;
    overflow-x: hidden;
    padding: 0 0 92px;
  }

  .view,
  .panel,
  .roster-card,
  .schedule-item,
  .chat-window,
  .attendance-row,
  .fund-row {
    min-width: 0;
    max-width: 100%;
  }

  body[data-view="attendance"] .main-content {
    padding: 0 0 78px;
  }

  body[data-view="attendance"] .sidebar {
    padding: 4px 10px;
  }

  body[data-view="attendance"] .brand {
    min-height: 42px;
  }

  body[data-view="attendance"] .brand-logo-wrap,
  body[data-view="attendance"] .puck-mark {
    width: 38px;
    height: 38px;
  }

  .brand-logo-wrap {
    width: 48px;
    height: 48px;
  }

  .puck-mark {
    width: 48px;
    height: 48px;
    background: #fff7f3;
    border: 2px solid #f3d9c8;
    box-shadow: none;
  }

  body.dark-mode .puck-mark {
    background: #132f3c;
    border-color: #345261;
  }

  .puck-mark::before {
    content: attr(data-initials);
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #6b625d;
    font-size: 13px;
  }

  .brand h1 {
    max-width: 178px;
    color: #111111;
    font-size: 18px;
    line-height: 1.1;
  }

  .brand {
    gap: 10px;
    min-height: 54px;
  }

  .mobile-team-menu-button {
    display: grid;
    place-items: center;
    width: 8px;
    height: 8px;
    margin-left: -6px;
    padding: 10px;
    border: 0;
    background: transparent;
  }

  .mobile-team-menu-button::before {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 3px solid #606468;
    border-bottom: 3px solid #606468;
    transform: rotate(45deg) translateY(-4px);
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
  }

  .mobile-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    background: rgba(5, 18, 27, 0.34);
    opacity: 0;
    transition: opacity 160ms ease;
  }

  .mobile-utility-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    background: rgba(5, 18, 27, 0.28);
    opacity: 0;
    transition: opacity 160ms ease;
  }

  .mobile-settings-panel,
  .mobile-utility-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 70;
    display: grid;
    gap: 14px;
    max-height: calc(100vh - 84px);
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 20px 60px rgba(21, 32, 43, 0.28);
    transform: translateY(22px);
    opacity: 0;
    transition: opacity 160ms ease, transform 160ms ease;
  }

  .mobile-settings-overlay[hidden],
  .mobile-settings-panel[hidden],
  .mobile-utility-overlay[hidden],
  .mobile-utility-panel[hidden] {
    display: none;
  }

  body.settings-open .mobile-settings-overlay,
  body.utility-open .mobile-utility-overlay {
    opacity: 1;
  }

  body.settings-open .mobile-settings-panel,
  body.utility-open .mobile-utility-panel {
    transform: translateY(0);
    opacity: 1;
  }

  .mobile-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-settings-header h2 {
    margin: 2px 0 0;
    font-size: 24px;
  }

  .settings-list {
    display: grid;
    gap: 8px;
  }

  .settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
    text-align: left;
  }

  .settings-row span {
    display: grid;
    gap: 3px;
  }

  .settings-row small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
  }

  .settings-row.is-on {
    border-color: rgba(34, 137, 145, 0.45);
    background: rgba(34, 137, 145, 0.1);
  }

  .mobile-search-field {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-weight: 800;
  }

  .mobile-search-field input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 12px;
  }

  .mobile-search-results {
    display: grid;
    gap: 8px;
    max-height: 45vh;
    overflow: auto;
  }

  .search-result-button {
    display: grid;
    gap: 3px;
    min-height: 54px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink);
    text-align: left;
  }

  .search-result-button span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
  }

  .filter-chip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .filter-chip {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 800;
  }

  .filter-chip.active {
    border-color: var(--teal);
    background: rgba(34, 137, 145, 0.12);
    color: var(--teal);
  }

  .danger-setting-row strong {
    color: var(--red);
  }

  .switch-input {
    appearance: none;
    position: relative;
    width: 50px;
    height: 28px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: #d9e2ea;
  }

  .switch-input::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(21, 32, 43, 0.18);
    transition: transform 160ms ease;
  }

  .switch-input:checked {
    background: var(--teal);
  }

  .switch-input:checked::before {
    transform: translateX(22px);
  }

  .icon-button {
    width: 34px;
    height: 34px;
  }

  .search-icon::before {
    width: 15px;
    height: 15px;
    border-width: 3px;
  }

  .search-icon::after {
    width: 12px;
    height: 3px;
    transform: translate(10px, 10px) rotate(45deg);
  }

  .filter-icon::before {
    top: 10px;
    width: 20px;
    box-shadow: 0 8px 0 currentColor;
  }

  .filter-icon::after {
    top: 26px;
    width: 12px;
  }

  .nav-tabs,
  .identity-panel {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    min-height: 72px;
    padding: 7px 4px 9px;
    border-top: 1px solid #dfe4ea;
    background: #f5f6f8;
    box-shadow: 0 -8px 22px rgba(21, 32, 43, 0.08);
  }

  .mobile-bottom-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav-tab {
    display: grid;
    place-items: center;
    gap: 3px;
    flex: 0 0 63px;
    min-width: 63px;
    min-height: 56px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #606468;
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-nav-tab.active {
    color: #0f70c7;
  }

  .mobile-nav-tab.active .mobile-nav-icon {
    background: #d7eaff;
  }

  .mobile-nav-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 28px;
    border-radius: 999px;
  }

  .mobile-nav-icon::before {
    color: currentColor;
    font-size: 21px;
    line-height: 1;
  }

  .home-nav-icon::before {
    content: "H";
  }

  .schedule-nav-icon::before {
    content: "Cal";
    font-size: 14px;
  }

  .roster-nav-icon::before {
    content: "Roster";
    font-size: 11px;
  }

  .chat-nav-icon::before {
    content: "Msg";
    font-size: 13px;
  }

  .attendance-nav-icon::before {
    content: "!";
  }

  .funds-nav-icon::before {
    content: "$";
  }

  .invites-nav-icon::before {
    content: "+";
  }

  .branding-nav-icon::before {
    content: "B";
  }

  .admin-nav-icon::before {
    content: "Adm";
    font-size: 13px;
  }

  .member-form,
  .event-form,
  .fund-form,
  .top-strip,
  .quick-stats,
  .attendance-counts {
    grid-template-columns: 1fr;
  }

  .member-form-header,
  .member-form-grid {
    grid-template-columns: 1fr;
  }

  .event-picker {
    min-width: 0;
    width: 100%;
  }

  .top-strip {
    min-height: 0;
    gap: 16px;
    margin: 0 0 12px;
    padding: 18px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: 0 8px 22px rgba(21, 32, 43, 0.08);
  }

  body:not([data-view="dashboard"]) .top-strip {
    display: none;
  }

  .rink-visual {
    opacity: 0.25;
  }

  .hero-logo {
    width: 62px;
    height: 62px;
    margin-bottom: 8px;
  }

  .summary-copy h2 {
    font-size: 30px;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .summary-copy p:last-child {
    font-size: 14px;
  }

  .quick-stats {
    display: none !important;
  }

  .section-heading {
    gap: 10px;
    margin: 0;
    padding: 16px 18px 12px;
  }

  .section-heading h2 {
    font-size: 24px;
  }

  .panel,
  .member-form,
  .event-form,
  .fund-form {
    padding: 14px;
    box-shadow: 0 6px 18px rgba(21, 32, 43, 0.06);
  }

  .parent-quick-panel {
    display: none;
  }

  body[data-view="dashboard"] .top-strip {
    display: none;
  }

  body[data-view="dashboard"] .main-content {
    padding: 0 8px 88px;
  }

  body[data-view="dashboard"] .section-heading {
    padding: 12px 8px 8px;
  }

  body[data-view="dashboard"] .section-heading h2 {
    font-size: 22px;
  }

  body[data-view="dashboard"] #resetDemo {
    display: none;
  }

  body[data-view="dashboard"] .home-heading-actions {
    justify-content: flex-start;
  }

  body[data-view="dashboard"] .home-install-status {
    margin: -4px 8px 10px;
    text-align: left;
  }

  body[data-view="dashboard"] .dashboard-grid {
    gap: 8px;
  }

  body[data-view="dashboard"] .panel {
    padding: 11px 12px;
    border-radius: 10px;
    box-shadow: 0 5px 14px rgba(21, 32, 43, 0.05);
  }

  body[data-view="dashboard"] .panel h3 {
    margin-bottom: 8px;
    font-size: 16px;
  }

  body[data-view="dashboard"] .team-contacts-panel,
  body[data-view="dashboard"] .parent-quick-panel,
  body[data-view="dashboard"] .phone-alert-panel {
    display: none;
  }

  body[data-view="dashboard"] .home-event-list {
    gap: 6px;
  }

  body[data-view="dashboard"] .home-event-list li {
    min-height: 44px;
    padding: 8px 0;
  }

  body[data-view="dashboard"] .home-event-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  body[data-view="dashboard"] .home-rsvp-stack,
  body[data-view="dashboard"] .home-rsvp-player,
  body[data-view="dashboard"] .home-rsvp-buttons {
    width: 100%;
  }

  body[data-view="dashboard"] .home-event-actions {
    grid-template-columns: minmax(0, 1fr) 54px;
    width: 100%;
    min-width: 0;
  }

  body[data-view="dashboard"] .map-button {
    min-width: 54px;
    min-height: 30px;
  }

  body[data-view="dashboard"] .home-rsvp-buttons.collapsed .quick-rsvp-button.current {
    width: 100%;
    min-height: 30px;
    border-radius: 999px;
  }

  body[data-view="dashboard"] .home-rsvp-buttons.expanded {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  body[data-view="dashboard"] .home-rsvp-buttons.expanded .quick-rsvp-button {
    min-height: 32px;
  }

  body[data-view="dashboard"] .home-event-list strong,
  body[data-view="dashboard"] .next-event strong {
    font-size: 15px;
  }

  body[data-view="dashboard"] .home-event-list span,
  body[data-view="dashboard"] .next-event span,
  body[data-view="dashboard"] .attendance-mini,
  body[data-view="dashboard"] .muted {
    font-size: 12px;
    line-height: 1.35;
  }

  .dashboard-grid,
  .chat-layout,
  .permission-layout,
  .attendance-layout,
  .invite-layout,
  .roster-invite-layout,
  .funds-layout,
  .branding-layout,
  .roster-grid,
  .attendance-list,
  .schedule-list {
    gap: 12px;
  }

  #funds .section-heading {
    padding: 18px 18px 0;
    margin-bottom: 10px;
  }

  #funds .section-heading h2 {
    font-size: 24px;
  }

  .funds-layout {
    padding: 0 10px;
  }

  .funds-side {
    gap: 12px;
  }

  .fund-summary {
    gap: 8px;
  }

  .fund-total {
    min-height: 42px;
    padding: 8px 12px;
  }

  .fund-total strong {
    font-size: 16px;
  }

  .fund-ledger {
    gap: 0;
  }

  .fund-row {
    gap: 10px;
    padding: 10px 0;
  }

  .fund-row p {
    margin-top: 4px;
  }

  .fund-amount {
    min-width: 82px;
  }

  .fund-row-side {
    gap: 6px;
  }

  .fund-row-actions {
    grid-auto-flow: row;
  }

  #schedule .section-heading {
    padding: 10px 14px 8px;
  }

  #schedule .section-heading h2 {
    font-size: 22px;
  }

  .schedule-filter-bar {
    position: sticky;
    top: 61px;
    z-index: 7;
    margin: 0;
    border-bottom: 1px solid #d7dce2;
    background: #ffffff;
    padding: 10px 14px;
  }

  .schedule-month-picker {
    width: 100%;
    min-width: 0;
  }

  .schedule-month-picker span {
    display: none;
  }

  .schedule-month-picker select {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #111827;
    font-size: 20px;
    padding: 0 4px;
  }

  .schedule-readonly-note {
    display: none;
  }

  .schedule-list {
    gap: 6px;
    padding: 0 10px 12px;
  }

  .schedule-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid #e4e9ee;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .schedule-date-tile {
    display: grid;
    place-items: center;
    width: 50px;
    min-height: 50px;
    border-radius: 14px;
    background: #f2f5f7;
    color: #12232d;
  }

  .schedule-date-tile strong {
    margin: 0;
    color: #12232d;
    font-size: 22px;
    line-height: 1;
  }

  .schedule-date-tile span {
    color: #74808b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
  }

  .schedule-item-main {
    min-width: 0;
  }

  .schedule-item-main > strong {
    margin-bottom: 2px;
    overflow: hidden;
    color: #1b2a34;
    font-size: 16px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .schedule-item-main > span {
    display: block;
    overflow: hidden;
    color: #6d7780;
    font-size: 13px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .schedule-item-main > span b {
    color: #1b2a34;
    font-size: 15px;
  }

  .schedule-score-badge {
    display: inline-flex;
    margin-top: 4px;
    background: #405d72;
    font-size: 12px;
  }

  .schedule-actions .quick-rsvp-button span {
    display: inline;
  }

  .schedule-item .attendance-mini {
    display: none;
  }

  .section-heading,
  .access-row,
  .permission-row,
  .roster-card,
  .schedule-item,
  .attendance-row,
  .home-event-list li,
  .home-attendance-item,
  .home-contact-item,
  .reminder-item,
  .invite-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .message {
    max-width: 82%;
    border: 0;
    border-radius: 20px;
    background: #eff2f3;
    box-shadow: none;
  }

  .message.mine {
    margin-left: auto;
    background: #1767bd;
    color: #ffffff;
  }

  .message.mine .message-header,
  .message.mine .message-header span,
  .message.mine em {
    color: rgba(255, 255, 255, 0.82);
  }

  .message-header {
    align-items: center;
    gap: 6px;
  }

  .message-header span {
    color: #8b949e;
    font-size: 12px;
  }

  .message-delete {
    display: grid;
    place-items: center;
    width: 26px !important;
    min-width: 26px;
    min-height: 26px;
    margin-left: auto;
    border-radius: 50%;
    padding: 0;
    font-size: 0;
  }

  .message-delete::before {
    content: "x";
    font-size: 13px;
    font-weight: 900;
  }

  #chat .section-heading {
    padding: 12px 14px 8px;
  }

  .chat-thread-list {
    flex-wrap: nowrap;
    margin: 0;
    padding: 0 14px 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .chat-thread-button {
    min-width: 154px;
    min-height: 46px;
    padding: 7px 10px;
  }

  .chat-conversation-header {
    margin: 0 14px 10px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .chat-conversation-header strong {
    font-size: 0.96rem;
  }

  .chat-conversation-header span:not(.conversation-badge) {
    font-size: 0.78rem;
  }

  .conversation-badge {
    padding: 5px 8px;
  }

  .chat-window {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    height: calc(100dvh - 276px);
    min-height: 340px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    overflow: hidden;
  }

  .chat-messages {
    min-height: 0;
    overflow-y: auto;
    padding: 14px 12px 128px;
    background: #ffffff;
  }

  .chat-form {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 74px;
    z-index: 40;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    background: var(--team-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 -8px 22px rgba(21, 32, 43, 0.14);
  }

  .chat-recipient-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    color: #ffffff;
    font-size: 12px;
  }

  .chat-recipient-row select {
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink);
    font-weight: 800;
  }

  .chat-side {
    display: none;
  }

  .chat-input-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .chat-input-row input,
  .chat-recipient-row select {
    min-width: 0;
    width: 100%;
  }

  .chat-input-row input {
    min-height: 52px;
    border: 0;
    border-radius: 999px;
    background: #f3f5f6;
    padding: 0 20px;
    font-size: 16px;
  }

  .chat-input-row button {
    display: grid;
    place-items: center;
    width: 52px;
    min-width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 0;
    font-size: 0;
  }

  .chat-input-row button::before {
    content: ">";
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
  }

  .chat-form .chat-input-row button {
    width: 52px;
    min-width: 52px;
  }

  .chat-form button,
  .member-form button,
  .event-form button,
  .invite-form button,
  .branding-form button,
  .brand-actions button,
  .schedule-actions button,
  .invite-actions button,
  .reminder-item button,
  .home-event-list button {
    width: 100%;
  }

  .chat-input-row button {
    width: auto;
  }

  .soft-remove-button,
  .message-delete,
  .roster-actions .soft-remove-button,
  .schedule-actions .soft-remove-button {
    width: fit-content;
  }

  .schedule-actions,
  .invite-actions,
  .brand-actions,
  .rsvp-control {
    width: 100%;
  }

  .schedule-actions {
    grid-column: 2 / -1;
    align-items: stretch;
    width: 100%;
    margin-top: 4px;
  }

  .schedule-actions .map-button {
    width: 100%;
    min-height: 36px;
  }

  .schedule-rsvp-player {
    grid-template-columns: auto;
    align-items: center;
  }

  .schedule-rsvp-player > span {
    display: none;
  }

  .schedule-rsvp-title {
    display: none;
  }

  .schedule-rsvp-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0;
  }

  .schedule-rsvp-buttons.expanded,
  .schedule-compact-rsvp.expanded {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border-radius: 8px;
  }

  .schedule-rsvp-buttons.collapsed,
  .schedule-compact-rsvp.collapsed {
    display: flex;
    justify-content: flex-end;
  }

  .schedule-actions .quick-rsvp-button {
    width: auto;
    min-width: 0;
    min-height: 36px;
    border-radius: 0;
    padding: 0 8px;
    font-size: 11px;
    opacity: 0.52;
  }

  .schedule-actions .quick-rsvp-button::before {
    content: "";
  }

  .schedule-actions .schedule-rsvp-buttons.collapsed .quick-rsvp-button {
    width: 62px;
    min-width: 62px;
    min-height: 38px;
    border-radius: 9px;
    opacity: 1;
  }

  .schedule-actions .quick-rsvp-button.current {
    width: 62px;
    min-width: 62px;
    opacity: 1;
  }

  .schedule-actions .schedule-rsvp-buttons.expanded .quick-rsvp-button {
    width: auto;
    min-width: 0;
    border-radius: 0;
  }

  .schedule-compact-rsvp.collapsed .quick-rsvp-button {
    width: 62px;
    min-width: 62px;
    border-radius: 9px;
    opacity: 1;
  }

  .schedule-compact-rsvp.expanded .quick-rsvp-button {
    width: auto;
    min-width: 0;
    border-radius: 0;
  }

  .schedule-actions > .secondary-button {
    display: none;
  }

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

  .rsvp-option {
    justify-content: center;
    min-height: 44px;
  }

  .roster-main,
  .preview-card {
    width: 100%;
    flex-direction: column;
  }

  .roster-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .roster-card .member-avatar {
    width: 42px;
    height: 42px;
  }

  .roster-main {
    min-width: 0;
    gap: 8px;
  }

  .roster-main strong,
  .roster-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .roster-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .roster-actions .compact-button,
  .roster-details-toggle {
    width: auto;
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }

  .roster-card .jersey-number {
    min-width: 42px;
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }

  .roster-contact-details {
    display: none;
    grid-column: 1 / -1;
  }

  .roster-card.expanded .roster-contact-details {
    display: block;
  }

  #roster .contact-list {
    margin-top: 8px;
    padding-top: 8px;
  }

  .jersey-number {
    width: auto;
    min-width: 74px;
    height: 36px;
    border-radius: 999px;
    padding: 0 12px;
  }

  .status-badge {
    min-height: 32px;
  }

  #attendance {
    background: #ffffff;
  }

  #attendance .section-heading {
    position: static;
    z-index: 11;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 18px;
    background: #ffffff;
    border-bottom: 1px solid #d7dce2;
  }

  #attendance .section-heading .eyebrow {
    display: none;
  }

  #attendance .section-heading > div {
    display: none;
  }

  #attendance .section-heading h2 {
    display: none;
  }

  #attendance .event-picker {
    position: relative;
    display: block;
    color: transparent;
    font-size: 0;
  }

  #attendance .event-picker::before {
    content: "Players";
    display: inline-block;
    color: #202124;
    font-size: 22px;
    font-weight: 500;
  }

  #attendance .event-picker::after {
    content: "";
    position: absolute;
    top: 36px;
    right: 12px;
    width: 10px;
    height: 10px;
    border-right: 6px solid #606468;
    border-bottom: 6px solid #606468;
    transform: rotate(45deg);
  }

  #attendanceEventSelect {
    width: 100%;
    min-height: 34px;
    margin-top: 4px;
    color: #304155;
    font-size: 13px;
  }

  #attendance .attendance-layout {
    display: block;
    gap: 0;
  }

  #attendance .attendance-summary {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #1765b8;
    color: #ffffff;
    box-shadow: none;
  }

  #attendance .attendance-summary h3 {
    display: none;
  }

  #attendance .attendance-summary .next-event {
    display: grid;
    gap: 2px;
    padding: 4px 6px 8px;
  }

  #attendance .attendance-summary .next-event strong {
    max-width: 92%;
    overflow: hidden;
    color: #ffffff;
    font-size: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #attendance .attendance-summary .next-event span,
  #attendance .attendance-summary .next-event .muted {
    color: #dcecff;
    font-size: 12px;
    line-height: 1.3;
  }

  #attendance .attendance-counts {
    display: none;
  }

  #attendance .attendance-list {
    gap: 0;
    background: #ffffff;
  }

  #attendance .attendance-group {
    gap: 0;
    padding: 0 14px;
  }

  #attendance .attendance-group-title {
    margin: 12px 0 4px;
    color: #1765b8;
    font-size: 19px;
    font-weight: 800;
  }

  #attendance .attendance-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 48px;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  #attendance .attendance-row.locked {
    background: #ffffff;
  }

  #attendance .attendance-player {
    min-width: 0;
  }

  #attendance .attendance-avatar {
    width: 34px;
    height: 34px;
    border: 0;
    background: #d9d9d9;
    color: #ffffff;
    font-size: 13px;
  }

  #attendance .attendance-player strong {
    display: block;
    color: #202124;
    font-size: 16px;
    line-height: 1.12;
  }

  #attendance .attendance-note-button {
    color: #1689d8;
    font-size: 13px;
    line-height: 1.1;
  }

  #attendance .attendance-player .muted,
  #attendance .role-pill {
    display: none;
  }

  #attendance .rsvp-control {
    display: grid;
    grid-template-columns: repeat(4, 24px);
    gap: 3px;
    width: auto;
  }

  #attendance .rsvp-option {
    display: grid;
    place-items: center;
    width: 24px;
    min-height: 24px;
    border: 0;
    border-radius: 7px;
    padding: 0;
    color: #ffffff;
  }

  #attendance .rsvp-option input,
  #attendance .rsvp-option span {
    display: none;
  }

  #attendance .rsvp-option::before,
  #attendance .status-badge::before {
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
  }

  #attendance .rsvp-option.status-yes,
  #attendance .status-badge.allowed {
    background: #74bf3b;
  }

  #attendance .rsvp-option.status-no,
  #attendance .status-badge.blocked {
    background: #e9575d;
  }

  #attendance .rsvp-option.status-maybe,
  #attendance .rsvp-option.status-pending,
  #attendance .status-badge.warning {
    background: #f4b33d;
  }

  #attendance .rsvp-option.status-yes::before,
  #attendance .status-badge.allowed::before {
    content: "✓";
  }

  #attendance .rsvp-option.status-no::before,
  #attendance .status-badge.blocked::before {
    content: "×";
  }

  #attendance .rsvp-option.status-maybe::before {
    content: "?";
  }

  #attendance .rsvp-option.status-pending::before,
  #attendance .status-badge.warning::before {
    content: "…";
  }

  #attendance .rsvp-option:not(.selected) {
    opacity: 0.34;
  }

  #attendance .rsvp-option.selected {
    box-shadow: 0 4px 12px rgba(21, 32, 43, 0.18);
    opacity: 1;
  }

  #attendance .status-badge {
    display: grid;
    place-items: center;
    width: 32px;
    min-height: 32px;
    border-radius: 7px;
    padding: 0;
    color: #ffffff;
    font-size: 0;
  }

  body[data-view="attendance"] {
    background: #f7faf9;
  }

  body[data-view="attendance"] .sidebar {
    border-bottom: 3px solid var(--gold);
    background: #fbfdfc;
  }

  body[data-view="attendance"] .puck-mark {
    background: #f2fbfa;
    border-color: #b8dddc;
  }

  body[data-view="attendance"] .brand h1 {
    color: var(--navy);
  }

  #attendance {
    background: #f7faf9;
  }

  #attendance .section-heading {
    padding: 8px 14px 10px;
    border-bottom: 0;
    background: #f7faf9;
  }

  #attendance .event-picker::before {
    color: #12232d;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0;
  }

  #attendanceEventSelect {
    border: 1px solid #cfe0df;
    border-left: 5px solid #1f8b8f;
    border-radius: 8px;
    background: #ffffff;
    color: #12232d;
    font-weight: 700;
  }

  #attendance .event-picker::after {
    border-color: #1f5960;
  }

  #attendance .attendance-summary {
    margin: 0 8px;
    border-radius: 8px;
    background: #12313a;
    box-shadow: 0 8px 18px rgba(18, 49, 58, 0.18);
  }

  #attendance .attendance-summary .next-event {
    position: relative;
    padding: 7px 10px 8px 17px;
  }

  #attendance .attendance-summary .next-event::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: #d6a629;
  }

  #attendance .attendance-summary .next-event strong {
    font-size: 16px;
    letter-spacing: 0;
  }

  #attendance .attendance-summary .next-event span,
  #attendance .attendance-summary .next-event .muted {
    color: #dce9e8;
    font-size: 12px;
    line-height: 1.25;
  }

  #attendance .attendance-list {
    background: #f7faf9;
  }

  #attendance .attendance-group {
    padding: 0 10px;
  }

  #attendance .attendance-group-title {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    margin: 12px 0 5px;
    border-radius: 999px;
    background: #e8f4f3;
    color: #0f5960;
    padding: 0 10px;
    font-size: 15px;
  }

  #attendance .attendance-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 0;
    margin-bottom: 4px;
    padding: 8px 10px;
    border: 1px solid #e1ebea;
    border-radius: 8px;
    background: #ffffff;
  }

  #attendance .attendance-row.locked {
    background: #ffffff;
  }

  #attendance .attendance-avatar {
    width: 30px;
    height: 30px;
    background: #edf2f1;
    color: #4a5b60;
    font-weight: 800;
  }

  #attendance .attendance-player strong {
    color: #12232d;
    font-size: 15px;
  }

  #attendance .attendance-note-button {
    color: #1f8b8f;
    font-size: 12px;
    font-weight: 800;
  }

  #attendance .rsvp-control {
    display: flex;
    gap: 5px;
    width: auto;
    margin-left: 0;
  }

  #attendance .rsvp-option,
  #attendance .status-badge {
    width: 34px;
    min-height: 30px;
    border-radius: 999px;
    box-shadow: none;
  }

  #attendance .rsvp-option::before,
  #attendance .status-badge::before,
  .quick-rsvp-button::before {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
  }

  #attendance .rsvp-option.status-yes,
  #attendance .status-badge.allowed,
  .quick-rsvp-button.status-yes {
    background: #218768;
  }

  #attendance .rsvp-option.status-no,
  #attendance .status-badge.blocked,
  .quick-rsvp-button.status-no {
    background: #c97880;
  }

  #attendance .rsvp-option.status-maybe,
  .quick-rsvp-button.status-maybe {
    background: #d8b34e;
  }

  #attendance .rsvp-option.status-pending,
  #attendance .status-badge.warning,
  .quick-rsvp-button.status-pending {
    background: #a2adb2;
  }

  #attendance .rsvp-option.status-yes::before,
  #attendance .status-badge.allowed::before,
  .quick-rsvp-button.status-yes::before {
    content: "IN";
  }

  #attendance .rsvp-option.status-no::before,
  #attendance .status-badge.blocked::before,
  .quick-rsvp-button.status-no::before {
    content: "OUT";
    font-size: 9px;
  }

  #attendance .rsvp-option.status-maybe::before,
  .quick-rsvp-button.status-maybe::before {
    content: "?";
    font-size: 14px;
  }

  #attendance .rsvp-option.status-pending::before,
  #attendance .status-badge.warning::before,
  .quick-rsvp-button.status-pending::before {
    content: "?";
  }

  #attendance .rsvp-option:not(.selected),
  .quick-rsvp-button:not(.selected) {
    opacity: 0.72;
  }

  .quick-rsvp-button.current,
  .schedule-rsvp-buttons.collapsed .quick-rsvp-button.current,
  .schedule-compact-rsvp.collapsed .quick-rsvp-button.current {
    opacity: 1;
  }

  #attendance .rsvp-option.selected,
  .quick-rsvp-button.selected {
    outline: 0;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(31, 139, 143, 0.32);
  }

  .mobile-bottom-nav {
    border-top: 1px solid #d7e4e3;
    background: #ffffff;
    box-shadow: 0 -6px 18px rgba(18, 49, 58, 0.08);
  }

  .mobile-nav-tab.active {
    color: #0f5960;
  }

  .mobile-nav-tab.active .mobile-nav-icon {
    background: #e3f2f1;
  }

  .schedule-actions .quick-rsvp-button {
    border-radius: 999px;
  }

  #roster .section-heading {
    display: none;
  }

  .mobile-roster-count {
    position: static;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0 14px;
    border-bottom: 1px solid #d1d5da;
    background: #ffffff;
    color: #111111;
    font-size: 20px;
    font-weight: 800;
  }

  body[data-view="roster"] .roster-grid {
    padding-top: 2px;
  }

  .mobile-roster-count::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 4px solid #606468;
    border-bottom: 4px solid #606468;
    transform: rotate(45deg) translateY(-4px);
  }

  #memberForm {
    display: none;
    margin: 12px;
  }

  body.show-member-form #memberForm {
    display: grid;
  }

  .roster-grid {
    gap: 0;
    background: #ffffff;
  }

  .roster-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 6px 14px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .member-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 2px solid #f1d9c9;
    border-radius: 50%;
    background: #fff7f3;
    color: #6b625d;
    font-size: 13px;
    font-weight: 800;
  }

  .roster-main {
    display: block;
    min-width: 0;
  }

  .roster-main strong {
    display: block;
    color: #111111;
    font-size: 17px;
    line-height: 1.1;
  }

  .roster-subtitle {
    margin: 3px 0 0;
    color: #202124;
    font-size: 14px;
    line-height: 1.15;
  }

  #roster .role-pill,
  #roster .jersey-number {
    display: none;
  }

  #roster .roster-contact-details {
    display: none;
    grid-column: 1 / -1;
  }

  #roster .roster-card.expanded .roster-contact-details {
    display: block;
  }

  #roster .contact-list {
    display: block;
    margin-top: 2px;
    padding-top: 7px;
    font-size: 12px;
  }

  #roster .contact-heading {
    margin-bottom: 3px;
    font-size: 10px;
  }

  #roster .contact-item {
    display: grid;
    min-width: 0;
    margin: 2px 0 6px;
    gap: 1px;
    font-size: 12px;
  }

  #roster .contact-item a,
  #roster .contact-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-fab {
    position: fixed;
    right: 24px;
    bottom: 112px;
    z-index: 35;
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border: 0;
    border-radius: 22px;
    background: #ff6d12;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(21, 32, 43, 0.22);
    font-size: 46px;
    line-height: 1;
  }

  body:not([data-view="roster"]) .mobile-fab {
    display: none;
  }
}

/* Command center and admin cleanup */
body[data-view="dashboard"] .phone-alert-panel,
body[data-view="dashboard"] .parent-quick-panel,
body[data-view="dashboard"] .team-contacts-panel {
  display: none !important;
}

body[data-view="dashboard"] .dashboard-grid {
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.35fr) minmax(260px, 1fr);
  gap: 20px;
}

.dashboard-stack {
  display: grid;
  gap: 12px;
  align-self: start;
}

body.is-admin[data-view="dashboard"] .dashboard-grid {
  grid-template-columns: minmax(220px, 0.8fr) minmax(340px, 1.35fr) minmax(280px, 1fr);
}

body.is-admin[data-view="dashboard"] .upcoming-panel {
  grid-row: auto;
}

#attendance .attendance-layout {
  grid-template-columns: minmax(260px, 320px) minmax(260px, 360px) minmax(0, 1fr);
}

.attendance-reminder-actions {
  margin-top: 12px;
}

.attendance-reminder-actions .primary-button {
  width: 100%;
}

#attendance .admin-reminders {
  display: grid;
  gap: 10px;
}

body:not(.is-admin) #attendance .admin-reminders,
body:not(.is-admin) #attendance .attendance-reminder-actions {
  display: none;
}

#attendance .reminder-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

#attendance .reminder-item {
  min-height: 48px;
  padding: 8px 0;
}

@media (min-width: 1081px) {
  #attendance .section-heading {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: end;
  }

  #attendance .attendance-layout {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px;
  }

  body:not(.is-admin) #attendance .attendance-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body.is-admin #attendance .attendance-layout {
    grid-template-columns: minmax(220px, 280px) minmax(260px, 320px) minmax(0, 1fr);
  }

  #attendance .attendance-summary,
  #attendance .admin-reminders {
    align-self: start;
    position: sticky;
    top: 18px;
  }

  #attendance .attendance-summary {
    padding: 14px;
  }

  body:not(.is-admin) #attendance .attendance-summary {
    position: static;
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(300px, 1fr);
    gap: 14px;
    align-items: stretch;
  }

  body:not(.is-admin) #attendance .attendance-summary h3 {
    grid-column: 1 / -1;
    margin-bottom: -2px;
  }

  #attendance .attendance-summary h3,
  #attendance .admin-reminders h3 {
    margin-bottom: 10px;
    font-size: 16px;
  }

  #attendance .attendance-summary .next-event {
    padding: 12px 12px 12px 18px;
  }

  #attendance .attendance-summary .next-event strong {
    font-size: 16px;
  }

  #attendance .attendance-summary .next-event span,
  #attendance .attendance-summary .next-event .muted {
    font-size: 12px;
    line-height: 1.35;
  }

  #attendance .attendance-counts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  body:not(.is-admin) #attendance .attendance-counts {
    align-self: stretch;
    margin-top: 0;
  }

  #attendance .attendance-count-card {
    min-height: 58px;
    padding: 8px 10px;
  }

  #attendance .attendance-counts strong {
    font-size: 20px;
  }

  #attendance .attendance-list {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }

  #attendance .attendance-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 9px;
    min-width: 0;
  }

  #attendance .attendance-group-title {
    grid-column: 1 / -1;
    min-height: 28px;
    margin: 0 0 2px;
    padding: 0 10px;
    font-size: 14px;
  }

  #attendance .attendance-row {
    min-height: 60px;
    padding: 10px 12px;
    gap: 12px;
    border-radius: 10px;
  }

  #attendance .attendance-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  #attendance .attendance-player {
    gap: 9px;
    min-width: 0;
  }

  #attendance .attendance-player strong {
    display: block;
    max-width: 210px;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #attendance .attendance-player .muted {
    display: none;
  }

  #attendance .rsvp-control {
    flex: 0 0 auto;
    gap: 5px;
  }

  #attendance .quick-rsvp-button.current,
  #attendance .status-badge {
    min-width: 76px;
    min-height: 30px;
    border-radius: 999px;
    font-size: 11px;
  }

  #attendance .schedule-compact-rsvp.expanded {
    display: grid;
    grid-template-columns: repeat(3, minmax(58px, 1fr));
    width: min(220px, 100%);
  }

  #attendance .schedule-compact-rsvp.expanded .quick-rsvp-button {
    min-height: 30px;
    font-size: 11px;
  }
}

/* Web attendance cleanup: keep admin controls readable and prevent RSVP overlap. */
@media (min-width: 901px) {
  body[data-view="attendance"] .top-strip {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 0;
    margin-bottom: 18px;
    padding: 16px 20px;
  }

  body[data-view="attendance"] .summary-copy {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
    max-width: none;
  }

  body[data-view="attendance"] .summary-copy .hero-logo {
    grid-row: 1 / span 3;
    width: 58px;
    height: 58px;
    margin: 0;
  }

  body[data-view="attendance"] .summary-copy .eyebrow,
  body[data-view="attendance"] .summary-copy h2,
  body[data-view="attendance"] .summary-copy p {
    grid-column: 2;
  }

  body[data-view="attendance"] .summary-copy .eyebrow {
    margin: 0 0 2px;
  }

  body[data-view="attendance"] .summary-copy h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1;
  }

  body[data-view="attendance"] .summary-copy p {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.35;
  }

  body.is-admin[data-view="attendance"] .quick-stats {
    grid-template-columns: repeat(3, 78px);
    gap: 8px;
  }

  body.is-admin[data-view="attendance"] .quick-stats div {
    min-height: 74px;
    padding: 10px 8px;
  }
}

@media (min-width: 1081px) {
  body.is-admin #attendance .attendance-layout {
    grid-template-columns: minmax(260px, 300px) minmax(280px, 330px) minmax(0, 1fr);
    gap: 14px;
  }

  body.is-admin #attendance .attendance-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.is-admin #attendance .attendance-count-card {
    min-height: 58px;
    padding: 9px 10px;
  }

  body.is-admin #attendance .attendance-counts span {
    line-height: 1.15;
  }

  body.is-admin #attendance .attendance-reminder-actions .primary-button {
    min-height: 42px;
    font-size: 14px;
  }

  body.is-admin #attendance .reminder-list {
    max-height: 330px;
  }

  body.is-admin #attendance .attendance-group {
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 10px;
  }

  body.is-admin #attendance .attendance-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 54px;
    padding: 9px 10px;
    gap: 10px;
    overflow: hidden;
  }

  body.is-admin #attendance .attendance-player {
    min-width: 0;
  }

  body.is-admin #attendance .attendance-player > div:last-child {
    min-width: 0;
  }

  body.is-admin #attendance .attendance-player strong {
    display: flex;
    align-items: baseline;
    max-width: none;
    gap: 7px;
    min-width: 0;
    font-size: 15px;
  }

  body.is-admin #attendance .attendance-player strong span {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 96px;
    overflow: hidden;
    color: var(--ink-soft);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.is-admin #attendance .attendance-player .muted {
    display: none;
  }

  body.is-admin #attendance .rsvp-control {
    min-width: 0;
    justify-self: end;
  }

  body.is-admin #attendance .schedule-compact-rsvp.collapsed {
    grid-template-columns: 82px;
  }

  body.is-admin #attendance .schedule-compact-rsvp.expanded {
    grid-template-columns: repeat(3, 58px);
    width: auto;
    gap: 5px;
  }

  body.is-admin #attendance .schedule-compact-rsvp .quick-rsvp-button {
    min-width: 0;
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  body.is-admin #attendance .attendance-row:has(.schedule-compact-rsvp.expanded) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.is-admin #attendance .attendance-row:has(.schedule-compact-rsvp.expanded) .rsvp-control {
    justify-self: start;
    margin-left: 43px;
  }

  body:not(.is-admin)[data-view="attendance"] .top-strip,
  body:not(.is-admin)[data-view="attendance"] #attendance {
    width: min(1180px, 100%);
    margin-right: auto;
    margin-left: auto;
  }

  body:not(.is-admin) #attendance .section-heading {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  }

  body:not(.is-admin) #attendance .attendance-summary {
    grid-template-columns: minmax(320px, 1fr) minmax(420px, 0.95fr);
    align-items: stretch;
    padding: 14px;
  }

  body:not(.is-admin) #attendance .attendance-summary .next-event {
    min-height: 118px;
  }

  body:not(.is-admin) #attendance .attendance-counts {
    grid-template-columns: repeat(4, minmax(86px, 1fr));
    gap: 10px;
  }

  body:not(.is-admin) #attendance .attendance-count-card {
    min-height: 78px;
    padding: 12px;
  }

  body:not(.is-admin) #attendance .attendance-group {
    grid-template-columns: repeat(auto-fit, minmax(300px, 340px));
    justify-content: start;
  }

  body:not(.is-admin) #attendance .attendance-row {
    min-height: 56px;
  }
}

/* Parent roster cleanup: the jersey is already in the subtitle, so avoid a second floating badge. */
@media (min-width: 721px) {
  body:not(.is-admin) #roster .roster-card {
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    min-height: 74px;
    padding: 14px 16px;
  }

  body:not(.is-admin) #roster .roster-card.expanded {
    align-items: start;
  }

  body:not(.is-admin) #roster .roster-main {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  body:not(.is-admin) #roster .roster-actions {
    display: flex;
    justify-content: end;
    min-width: auto;
  }

  body:not(.is-admin) #roster .jersey-number {
    display: none;
  }

  body:not(.is-admin) #roster .roster-details-toggle {
    min-width: 66px;
    min-height: 36px;
    border-radius: 10px;
    font-size: 14px;
  }

  body:not(.is-admin) #roster .roster-contact-details {
    grid-column: 2 / -1;
    margin-top: 8px;
  }
}

@media (max-width: 1080px) {
  body[data-view="dashboard"] .dashboard-grid,
  body.is-admin[data-view="dashboard"] .dashboard-grid,
  #attendance .attendance-layout {
    grid-template-columns: 1fr;
  }

  body[data-view="dashboard"] .dashboard-stack {
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .main-content {
    padding: 10px;
  }

  body[data-view="attendance"] .main-content {
    padding: 0 0 78px;
  }

  .sidebar {
    padding: 8px 10px;
  }

  .nav-tabs {
    margin: 0 -12px;
    padding: 0 12px 4px;
  }

  .nav-tab {
    min-width: 88px;
    font-size: 13px;
  }

  .top-strip,
  .panel,
  .member-form,
  .event-form {
    padding: 12px;
  }

  .summary-copy h2 {
    font-size: 27px;
  }

  .quick-stats {
    display: none !important;
  }

  .rsvp-control {
    grid-template-columns: 1fr;
  }

  .brand h1 {
    max-width: 160px;
    font-size: 17px;
  }
}

@media (max-width: 720px) {
  body[data-view="dashboard"] .phone-alert-panel,
  body[data-view="dashboard"] .team-contacts-panel,
  body[data-view="dashboard"] .parent-quick-panel {
    display: none !important;
  }
}

.quick-rsvp-button.current span,
.schedule-actions .quick-rsvp-button span,
.schedule-compact-rsvp .quick-rsvp-button span {
  display: inline;
  color: inherit;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  opacity: 1;
  text-shadow: none;
}

.quick-rsvp-button.current::before,
.schedule-actions .quick-rsvp-button::before,
.schedule-compact-rsvp .quick-rsvp-button::before {
  content: "";
}

.schedule-rsvp-buttons.collapsed .quick-rsvp-button.current,
.schedule-compact-rsvp.collapsed .quick-rsvp-button.current {
  opacity: 1;
}

.schedule-rsvp-buttons.expanded .quick-rsvp-button:not(.selected),
.schedule-compact-rsvp.expanded .quick-rsvp-button:not(.selected) {
  opacity: 0.86;
}

.quick-rsvp-button.status-yes,
.quick-rsvp-button.status-no,
.quick-rsvp-button.status-pending {
  color: #ffffff;
}

.quick-rsvp-button.status-maybe {
  color: #332300;
}

/* Final fit pass: these stay last so preview/web panels do not clip controls. */
@media (min-width: 721px) and (max-width: 1280px) {
  .main-content {
    min-width: 0;
    overflow-x: hidden;
    padding: 14px;
  }

  .top-strip {
    max-width: 760px;
    padding: 12px 16px;
  }

  .brand-logo-wrap {
    width: 56px;
    height: 56px;
  }

  .brand-text h1 {
    font-size: 28px;
  }

  body[data-view="dashboard"] #dashboard,
  body[data-view="attendance"] #attendance,
  body[data-view="roster"] #roster,
  body[data-view="schedule"] #schedule,
  body[data-view="chat"] #chat,
  body[data-view="funds"] #funds,
  body[data-view="branding"] #branding {
    max-width: 760px;
    width: 100%;
    overflow-x: hidden;
  }

  body[data-view="dashboard"] .section-title-row {
    max-width: 760px;
  }

  body[data-view="dashboard"] .dashboard-grid,
  body.is-admin[data-view="dashboard"] .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 520px;
    gap: 12px;
  }

  body[data-view="dashboard"] .dashboard-panel,
  body[data-view="dashboard"] .dashboard-card {
    max-width: 520px;
  }

  body[data-view="dashboard"] .home-event-row,
  body[data-view="dashboard"] .attendance-needed-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  body[data-view="dashboard"] .home-event-row > div,
  body[data-view="dashboard"] .attendance-needed-row > div {
    min-width: 0;
  }

  body[data-view="dashboard"] .home-event-row strong,
  body[data-view="dashboard"] .home-event-row span,
  body[data-view="dashboard"] .attendance-needed-row strong,
  body[data-view="dashboard"] .attendance-needed-row span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-view="dashboard"] .home-event-actions {
    display: grid;
    grid-template-columns: 92px 44px;
    gap: 6px;
    min-width: 142px;
  }

  body[data-view="dashboard"] .home-event-actions .map-button,
  body[data-view="dashboard"] .home-event-actions .quick-rsvp-button.current,
  body[data-view="dashboard"] .home-event-actions .home-rsvp-buttons.collapsed .quick-rsvp-button {
    width: 100%;
    min-width: 0;
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
    line-height: 1;
  }

  body[data-view="dashboard"] .home-rsvp-buttons.expanded {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }

  body[data-view="dashboard"] .home-rsvp-buttons.expanded .quick-rsvp-button {
    min-width: 0;
    font-size: 10px;
    padding: 0 4px;
  }

  body[data-view="attendance"] .section-title-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 760px;
  }

  body[data-view="attendance"] .section-title-row label,
  body[data-view="attendance"] .section-title-row select {
    width: min(100%, 420px);
  }

  body[data-view="attendance"] #attendance .attendance-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
    max-width: 760px;
  }

  body[data-view="attendance"] .event-summary-card,
  body[data-view="attendance"] .attendance-reminder-panel,
  body[data-view="attendance"] .attendance-group {
    max-width: 640px;
    width: 100%;
  }

  body:not(.is-admin)[data-view="attendance"] .event-summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(210px, 0.75fr);
    gap: 10px;
    align-items: stretch;
  }

  body:not(.is-admin)[data-view="attendance"] .event-card-dark {
    min-width: 0;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-count-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-view="attendance"] .attendance-group-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 640px;
    gap: 8px;
  }

  body[data-view="attendance"] .attendance-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    overflow: hidden;
  }

  body[data-view="attendance"] .attendance-row strong,
  body[data-view="attendance"] .attendance-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="attendance"] .attendance-row .quick-rsvp-button.current,
  body[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.collapsed .quick-rsvp-button,
  body[data-view="attendance"] .attendance-row .schedule-compact-rsvp.collapsed .quick-rsvp-button {
    width: 96px;
    min-width: 96px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 1;
  }

  body[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.expanded,
  body[data-view="attendance"] .attendance-row .schedule-compact-rsvp.expanded {
    display: grid;
    grid-template-columns: repeat(3, 58px);
    gap: 4px;
    width: auto;
  }

  body[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.expanded .quick-rsvp-button,
  body[data-view="attendance"] .attendance-row .schedule-compact-rsvp.expanded .quick-rsvp-button {
    width: 58px;
    min-width: 58px;
    min-height: 32px;
    padding: 0 4px;
    font-size: 10px;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .top-strip {
    max-width: 620px;
  }

  body[data-view="dashboard"] #dashboard,
  body[data-view="attendance"] #attendance,
  body[data-view="roster"] #roster,
  body[data-view="schedule"] #schedule,
  body[data-view="chat"] #chat,
  body[data-view="funds"] #funds,
  body[data-view="branding"] #branding {
    max-width: 620px;
  }

  body:not(.is-admin)[data-view="attendance"] .event-summary-card {
    grid-template-columns: 1fr;
  }

  body[data-view="attendance"] .event-summary-card,
  body[data-view="attendance"] .attendance-reminder-panel,
  body[data-view="attendance"] .attendance-group,
  body[data-view="attendance"] .attendance-group-grid {
    max-width: 540px;
  }
}

/* Final attendance badge normalization: one symbol language across web, admin, and app. */
body[data-view="attendance"] .attendance-row .quick-rsvp-button,
body[data-view="attendance"] .attendance-row .quick-rsvp-button.current,
body[data-view="attendance"] .attendance-row .quick-rsvp-button.selected,
body[data-view="attendance"] .attendance-row .status-badge {
  display: grid !important;
  place-items: center !important;
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 9px !important;
  border: 0 !important;
  color: #ffffff !important;
  font-size: 18px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-align: center !important;
  opacity: 1 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-yes,
body[data-view="attendance"] .attendance-row .status-badge.allowed {
  background: #218768 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-no,
body[data-view="attendance"] .attendance-row .status-badge.blocked {
  background: #c97880 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-maybe,
body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-pending,
body[data-view="attendance"] .attendance-row .status-badge.warning {
  background: #a2adb2 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button span,
body[data-view="attendance"] .attendance-row .status-badge {
  color: #ffffff !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button span,
body[data-view="attendance"] .attendance-row .quick-rsvp-button.current span,
body[data-view="attendance"] .attendance-row .quick-rsvp-button.selected span {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  font-size: 18px !important;
  line-height: 1 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button::before,
body[data-view="attendance"] .attendance-row .quick-rsvp-button span::before,
body[data-view="attendance"] .attendance-row .status-badge::before {
  content: "" !important;
}

/* Symbol-only RSVP badges. */
.quick-rsvp-button span,
.quick-rsvp-button.current span,
.schedule-actions .quick-rsvp-button span,
.schedule-compact-rsvp .quick-rsvp-button span,
.home-rsvp-buttons .quick-rsvp-button span {
  display: inline-grid !important;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  text-align: center;
}

.quick-rsvp-button span::before,
.quick-rsvp-button.current span::before,
.schedule-actions .quick-rsvp-button span::before,
.schedule-compact-rsvp .quick-rsvp-button span::before,
.home-rsvp-buttons .quick-rsvp-button span::before {
  content: "" !important;
}

.quick-rsvp-button,
.quick-rsvp-button.current,
.quick-rsvp-button.selected,
.schedule-actions .quick-rsvp-button,
.schedule-compact-rsvp .quick-rsvp-button,
.home-rsvp-buttons .quick-rsvp-button {
  width: 44px;
  min-width: 44px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
}

.quick-rsvp-button.current {
  width: 52px;
  min-width: 52px;
}

/* Parent attendance must never overflow the web/tablet content area. */
@media (min-width: 721px) {
  body:not(.is-admin)[data-view="attendance"] .main-content {
    overflow-x: hidden !important;
  }

  body:not(.is-admin)[data-view="attendance"] .top-strip,
  body:not(.is-admin)[data-view="attendance"] #attendance,
  body:not(.is-admin)[data-view="attendance"] .section-title-row,
  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-layout,
  body:not(.is-admin)[data-view="attendance"] .event-summary-card,
  body:not(.is-admin)[data-view="attendance"] .attendance-group,
  body:not(.is-admin)[data-view="attendance"] .attendance-group-grid {
    width: 100% !important;
    max-width: 720px !important;
    min-width: 0 !important;
    box-sizing: border-box;
    overflow-x: hidden !important;
  }

  body:not(.is-admin)[data-view="attendance"] .section-title-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: start !important;
  }

  body:not(.is-admin)[data-view="attendance"] .section-title-row > div,
  body:not(.is-admin)[data-view="attendance"] .section-title-row label,
  body:not(.is-admin)[data-view="attendance"] #attendanceEventSelect {
    width: 100% !important;
    max-width: 420px !important;
    min-width: 0 !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body:not(.is-admin)[data-view="attendance"] .event-summary-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  body:not(.is-admin)[data-view="attendance"] .event-card-dark {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-count-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-count-card {
    min-width: 0 !important;
    padding: 8px !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-count-card strong {
    font-size: 18px !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-count-card span {
    font-size: 11px !important;
    overflow-wrap: anywhere;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-group-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-row {
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) auto !important;
    gap: 9px !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 10px 12px !important;
    box-sizing: border-box;
    overflow: hidden !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-row > div:not(.member-avatar):not(.schedule-compact-rsvp):not(.rsvp-control) {
    min-width: 0 !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-row strong,
  body:not(.is-admin)[data-view="attendance"] .attendance-row span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-row .schedule-compact-rsvp,
  body:not(.is-admin)[data-view="attendance"] .attendance-row .schedule-rsvp-buttons {
    justify-self: end !important;
    width: auto !important;
    max-width: 156px !important;
    min-width: 0 !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-row .schedule-compact-rsvp.collapsed .quick-rsvp-button,
  body:not(.is-admin)[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.collapsed .quick-rsvp-button,
  body:not(.is-admin)[data-view="attendance"] .attendance-row .quick-rsvp-button.current {
    width: 52px !important;
    min-width: 52px !important;
    min-height: 34px !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-row .schedule-compact-rsvp.expanded,
  body:not(.is-admin)[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.expanded {
    display: grid !important;
    grid-template-columns: repeat(3, 44px) !important;
    gap: 4px !important;
  }

body:not(.is-admin)[data-view="attendance"] .attendance-row .schedule-compact-rsvp.expanded .quick-rsvp-button,
  body:not(.is-admin)[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.expanded .quick-rsvp-button {
    width: 44px !important;
    min-width: 44px !important;
    min-height: 34px !important;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  body:not(.is-admin)[data-view="attendance"] .top-strip,
  body:not(.is-admin)[data-view="attendance"] #attendance,
  body:not(.is-admin)[data-view="attendance"] .section-title-row,
  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-layout,
  body:not(.is-admin)[data-view="attendance"] .event-summary-card,
  body:not(.is-admin)[data-view="attendance"] .attendance-group,
  body:not(.is-admin)[data-view="attendance"] .attendance-group-grid {
    max-width: calc(100vw - 280px) !important;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-count-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Admin attendance: keep the response list beside reminders in its own scroll panel. */
@media (min-width: 1081px) {
  body.is-admin[data-view="attendance"] #attendance .attendance-layout {
    align-items: start !important;
  }

  body.is-admin[data-view="attendance"] #attendance .attendance-list {
    max-height: 430px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    scrollbar-gutter: stable;
  }

  body.is-admin[data-view="attendance"] #attendance .attendance-list::-webkit-scrollbar,
  body.is-admin[data-view="attendance"] #attendance .reminder-list::-webkit-scrollbar {
    width: 10px;
  }

  body.is-admin[data-view="attendance"] #attendance .attendance-list::-webkit-scrollbar-track,
  body.is-admin[data-view="attendance"] #attendance .reminder-list::-webkit-scrollbar-track {
    background: rgba(15, 43, 56, 0.06);
    border-radius: 999px;
  }

  body.is-admin[data-view="attendance"] #attendance .attendance-list::-webkit-scrollbar-thumb,
  body.is-admin[data-view="attendance"] #attendance .reminder-list::-webkit-scrollbar-thumb {
    background: rgba(15, 43, 56, 0.38);
    border-radius: 999px;
  }

  body.is-admin[data-view="attendance"] #attendance .attendance-group {
    padding-bottom: 8px;
  }
}

.attendance-empty-group {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

/* Keep attendance RSVP symbols compact and centered inside each player row. */
body[data-view="attendance"] .attendance-row .rsvp-control {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  min-width: 0;
}

body[data-view="attendance"] .attendance-row .schedule-compact-rsvp.collapsed,
body[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.collapsed {
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.current,
body[data-view="attendance"] .attendance-row .schedule-compact-rsvp.collapsed .quick-rsvp-button,
body[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.collapsed .quick-rsvp-button {
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 9px !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button span,
body[data-view="attendance"] .attendance-row .schedule-compact-rsvp .quick-rsvp-button span,
body[data-view="attendance"] .attendance-row .schedule-rsvp-buttons .quick-rsvp-button span {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  text-align: center !important;
}

body[data-view="attendance"] .attendance-row .status-badge {
  display: grid !important;
  place-items: center !important;
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 9px !important;
  font-size: 18px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-align: center !important;
}

body[data-view="attendance"] .attendance-row .status-badge::before {
  content: "" !important;
}

@media (min-width: 721px) and (max-width: 1080px) {
  body.is-admin[data-view="attendance"] #attendance .attendance-list {
    max-height: 460px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    scrollbar-gutter: stable;
  }
}

/* Site-wide final fit audit: keep tablet/preview/web panels readable and unclipped. */
@media (min-width: 721px) and (max-width: 1280px) {
  .main-content {
    padding: 16px;
    overflow-x: hidden;
  }

  body[data-view="dashboard"] .top-strip,
  body[data-view="dashboard"] #dashboard,
  body[data-view="attendance"] .top-strip,
  body[data-view="attendance"] #attendance,
  body[data-view="roster"] #roster,
  body[data-view="schedule"] #schedule,
  body[data-view="chat"] #chat,
  body[data-view="funds"] #funds,
  body[data-view="branding"] #branding {
    width: 100%;
    max-width: 980px;
    margin-right: auto;
    margin-left: 0;
  }

  body[data-view="dashboard"] .dashboard-grid,
  body.is-admin[data-view="dashboard"] .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    max-width: 680px;
  }

  body[data-view="dashboard"] .dashboard-stack {
    gap: 10px;
  }

  body[data-view="dashboard"] .home-event-list li,
  body[data-view="dashboard"] .home-attendance-item,
  body[data-view="dashboard"] .home-contact-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  body[data-view="dashboard"] .home-event-actions {
    min-width: 0;
    grid-template-columns: auto auto;
    justify-content: end;
  }

  body[data-view="dashboard"] .home-rsvp-stack {
    min-width: 0;
  }

  body[data-view="dashboard"] .home-rsvp-buttons.expanded {
    grid-template-columns: repeat(3, 50px);
    border-radius: 10px;
  }

  body[data-view="dashboard"] .home-rsvp-buttons.expanded .quick-rsvp-button {
    min-height: 30px;
    padding: 0 5px;
    font-size: 10px;
  }

  body[data-view="dashboard"] .home-rsvp-buttons.collapsed .quick-rsvp-button.current,
  body[data-view="dashboard"] .home-status-button {
    min-width: 58px;
    max-width: 76px;
    min-height: 30px;
    padding: 0 8px;
    font-size: 10px;
  }

  body[data-view="dashboard"] .map-button {
    min-width: 48px;
    min-height: 30px;
    padding: 0 8px;
    font-size: 10px;
  }

  body[data-view="attendance"] #attendance .section-heading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body[data-view="attendance"] #attendance .event-picker {
    justify-self: start;
    width: min(420px, 100%);
  }

  body[data-view="attendance"] #attendance .attendance-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body[data-view="attendance"] #attendance .attendance-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 680px;
    padding: 14px;
  }

  body[data-view="attendance"] #attendance .attendance-summary h3 {
    grid-column: 1;
  }

  body[data-view="attendance"] #attendance .attendance-summary .next-event {
    min-height: 0;
  }

  body[data-view="attendance"] #attendance .attendance-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }

  body[data-view="attendance"] #attendance .attendance-count-card {
    min-height: 54px;
    padding: 9px 10px;
  }

  body[data-view="attendance"] #attendance .attendance-list {
    max-width: 680px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  body[data-view="attendance"] #attendance .attendance-group {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  body[data-view="attendance"] #attendance .attendance-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    overflow: hidden;
  }

  body[data-view="attendance"] #attendance .attendance-player,
  body[data-view="attendance"] #attendance .attendance-player > div:last-child {
    min-width: 0;
  }

  body[data-view="attendance"] #attendance .attendance-player strong {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  body[data-view="attendance"] #attendance .attendance-player strong span {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="attendance"] #attendance .rsvp-control {
    justify-self: end;
    min-width: 0;
  }

  body[data-view="attendance"] #attendance .schedule-compact-rsvp.collapsed,
  body[data-view="attendance"] #attendance .status-badge {
    max-width: 112px;
  }

  body[data-view="attendance"] #attendance .schedule-compact-rsvp.expanded {
    grid-template-columns: repeat(3, 56px);
    width: auto;
    gap: 5px;
  }

  body[data-view="attendance"] #attendance .schedule-compact-rsvp.expanded .quick-rsvp-button {
    min-height: 32px;
    padding: 0 6px;
    font-size: 10px;
  }

  #roster .roster-grid,
  #schedule .schedule-list,
  #chat .chat-layout,
  #funds .funds-layout,
  #branding .branding-layout {
    max-width: 760px;
  }
}

/* Parent attendance final fit: one readable column, no clipped status badges. */
@media (min-width: 721px) {
  body:not(.is-admin)[data-view="attendance"] #attendance,
  body:not(.is-admin)[data-view="attendance"] .top-strip {
    max-width: 720px !important;
  }

  body:not(.is-admin) #attendance .attendance-group {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
  }

  body:not(.is-admin) #attendance .attendance-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  body:not(.is-admin) #attendance .attendance-player {
    min-width: 0 !important;
  }

  body:not(.is-admin) #attendance .attendance-player > div:last-child {
    min-width: 0 !important;
  }

  body:not(.is-admin) #attendance .attendance-player strong {
    display: flex !important;
    align-items: baseline !important;
    min-width: 0 !important;
    gap: 8px !important;
    white-space: nowrap !important;
  }

  body:not(.is-admin) #attendance .attendance-player strong span {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.is-admin) #attendance .rsvp-control {
    justify-self: end !important;
    min-width: 0 !important;
  }

  body:not(.is-admin) #attendance .status-badge,
  body:not(.is-admin) #attendance .quick-rsvp-button.current {
    min-width: 86px !important;
    max-width: 112px !important;
    white-space: nowrap !important;
  }
}

/* Parent attendance hard fix for web/tablet widths. */
@media (min-width: 721px) {
  body:not(.is-admin)[data-view="attendance"] .main-content {
    display: block !important;
    padding: 22px 28px !important;
    overflow-x: hidden;
  }

  body:not(.is-admin)[data-view="attendance"] .top-strip,
  body:not(.is-admin)[data-view="attendance"] #attendance {
    width: 100% !important;
    max-width: 840px !important;
    margin-right: auto !important;
    margin-left: 0 !important;
  }

  body:not(.is-admin) #attendance .section-heading {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
    gap: 10px !important;
  }

  body:not(.is-admin) #attendance .event-picker {
    justify-self: start !important;
    width: min(420px, 100%) !important;
    max-width: 100% !important;
  }

  body:not(.is-admin) #attendance .attendance-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
  }

  body:not(.is-admin) #attendance .attendance-summary {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px !important;
  }

  body:not(.is-admin) #attendance .attendance-summary h3 {
    grid-column: 1 !important;
  }

  body:not(.is-admin) #attendance .attendance-summary .next-event {
    width: 100% !important;
    min-height: 112px !important;
  }

  body:not(.is-admin) #attendance .attendance-counts {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body:not(.is-admin) #attendance .attendance-count-card {
    min-width: 0 !important;
    min-height: 58px !important;
    padding: 9px 10px !important;
  }

  body:not(.is-admin) #attendance .attendance-list {
    max-width: 100% !important;
    max-height: calc(100vh - 360px);
  }

  body:not(.is-admin) #attendance .attendance-group {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 10px !important;
  }

  body:not(.is-admin) #attendance .attendance-row {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 721px) and (max-width: 880px) {
  body:not(.is-admin) #attendance .attendance-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body:not(.is-admin) #attendance .attendance-group {
    grid-template-columns: 1fr !important;
  }
}

/* Parent attendance should read as a focused page, not a stretched full-width dashboard. */
@media (min-width: 901px) {
  body:not(.is-admin)[data-view="attendance"] .main-content {
    display: block;
    padding-right: 28px;
    padding-left: 28px;
  }

  body:not(.is-admin)[data-view="attendance"] .top-strip {
    width: min(980px, 100%);
    margin-right: 0;
    margin-left: 0;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance {
    width: min(980px, 100%);
    margin-right: 0;
    margin-left: 0;
  }

  body:not(.is-admin) #attendance .section-heading {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  body:not(.is-admin) #attendance .event-picker {
    width: min(380px, 100%);
  }

  body:not(.is-admin) #attendance .attendance-summary {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.55fr);
    gap: 12px;
    padding: 14px;
  }

  body:not(.is-admin) #attendance .attendance-summary h3 {
    grid-column: 1 / -1;
  }

  body:not(.is-admin) #attendance .attendance-summary .next-event {
    min-height: 116px;
  }

  body:not(.is-admin) #attendance .attendance-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
  }

  body:not(.is-admin) #attendance .attendance-count-card {
    min-height: 54px;
    padding: 8px 10px;
  }

  body:not(.is-admin) #attendance .attendance-count-card strong {
    font-size: 20px;
  }

  body:not(.is-admin) #attendance .attendance-count-card span {
    font-size: 12px;
    line-height: 1.1;
  }

  body:not(.is-admin) #attendance .attendance-list {
    max-width: 760px;
  }

  body:not(.is-admin) #attendance .attendance-group {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* Long web views and admin-phone cleanup. */
@media (min-width: 901px) {
  body:not([data-view="dashboard"]) .main-content {
    min-height: 100vh;
  }

  #roster .roster-grid,
  #schedule .schedule-list,
  #attendance .attendance-list {
    max-height: calc(100vh - 270px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
    scrollbar-color: rgba(12, 38, 49, 0.38) transparent;
    scrollbar-width: thin;
  }

  #roster .roster-grid::-webkit-scrollbar,
  #schedule .schedule-list::-webkit-scrollbar,
  #attendance .attendance-list::-webkit-scrollbar,
  #attendance .reminder-list::-webkit-scrollbar {
    width: 8px;
  }

  #roster .roster-grid::-webkit-scrollbar-thumb,
  #schedule .schedule-list::-webkit-scrollbar-thumb,
  #attendance .attendance-list::-webkit-scrollbar-thumb,
  #attendance .reminder-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(12, 38, 49, 0.38);
  }

  body:not(.is-admin) #roster .roster-card.expanded {
    align-items: start;
  }

  body:not(.is-admin) #roster .roster-contact-details {
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 24px;
    margin: 10px 0 0 58px;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
  }

  body:not(.is-admin) #roster .contact-list {
    grid-column: auto;
    margin: 0;
    padding: 0;
    border-top: 0;
  }

  body:not(.is-admin) #roster .contact-item {
    display: grid;
    min-width: 0;
    margin: 0;
  }

  body:not(.is-admin) #roster .contact-action-badges {
    justify-content: start;
  }
}

@media (max-width: 720px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
  }

  .main-content {
    width: 100%;
    max-width: 100vw;
    padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden;
  }

  body.is-admin #csvImportPanel,
  body.is-admin #scheduleCsvImportPanel {
    display: none !important;
  }

  body.is-admin .member-form,
  body.is-admin .event-form,
  body.is-admin .fund-form,
  body.is-admin .panel {
    max-width: 100%;
  }

  body.is-admin #roster .roster-card,
  body.is-admin #schedule .schedule-item,
  body.is-admin #attendance .attendance-row {
    max-width: 100%;
    overflow: hidden;
  }

  .mobile-bottom-nav {
    position: fixed !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body.is-admin .mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  body.is-admin .mobile-nav-tab {
    min-width: 0;
    flex: 1 1 0;
  }
}

/* Compact admin roster rows. */
@media (min-width: 721px) {
  body.is-admin #roster .roster-grid {
    gap: 8px;
  }

  body.is-admin #roster .roster-card {
    min-height: 0;
    padding: 9px 12px;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
  }

  body.is-admin #roster .roster-card .member-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  body.is-admin #roster .roster-main {
    grid-template-columns: minmax(170px, 1fr) minmax(360px, auto);
    align-items: center;
    gap: 10px;
  }

  body.is-admin #roster .roster-main strong {
    font-size: 15px;
  }

  body.is-admin #roster .roster-subtitle {
    margin-top: 1px;
    font-size: 12px;
  }

  body.is-admin #roster .roster-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  body.is-admin #roster .roster-actions .compact-button,
  body.is-admin #roster .roster-actions .soft-remove-button {
    min-width: 56px;
    min-height: 30px;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 12px;
    line-height: 1;
  }

  body.is-admin #roster .roster-details-toggle {
    min-width: 52px;
  }

  body.is-admin #roster .roster-chat-toggle {
    min-height: 30px;
    padding: 0 8px;
    font-size: 11px;
  }

  body.is-admin #roster .roster-chat-toggle i {
    width: 30px;
    height: 18px;
  }

  body.is-admin #roster .roster-chat-toggle i::after {
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
  }

  body.is-admin #roster .roster-chat-toggle input:checked + i::after {
    transform: translateX(12px);
  }

  body.is-admin #roster .jersey-number {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    height: 36px;
    font-size: 12px;
  }

  body.is-admin #roster .roster-contact-details {
    display: none;
    grid-column: 2 / -1;
    margin-top: 6px;
    padding-top: 8px;
  }

  body.is-admin #roster .roster-card.expanded .roster-contact-details {
    display: grid;
  }
}

/* Compact web home dashboard. */
@media (min-width: 901px) {
  body[data-view="dashboard"] .main-content {
    padding-top: 14px;
    padding-bottom: 28px;
  }

  body[data-view="dashboard"] .app-shell {
    min-height: 0;
  }

  body[data-view="dashboard"] .sidebar {
    min-height: 0;
  }

  body[data-view="dashboard"] .top-strip {
    min-height: 0;
    margin-bottom: 14px;
    padding: 16px 20px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  body:not(.is-admin)[data-view="dashboard"] .top-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-view="dashboard"] .summary-copy {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
    max-width: none;
  }

  body[data-view="dashboard"] .summary-copy .eyebrow {
    grid-column: 2;
    margin: 0 0 2px;
  }

  body[data-view="dashboard"] .hero-logo {
    grid-row: 1 / span 3;
    width: 58px;
    height: 58px;
    margin: 0;
  }

  body[data-view="dashboard"] .summary-copy h2 {
    grid-column: 2;
    margin: 0;
    font-size: 28px;
    line-height: 1;
  }

  body[data-view="dashboard"] .summary-copy p:last-child {
    grid-column: 2;
    margin-top: 5px;
    max-width: 720px;
    font-size: 13px;
    line-height: 1.3;
  }

  body.is-admin[data-view="dashboard"] .quick-stats {
    grid-template-columns: repeat(3, 74px);
    align-self: center;
    gap: 8px;
  }

  body.is-admin[data-view="dashboard"] .quick-stats div {
    padding: 9px 8px;
  }

  body.is-admin[data-view="dashboard"] .quick-stats strong {
    font-size: 22px;
  }

  body.is-admin[data-view="dashboard"] .quick-stats span {
    font-size: 11px;
  }

  body[data-view="dashboard"] .section-heading {
    margin-bottom: 10px;
  }

  body[data-view="dashboard"] .section-heading h2 {
    font-size: 24px;
  }

  body[data-view="dashboard"] .home-install-status {
    margin: -4px 0 10px;
    font-size: 12px;
  }

  body[data-view="dashboard"] .dashboard-grid,
  body.is-admin[data-view="dashboard"] .dashboard-grid {
    grid-template-columns: minmax(190px, 0.85fr) minmax(300px, 1.22fr) minmax(250px, 0.95fr);
    gap: 10px;
    align-items: start;
    max-width: 1180px;
  }

  body[data-view="dashboard"] .panel {
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(21, 32, 43, 0.05);
  }

  body[data-view="dashboard"] .panel h3 {
    margin-bottom: 8px;
    font-size: 16px;
  }

  body[data-view="dashboard"] .next-up-panel,
  body[data-view="dashboard"] .announcement-panel,
  body[data-view="dashboard"] .upcoming-panel,
  body[data-view="dashboard"] .attendance-panel {
    min-height: 0;
    align-self: start;
  }

  body[data-view="dashboard"] .announcement-panel {
    grid-column: auto;
    grid-row: auto;
  }

  body[data-view="dashboard"] .announcement-panel .stacked-form {
    gap: 8px;
  }

  body[data-view="dashboard"] .announcement-panel textarea {
    min-height: 64px;
  }

  body[data-view="dashboard"] .simple-list {
    gap: 6px;
    margin-top: 8px;
  }

  body[data-view="dashboard"] .simple-list li {
    padding: 7px 0;
  }

  body[data-view="dashboard"] .home-event-list,
  body[data-view="dashboard"] .home-attendance-list {
    gap: 6px;
  }

  body[data-view="dashboard"] .home-event-list li,
  body[data-view="dashboard"] .home-attendance-item {
    gap: 8px;
    min-height: 0;
    padding-bottom: 7px;
  }

  body[data-view="dashboard"] .home-event-list strong,
  body[data-view="dashboard"] .home-attendance-item strong,
  body[data-view="dashboard"] .next-event strong {
    margin-bottom: 2px;
    font-size: 14px;
    line-height: 1.15;
  }

  body[data-view="dashboard"] .home-event-list span,
  body[data-view="dashboard"] .home-attendance-item span:not(.status-badge),
  body[data-view="dashboard"] .next-event span,
  body[data-view="dashboard"] .attendance-mini {
    font-size: 11px;
    line-height: 1.25;
  }

  body[data-view="dashboard"] .home-event-actions {
    min-width: 190px;
    gap: 6px;
  }

  body[data-view="dashboard"] .home-status-button,
  body[data-view="dashboard"] .home-rsvp-buttons.collapsed .quick-rsvp-button.current {
    min-width: 64px;
    min-height: 30px;
    font-size: 11px;
  }

  body[data-view="dashboard"] .map-button {
    min-width: 48px;
    min-height: 30px;
    font-size: 11px;
  }
}

@media (max-width: 720px) {
  body[data-view="dashboard"] .dashboard-grid {
    gap: 10px !important;
  }

  body[data-view="dashboard"] .panel {
    padding: 12px !important;
    border-radius: 10px !important;
  }

  body[data-view="dashboard"] .panel h3 {
    font-size: 17px !important;
    margin-bottom: 8px !important;
  }

  body[data-view="dashboard"] .home-event-list li,
  body[data-view="dashboard"] .home-attendance-item {
    padding: 8px 0 !important;
  }

  body[data-view="dashboard"] .home-event-list li:nth-child(n+4),
  body[data-view="dashboard"] .home-attendance-list .home-attendance-item:nth-child(n+4) {
    display: none !important;
  }

  body[data-view="dashboard"] .phone-alert-panel,
  body[data-view="dashboard"] .team-contacts-panel,
  body[data-view="dashboard"] .parent-quick-panel {
    display: none !important;
  }
}

/* Desktop roster action cleanup. */
@media (min-width: 721px) {
  #roster .roster-main {
    grid-template-columns: minmax(0, 1fr) minmax(132px, auto);
  }

  #roster .roster-actions {
    display: grid;
    grid-template-columns: auto auto;
    grid-auto-flow: row;
    align-items: center;
    justify-content: end;
    gap: 7px;
    min-width: 132px;
  }

  #roster .roster-details-toggle {
    grid-column: 2;
    min-width: 58px;
    min-height: 34px;
    border-radius: 9px;
    padding: 0 12px;
    white-space: nowrap;
  }

  #roster .jersey-number {
    grid-column: 1;
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    height: 46px;
    overflow: hidden;
    border-radius: 50%;
    padding: 0;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #roster .roster-actions .roster-chat-toggle,
  #roster .roster-actions [data-roster-invite-player],
  #roster .roster-actions [data-roster-invite-member],
  #roster .roster-actions [data-edit-member],
  #roster .roster-actions [data-delete-member] {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

/* Final RSVP badge alignment. */
.quick-rsvp-button.current,
.schedule-rsvp-buttons.collapsed .quick-rsvp-button.current,
.schedule-compact-rsvp.collapsed .quick-rsvp-button.current,
.home-rsvp-buttons.collapsed .quick-rsvp-button.current {
  display: inline-grid;
  place-items: center;
  align-content: center;
  justify-content: center;
  min-width: 78px;
  min-height: 34px;
  padding: 0 12px;
  line-height: 1;
  text-align: center;
}

.quick-rsvp-button.current span,
.schedule-rsvp-buttons.collapsed .quick-rsvp-button.current span,
.schedule-compact-rsvp.collapsed .quick-rsvp-button.current span,
.home-rsvp-buttons.collapsed .quick-rsvp-button.current span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  text-align: center;
}

.quick-rsvp-button.current span::before,
.schedule-rsvp-buttons.collapsed .quick-rsvp-button.current span::before,
.schedule-compact-rsvp.collapsed .quick-rsvp-button.current span::before,
.home-rsvp-buttons.collapsed .quick-rsvp-button.current span::before {
  content: none !important;
}

/* Six-tab phone footer and attendance polish. */
@media (max-width: 720px) {
  .mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: visible;
    min-height: 76px;
    padding: 6px max(4px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-right));
  }

  .mobile-nav-tab {
    min-width: 0;
    flex: 1 1 0;
    min-height: 58px;
    gap: 2px;
    padding: 4px 1px;
    border-radius: 14px;
    font-size: 9px;
    line-height: 1.05;
  }

  .mobile-nav-tab > span:last-child {
    max-width: 100%;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-icon {
    width: 34px;
    height: 25px;
  }

  .mobile-nav-icon::before {
    font-size: 18px;
  }

  .schedule-nav-icon::before,
  .chat-nav-icon::before {
    font-size: 12px;
  }

  .roster-nav-icon::before {
    font-size: 9px;
  }

  .attendance-nav-icon::before {
    font-size: 20px;
  }

  body[data-view="attendance"] .main-content,
  body[data-view="attendance"] #attendance {
    padding-bottom: 104px;
  }

  body[data-view="attendance"] #attendance .attendance-list {
    padding-bottom: 116px;
  }

  body[data-view="attendance"] #attendance .attendance-group:last-child {
    padding-bottom: 30px;
  }

  #attendance .attendance-row {
    min-height: 54px;
    padding: 8px 9px;
  }

  #attendance .rsvp-control {
    gap: 6px;
  }

  #attendance .rsvp-option,
  #attendance .status-badge {
    width: 38px;
    min-width: 38px;
    min-height: 34px;
    border-radius: 12px;
  }

  #attendance .rsvp-option::before,
  #attendance .status-badge::before {
    font-size: 12px;
  }
}

/* Final mobile polish overrides. Keep these at the end so older mobile rules do not win. */
.quick-rsvp-button,
.quick-rsvp-button.current,
.quick-rsvp-button.selected {
  min-height: 36px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 1000;
  text-align: center;
}

.quick-rsvp-button span,
.quick-rsvp-button.current span,
.schedule-actions .quick-rsvp-button span,
.schedule-compact-rsvp .quick-rsvp-button span {
  display: inline-grid;
  place-items: center;
  width: 100%;
  font-size: 13px;
  line-height: 1;
  text-align: center;
}

.quick-rsvp-button.status-yes span::before {
  content: "✓ ";
}

.quick-rsvp-button.status-no span::before {
  content: "X ";
}

.quick-rsvp-button.status-maybe span::before,
.quick-rsvp-button.status-pending span::before {
  content: "? ";
}

.arrival-time {
  border: 1px solid rgba(215, 167, 47, 0.42);
  background: #fff4cc;
  color: #5c4303;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 1000;
}

@media (max-width: 720px) {
  #roster .contact-action-badges {
    gap: 10px;
    margin-top: 10px;
  }

  #roster .contact-action-badge {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 14px;
    padding: 0;
  }

  #roster .contact-action-badge .action-icon {
    font-size: 19px;
  }

  #roster .roster-chat-toggle {
    min-height: 36px;
  }

  #chat .chat-thread-list {
    display: none;
  }

  #schedule .arrival-time {
    display: inline-flex;
    padding: 3px 8px;
    font-size: 11px !important;
  }

  #schedule .schedule-actions .quick-rsvp-button.current,
  #schedule .schedule-actions .schedule-rsvp-buttons.collapsed .quick-rsvp-button,
  #schedule .schedule-actions .map-button {
    min-height: 34px;
    font-size: 12px;
  }

  body.is-admin #schedule .schedule-item {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  body.is-admin #schedule .schedule-actions {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    width: auto;
    gap: 5px;
  }

  body.is-admin #schedule .schedule-actions .map-button,
  body.is-admin #schedule .schedule-actions .compact-button,
  body.is-admin #schedule .schedule-actions .soft-remove-button {
    width: 64px !important;
    min-width: 64px !important;
    min-height: 30px;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 11px;
  }
}

.quick-rsvp-button,
.quick-rsvp-button.current,
.quick-rsvp-button.selected {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
}

.quick-rsvp-button span,
.quick-rsvp-button.current span,
.schedule-actions .quick-rsvp-button span,
.schedule-compact-rsvp .quick-rsvp-button span {
  display: inline-grid;
  place-items: center;
  width: 100%;
  font-size: 13px;
  line-height: 1;
  text-align: center;
}

.quick-rsvp-button.status-yes span {
  text-transform: uppercase;
}

.quick-rsvp-button.status-yes span::before {
  content: "✓ ";
}

.quick-rsvp-button.status-no span::before {
  content: "X ";
}

.quick-rsvp-button.status-maybe span::before,
.quick-rsvp-button.status-pending span::before {
  content: "? ";
}

.arrival-time {
  margin-top: 6px;
  border: 1px solid rgba(215, 167, 47, 0.42);
  background: #fff4cc;
  color: #5c4303;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 1000;
}

.arrival-time::before {
  content: "Arrival ";
}

body.is-admin .schedule-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  width: auto;
}

body.is-admin .schedule-actions .map-button,
body.is-admin .schedule-actions .compact-button,
body.is-admin .schedule-actions .soft-remove-button {
  width: auto !important;
  min-width: 58px !important;
  min-height: 34px;
  border-radius: 9px;
  padding: 0 12px;
  font-size: 12px;
}

.chat-thread-button {
  position: relative;
  padding-right: 34px;
}

.chat-thread-close,
.conversation-close {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--team-primary);
  font-size: 13px;
  font-weight: 1000;
  line-height: 1;
}

.chat-thread-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.conversation-close {
  border-color: var(--line);
}

.mobile-tab-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.mobile-tab-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 900;
}

.mobile-tab-choice.selected {
  border-color: var(--team-accent);
  background: rgba(31, 139, 143, 0.08);
}

/* Compact admin branding panel. */
@media (min-width: 901px) {
  body[data-view="branding"] .branding-layout {
    grid-template-columns: minmax(340px, 420px) minmax(300px, 420px);
    align-items: start;
    gap: 14px;
    max-width: 880px;
  }

  body[data-view="branding"] .branding-form,
  body[data-view="branding"] .brand-preview,
  body[data-view="branding"] .app-tabs-panel {
    padding: 14px;
  }

  body[data-view="branding"] .branding-form {
    gap: 10px;
  }

  body[data-view="branding"] .branding-form label,
  body[data-view="branding"] .branding-form textarea,
  body[data-view="branding"] .branding-form input {
    font-size: 14px;
  }

  body[data-view="branding"] .branding-form textarea {
    min-height: 58px;
  }

  body[data-view="branding"] .color-panel {
    gap: 10px;
    padding: 12px;
  }

  body[data-view="branding"] .color-controls input {
    height: 34px;
  }

  body[data-view="branding"] .color-preset {
    width: 58px;
    height: 28px;
  }

  body[data-view="branding"] .brand-actions {
    gap: 8px;
  }

  body[data-view="branding"] .brand-actions button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  body[data-view="branding"] .brand-preview,
  body[data-view="branding"] .app-tabs-panel {
    grid-column: 2;
  }

  body[data-view="branding"] .brand-preview {
    grid-row: 1;
  }

  body[data-view="branding"] .app-tabs-panel {
    grid-row: 2;
  }

  body[data-view="branding"] .preview-card {
    align-items: center;
    padding: 12px;
  }

  body[data-view="branding"] .preview-card .brand-logo-wrap {
    width: 54px;
    height: 54px;
  }

  body[data-view="branding"] .mobile-tab-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body[data-view="branding"] .mobile-tab-choice {
    min-height: 36px;
    border-radius: 8px;
    padding: 0 9px;
    font-size: 12px;
  }
}

#roster .roster-contact-details,
.roster-contact-details {
  display: none;
}

#roster .roster-card.expanded .roster-contact-details,
.roster-card.expanded .roster-contact-details {
  display: grid;
}

@media (max-width: 720px) {
  .schedule-pagination {
    display: none !important;
  }

  #chat .chat-thread-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 14px 10px !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--line);
  }

  #chat .chat-thread-button {
    flex: 0 0 172px;
    min-width: 172px;
    min-height: 54px;
    padding: 8px 34px 8px 12px;
    border-radius: 14px;
    box-shadow: none;
  }

  #chat .chat-thread-button strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #chat .chat-thread-button span:not(.chat-thread-close) {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #chat .chat-conversation-header {
    margin-top: 0;
  }

  #schedule .arrival-time {
    display: inline-flex;
    padding: 3px 8px;
    font-size: 11px !important;
  }

  #schedule .schedule-actions .quick-rsvp-button.current,
  #schedule .schedule-actions .schedule-rsvp-buttons.collapsed .quick-rsvp-button {
    min-height: 34px;
    font-size: 12px;
  }

  #schedule .schedule-actions .map-button {
    min-height: 34px;
    font-size: 11px;
  }

  body.is-admin #schedule .schedule-item {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  body.is-admin #schedule .schedule-actions {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    width: auto;
  }

  body.is-admin #schedule .schedule-actions .map-button,
  body.is-admin #schedule .schedule-actions .compact-button,
  body.is-admin #schedule .schedule-actions .soft-remove-button {
    width: 64px !important;
    min-width: 64px !important;
    min-height: 30px;
    padding: 0 8px;
  }
}

@media (max-width: 720px) {
  #schedule .schedule-list {
    gap: 0;
    padding: 0 10px 86px;
  }

  #schedule .schedule-item {
    grid-template-columns: 48px minmax(0, 1fr) 64px;
    gap: 9px;
    min-height: 64px;
    padding: 8px 10px;
  }

  #schedule .schedule-date-tile {
    width: 44px;
    min-height: 44px;
    border-radius: 12px;
  }

  #schedule .schedule-date-tile strong {
    font-size: 18px;
  }

  #schedule .schedule-date-tile span {
    font-size: 10px;
  }

  #schedule .schedule-item-main > strong {
    font-size: 14px;
  }

  #schedule .schedule-item-main > span,
  #schedule .schedule-item-main > span b {
    font-size: 11px;
  }

  #schedule .schedule-actions {
    grid-column: 3;
    grid-row: 1;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    align-self: center;
    gap: 5px;
    width: 64px;
    margin-top: 0;
  }

  #schedule .schedule-quick-rsvp {
    width: 64px;
  }

  #schedule .schedule-rsvp-buttons.collapsed,
  #schedule .schedule-compact-rsvp.collapsed {
    justify-content: stretch;
  }

  #schedule .schedule-actions .schedule-rsvp-buttons.collapsed .quick-rsvp-button,
  #schedule .schedule-actions .quick-rsvp-button.current {
    width: 64px;
    min-width: 64px;
    min-height: 32px;
    border-radius: 8px;
    padding: 0 5px;
    font-size: 12px;
  }

  #schedule .schedule-actions .map-button {
    width: 64px;
    min-width: 64px;
    min-height: 32px;
    border-radius: 8px;
    font-size: 10px;
  }

  #schedule .schedule-actions:has(.schedule-rsvp-buttons.expanded) {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) 64px;
    width: 100%;
    margin-top: 4px;
  }

  #schedule .schedule-actions:has(.schedule-rsvp-buttons.expanded) .schedule-quick-rsvp,
  #schedule .schedule-actions:has(.schedule-rsvp-buttons.expanded) .schedule-rsvp-buttons.expanded {
    width: 100%;
  }

  #schedule .schedule-actions:has(.schedule-rsvp-buttons.expanded) .quick-rsvp-button {
    min-height: 32px;
    font-size: 10px;
  }

  body.is-admin[data-view="dashboard"] .dashboard-grid {
    grid-template-columns: 1fr;
  }

  body.is-admin[data-view="dashboard"] .upcoming-panel {
    grid-row: auto;
  }
}

.quick-rsvp-button,
.quick-rsvp-button.current,
.quick-rsvp-button.selected,
.schedule-rsvp-buttons.collapsed .quick-rsvp-button.current,
.schedule-compact-rsvp.collapsed .quick-rsvp-button.current,
.home-rsvp-buttons.collapsed .quick-rsvp-button.current {
  opacity: 1;
}

.quick-rsvp-button span,
.quick-rsvp-button.current span,
.schedule-actions .quick-rsvp-button span,
.schedule-compact-rsvp .quick-rsvp-button span {
  color: inherit;
  opacity: 1;
  font-weight: 900;
}

.quick-rsvp-button.status-yes,
.quick-rsvp-button.status-no,
.quick-rsvp-button.status-pending {
  color: #ffffff;
}

.quick-rsvp-button.status-maybe {
  color: #332300;
}

/* Final fit pass: keep home and attendance readable in web preview/tablet widths. */
@media (min-width: 721px) and (max-width: 1280px) {
  .main-content {
    min-width: 0;
    overflow-x: hidden;
    padding: 14px;
  }

  .top-strip {
    max-width: 760px;
    padding: 12px 16px;
  }

  .brand-logo-wrap {
    width: 56px;
    height: 56px;
  }

  .brand-text h1 {
    font-size: 28px;
  }

  body[data-view="dashboard"] #dashboard,
  body[data-view="attendance"] #attendance,
  body[data-view="roster"] #roster,
  body[data-view="schedule"] #schedule,
  body[data-view="chat"] #chat,
  body[data-view="funds"] #funds,
  body[data-view="branding"] #branding {
    max-width: 760px;
    width: 100%;
    overflow-x: hidden;
  }

  body[data-view="dashboard"] .section-title-row {
    max-width: 760px;
  }

  body[data-view="dashboard"] .dashboard-grid,
  body.is-admin[data-view="dashboard"] .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 520px;
    gap: 12px;
  }

  body[data-view="dashboard"] .dashboard-panel,
  body[data-view="dashboard"] .dashboard-card {
    max-width: 520px;
  }

  body[data-view="dashboard"] .home-event-row,
  body[data-view="dashboard"] .attendance-needed-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  body[data-view="dashboard"] .home-event-row > div,
  body[data-view="dashboard"] .attendance-needed-row > div {
    min-width: 0;
  }

  body[data-view="dashboard"] .home-event-row strong,
  body[data-view="dashboard"] .home-event-row span,
  body[data-view="dashboard"] .attendance-needed-row strong,
  body[data-view="dashboard"] .attendance-needed-row span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-view="dashboard"] .home-event-actions {
    display: grid;
    grid-template-columns: 92px 44px;
    gap: 6px;
    min-width: 142px;
  }

  body[data-view="dashboard"] .home-event-actions .map-button,
  body[data-view="dashboard"] .home-event-actions .quick-rsvp-button.current,
  body[data-view="dashboard"] .home-event-actions .home-rsvp-buttons.collapsed .quick-rsvp-button {
    width: 100%;
    min-width: 0;
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
    line-height: 1;
  }

  body[data-view="dashboard"] .home-rsvp-buttons.expanded {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }

  body[data-view="dashboard"] .home-rsvp-buttons.expanded .quick-rsvp-button {
    min-width: 0;
    font-size: 10px;
    padding: 0 4px;
  }

  body[data-view="attendance"] .section-title-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 760px;
  }

  body[data-view="attendance"] .section-title-row label,
  body[data-view="attendance"] .section-title-row select {
    width: min(100%, 420px);
  }

  body[data-view="attendance"] #attendance .attendance-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
    max-width: 760px;
  }

  body[data-view="attendance"] .event-summary-card,
  body[data-view="attendance"] .attendance-reminder-panel,
  body[data-view="attendance"] .attendance-group {
    max-width: 640px;
    width: 100%;
  }

  body:not(.is-admin)[data-view="attendance"] .event-summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(210px, 0.75fr);
    gap: 10px;
    align-items: stretch;
  }

  body:not(.is-admin)[data-view="attendance"] .event-card-dark {
    min-width: 0;
  }

  body:not(.is-admin)[data-view="attendance"] .attendance-count-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-view="attendance"] .attendance-group-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 640px;
    gap: 8px;
  }

  body[data-view="attendance"] .attendance-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    overflow: hidden;
  }

  body[data-view="attendance"] .attendance-row strong,
  body[data-view="attendance"] .attendance-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="attendance"] .attendance-row .quick-rsvp-button.current,
  body[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.collapsed .quick-rsvp-button,
  body[data-view="attendance"] .attendance-row .schedule-compact-rsvp.collapsed .quick-rsvp-button {
    width: 96px;
    min-width: 96px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 1;
  }

  body[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.expanded,
  body[data-view="attendance"] .attendance-row .schedule-compact-rsvp.expanded {
    display: grid;
    grid-template-columns: repeat(3, 58px);
    gap: 4px;
    width: auto;
  }

  body[data-view="attendance"] .attendance-row .schedule-rsvp-buttons.expanded .quick-rsvp-button,
  body[data-view="attendance"] .attendance-row .schedule-compact-rsvp.expanded .quick-rsvp-button {
    width: 58px;
    min-width: 58px;
    min-height: 32px;
    padding: 0 4px;
    font-size: 10px;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .top-strip {
    max-width: 620px;
  }

  body[data-view="dashboard"] #dashboard,
  body[data-view="attendance"] #attendance,
  body[data-view="roster"] #roster,
  body[data-view="schedule"] #schedule,
  body[data-view="chat"] #chat,
  body[data-view="funds"] #funds,
  body[data-view="branding"] #branding {
    max-width: 620px;
  }

  body:not(.is-admin)[data-view="attendance"] .event-summary-card {
    grid-template-columns: 1fr;
  }

  body[data-view="attendance"] .event-summary-card,
  body[data-view="attendance"] .attendance-reminder-panel,
  body[data-view="attendance"] .attendance-group,
  body[data-view="attendance"] .attendance-group-grid {
    max-width: 540px;
  }
}

/* Final attendance badge normalization: one symbol language across web, admin, and app. */
body[data-view="attendance"] .attendance-row .quick-rsvp-button,
body[data-view="attendance"] .attendance-row .quick-rsvp-button.current,
body[data-view="attendance"] .attendance-row .quick-rsvp-button.selected,
body[data-view="attendance"] .attendance-row .status-badge {
  display: grid !important;
  place-items: center !important;
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 9px !important;
  border: 0 !important;
  color: #ffffff !important;
  font-size: 18px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-align: center !important;
  opacity: 1 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-yes,
body[data-view="attendance"] .attendance-row .status-badge.allowed {
  background: #218768 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-no,
body[data-view="attendance"] .attendance-row .status-badge.blocked {
  background: #c97880 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-maybe,
body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-pending,
body[data-view="attendance"] .attendance-row .status-badge.warning {
  background: #a2adb2 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button span,
body[data-view="attendance"] .attendance-row .quick-rsvp-button.current span,
body[data-view="attendance"] .attendance-row .quick-rsvp-button.selected span {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  color: #ffffff !important;
  font-size: 18px !important;
  line-height: 1 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button::before,
body[data-view="attendance"] .attendance-row .quick-rsvp-button span::before,
body[data-view="attendance"] .attendance-row .status-badge::before {
  content: "" !important;
}

/* Final RSVP color split: maybe is yellow, no reply is gray. */
body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-yes,
body[data-view="attendance"] .attendance-row .status-badge.allowed {
  background: #218768 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-no,
body[data-view="attendance"] .attendance-row .status-badge.blocked {
  background: #c97880 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-maybe,
body[data-view="attendance"] .attendance-row .status-badge.maybe {
  background: #e0b947 !important;
  color: #332300 !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-pending,
body[data-view="attendance"] .attendance-row .status-badge.pending {
  background: #a2adb2 !important;
  color: #ffffff !important;
}

body[data-view="attendance"] .attendance-row .quick-rsvp-button.status-maybe span {
  color: #332300 !important;
}

/* Final mini RSVP selector: equal icon buttons, no leftover word labels. */
.quick-rsvp-button::before,
.quick-rsvp-button span::before,
.home-rsvp-buttons .quick-rsvp-button::before,
.home-rsvp-buttons .quick-rsvp-button span::before,
.schedule-rsvp-buttons .quick-rsvp-button::before,
.schedule-rsvp-buttons .quick-rsvp-button span::before,
.schedule-compact-rsvp .quick-rsvp-button::before,
.schedule-compact-rsvp .quick-rsvp-button span::before {
  content: "" !important;
  display: none !important;
}

.home-rsvp-buttons.expanded,
.schedule-rsvp-buttons.expanded,
.schedule-compact-rsvp.expanded {
  display: grid !important;
  grid-template-columns: repeat(3, 44px) !important;
  gap: 4px !important;
  width: auto !important;
  min-width: 140px !important;
  overflow: visible !important;
  border-radius: 0 !important;
}

.home-rsvp-buttons.expanded .quick-rsvp-button,
.schedule-rsvp-buttons.expanded .quick-rsvp-button,
.schedule-compact-rsvp.expanded .quick-rsvp-button {
  display: grid !important;
  place-items: center !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border-radius: 9px !important;
  font-size: 17px !important;
  line-height: 1 !important;
  opacity: 1 !important;
}

.home-rsvp-buttons.expanded .quick-rsvp-button span,
.schedule-rsvp-buttons.expanded .quick-rsvp-button span,
.schedule-compact-rsvp.expanded .quick-rsvp-button span {
  display: grid !important;
  place-items: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  font-size: 17px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  opacity: 1 !important;
}

.home-rsvp-buttons.expanded .quick-rsvp-button.status-yes,
.schedule-rsvp-buttons.expanded .quick-rsvp-button.status-yes,
.schedule-compact-rsvp.expanded .quick-rsvp-button.status-yes {
  background: #218768 !important;
  color: #ffffff !important;
}

.home-rsvp-buttons.expanded .quick-rsvp-button.status-no,
.schedule-rsvp-buttons.expanded .quick-rsvp-button.status-no,
.schedule-compact-rsvp.expanded .quick-rsvp-button.status-no {
  background: #c97880 !important;
  color: #ffffff !important;
}

.home-rsvp-buttons.expanded .quick-rsvp-button.status-maybe,
.schedule-rsvp-buttons.expanded .quick-rsvp-button.status-maybe,
.schedule-compact-rsvp.expanded .quick-rsvp-button.status-maybe {
  background: #e0b947 !important;
  color: #332300 !important;
}

.home-rsvp-buttons.expanded .quick-rsvp-button.status-maybe span,
.schedule-rsvp-buttons.expanded .quick-rsvp-button.status-maybe span,
.schedule-compact-rsvp.expanded .quick-rsvp-button.status-maybe span {
  color: #332300 !important;
}

/* Mobile messages: inbox first, then open one conversation. */
.chat-back-button {
  display: none;
}

@media (max-width: 720px) {
  body[data-view="chat"].chat-inbox-mode #chat .chat-thread-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 8px 14px 90px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-bottom: 0 !important;
  }

  body[data-view="chat"].chat-inbox-mode #chat .chat-thread-button {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 68px !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: var(--ink) !important;
    border: 1px solid var(--line) !important;
  }

  body[data-view="chat"].chat-inbox-mode #chat .chat-thread-button strong,
  body[data-view="chat"].chat-inbox-mode #chat .chat-thread-button span:not(.chat-thread-close) {
    grid-column: 1;
  }

  body[data-view="chat"].chat-inbox-mode #chat .chat-thread-button::after {
    content: ">";
    grid-column: 2;
    grid-row: 1 / span 2;
    color: var(--muted);
    font-size: 22px;
    font-weight: 900;
  }

  body[data-view="chat"].chat-inbox-mode #chat .chat-thread-button.active {
    background: #ffffff !important;
    color: var(--ink) !important;
    border-color: var(--line) !important;
  }

  body[data-view="chat"].chat-inbox-mode #chat .chat-thread-button.active span {
    color: var(--muted) !important;
  }

  body[data-view="chat"].chat-inbox-mode #chat .chat-conversation-header,
  body[data-view="chat"].chat-inbox-mode #chat .chat-layout {
    display: none !important;
  }

  body[data-view="chat"].chat-conversation-mode #chat .chat-thread-list {
    display: none !important;
  }

  body[data-view="chat"].chat-conversation-mode #chat .chat-conversation-header,
  body[data-view="chat"].chat-conversation-mode #chat .chat-layout {
    display: flex !important;
  }

  body[data-view="chat"].chat-conversation-mode #chat .chat-layout {
    display: grid !important;
  }

  body[data-view="chat"].chat-conversation-mode #chat .chat-conversation-header {
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  body[data-view="chat"] .chat-back-button {
    display: inline-grid;
    place-items: center;
    min-width: 58px;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--team-primary);
    font-size: 13px;
    font-weight: 1000;
  }

  body[data-view="chat"].chat-conversation-mode #chat .chat-window {
    height: calc(100dvh - 224px);
  }
}

/* Mobile footer final override: bright app-style tabs. */
@media (max-width: 720px) {
  .mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    min-height: calc(76px + env(safe-area-inset-bottom)) !important;
    padding: 0 max(2px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(2px, env(safe-area-inset-right)) !important;
    overflow: hidden !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: #1669a9 !important;
    box-shadow: 0 -10px 24px rgba(9, 31, 48, 0.22) !important;
  }

  .mobile-nav-tab {
    display: grid !important;
    grid-template-rows: 30px 18px !important;
    align-content: center !important;
    justify-items: center !important;
    min-width: 0 !important;
    min-height: 76px !important;
    gap: 2px !important;
    padding: 7px 1px 6px !important;
    border: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
  }

  .mobile-nav-tab:first-child {
    border-left: 0 !important;
  }

  .mobile-nav-tab.active {
    background: #0e5a92 !important;
    color: #ffffff !important;
    box-shadow: inset 0 3px 0 var(--team-accent) !important;
  }

  .mobile-nav-tab > span:last-child {
    color: currentColor !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .mobile-nav-icon,
  .mobile-nav-tab.active .mobile-nav-icon {
    display: grid !important;
    place-items: center !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: currentColor !important;
  }

  .mobile-nav-icon::before {
    content: "" !important;
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    background: currentColor !important;
    -webkit-mask: var(--nav-icon) center / 24px 24px no-repeat !important;
    mask: var(--nav-icon) center / 24px 24px no-repeat !important;
  }

  .home-nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 11.5 12 4l9 7.5v8a1 1 0 0 1-1 1h-5.5v-6h-5v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E");
  }

  .schedule-nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h3zm12 8H5v9h14zM7 12h3v3H7zm5 0h3v3h-3z'/%3E%3C/svg%3E");
  }

  .roster-nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8m8.5 1a3.5 3.5 0 1 1 .01-7.01A3.5 3.5 0 0 1 16.5 12M2 20c0-4 2.7-7 6-7s6 3 6 7v1H2zm12.7 1c.2-.5.3-1 .3-1.6 0-2.1-.8-4-2.1-5.4 1-.6 2.2-1 3.6-1 3 0 5.5 2.7 5.5 6v2z'/%3E%3C/svg%3E");
  }

  .chat-nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H8l-5 4V5a1 1 0 0 1 1-1m3 5h10V7H7zm0 4h7v-2H7z'/%3E%3C/svg%3E");
  }

  .attendance-nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h3zm12 8H5v9h14zm-4.2 2.2 1.4 1.4-4.8 4.8-2.8-2.8 1.4-1.4 1.4 1.4z'/%3E%3C/svg%3E");
  }

  .funds-nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M13 2v3c2 .2 3.8.9 5 2.2l-2.2 2.2C15 8.6 14 8.1 13 8v3.1c3.3.8 5 2.1 5 4.8 0 2.8-2.1 4.5-5 4.8V23h-2v-2.3c-2.5-.3-4.6-1.3-6-3l2.4-2.1c1 1.1 2.2 1.8 3.6 2.1v-3.5c-3.2-.8-5-2-5-4.7C6 6.8 8 5.2 11 5V2zm-2 5.8c-1 .2-1.6.7-1.6 1.5 0 .7.4 1.1 1.6 1.5zm2 10c1-.2 1.6-.7 1.6-1.6 0-.8-.4-1.2-1.6-1.6z'/%3E%3C/svg%3E");
  }

  .branding-nav-icon,
  .admin-nav-icon {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 4 5.5v6.3c0 4.6 3.3 8.8 8 10.2 4.7-1.4 8-5.6 8-10.2V5.5zm0 5a2.5 2.5 0 0 1 1 4.8V17h-2v-5.2A2.5 2.5 0 0 1 12 7'/%3E%3C/svg%3E");
  }
}

/* Admin phone roster: keep invite tools and member actions thumb-friendly. */
@media (max-width: 720px) {
  body.is-admin[data-view="roster"] #roster {
    padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
  }

  body.is-admin[data-view="roster"] .section-heading {
    padding: 12px 14px 6px !important;
    margin: 0 !important;
  }

  body.is-admin[data-view="roster"] #csvImportPanel {
    display: none !important;
  }

  body.is-admin[data-view="roster"] #rosterInvitePanel {
    margin: 8px 14px 12px !important;
    padding: 12px !important;
    border-radius: 12px !important;
  }

  body.is-admin[data-view="roster"] #rosterInvitePanel .member-form-header {
    margin-bottom: 8px !important;
  }

  body.is-admin[data-view="roster"] #rosterInvitePanel h3 {
    font-size: 18px !important;
  }

  body.is-admin[data-view="roster"] #rosterInvitePanel .muted {
    font-size: 13px !important;
    line-height: 1.35 !important;
  }

  body.is-admin[data-view="roster"] .roster-invite-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body.is-admin[data-view="roster"] #rosterInviteForm {
    gap: 10px !important;
  }

  body.is-admin[data-view="roster"] #rosterInviteForm input,
  body.is-admin[data-view="roster"] #rosterInviteForm select {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
  }

  body.is-admin[data-view="roster"] #rosterInviteForm .primary-button {
    min-height: 46px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
  }

  body.is-admin[data-view="roster"] .roster-invite-layout > div:last-child {
    border-top: 1px solid var(--line) !important;
    padding-top: 10px !important;
    min-width: 0 !important;
  }

  body.is-admin[data-view="roster"] .roster-invite-layout h4 {
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }

  body.is-admin[data-view="roster"] .invite-list {
    max-height: 170px !important;
    overflow-y: auto !important;
    gap: 8px !important;
    padding-right: 2px !important;
  }

  body.is-admin[data-view="roster"] .invite-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px !important;
  }

  body.is-admin[data-view="roster"] .invite-item strong,
  body.is-admin[data-view="roster"] .invite-item a,
  body.is-admin[data-view="roster"] .invite-item span {
    overflow-wrap: anywhere !important;
  }

  body.is-admin[data-view="roster"] #rosterList {
    display: grid !important;
    gap: 10px !important;
    padding: 0 14px 18px !important;
  }

  body.is-admin[data-view="roster"] .roster-card {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 10px !important;
    min-height: 0 !important;
    padding: 12px !important;
    border-radius: 12px !important;
  }

  body.is-admin[data-view="roster"] .roster-card .member-avatar {
    width: 38px !important;
    height: 38px !important;
    font-size: 13px !important;
  }

  body.is-admin[data-view="roster"] .roster-main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px !important;
    min-width: 0 !important;
  }

  body.is-admin[data-view="roster"] .roster-main strong {
    font-size: 15px !important;
    line-height: 1.15 !important;
  }

  body.is-admin[data-view="roster"] .roster-subtitle {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.is-admin[data-view="roster"] .roster-actions {
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
    width: 100% !important;
    margin: 0 !important;
    justify-content: stretch !important;
    align-items: center !important;
  }

  body.is-admin[data-view="roster"] .roster-actions .compact-button,
  body.is-admin[data-view="roster"] .roster-actions .soft-remove-button,
  body.is-admin[data-view="roster"] .roster-chat-toggle {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px !important;
    border-radius: 999px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    justify-content: center !important;
  }

  body.is-admin[data-view="roster"] .roster-chat-toggle {
    gap: 6px !important;
  }

  body.is-admin[data-view="roster"] .roster-chat-toggle i {
    width: 32px !important;
    height: 18px !important;
  }

  body.is-admin[data-view="roster"] .roster-chat-toggle i::after {
    width: 12px !important;
    height: 12px !important;
  }

  body.is-admin[data-view="roster"] .roster-chat-toggle input:checked + i::after {
    transform: translateX(14px) !important;
  }

  body.is-admin[data-view="roster"] .jersey-number {
    position: static !important;
    grid-column: auto !important;
    justify-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 38px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
  }

  body.is-admin[data-view="roster"] .roster-contact-details {
    grid-column: 1 / -1 !important;
    padding-top: 10px !important;
  }

  body.is-admin[data-view="roster"] .mobile-fab {
    right: 14px !important;
    bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    width: 58px !important;
    height: 58px !important;
    border-radius: 18px !important;
    font-size: 34px !important;
  }
}

/* Parent web attendance should mirror the cleaner admin attendance layout without pushing lists off-screen. */
@media (min-width: 1081px) {
  body:not(.is-admin)[data-view="attendance"] .main-content {
    display: block !important;
    padding: 18px 24px 30px !important;
    overflow-x: hidden !important;
  }

  body:not(.is-admin)[data-view="attendance"] .top-strip,
  body:not(.is-admin)[data-view="attendance"] #attendance {
    width: 100% !important;
    max-width: min(1080px, calc(100vw - 300px)) !important;
    margin: 0 !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .section-heading {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px) !important;
    align-items: end !important;
    gap: 16px !important;
    margin-bottom: 14px !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .event-picker {
    justify-self: stretch !important;
    width: 100% !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-layout {
    display: grid !important;
    grid-template-columns: minmax(280px, 320px) minmax(280px, 340px) !important;
    grid-template-areas:
      "summary response"
      "list list" !important;
    align-items: start !important;
    gap: 16px !important;
    width: 100% !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-summary,
  body:not(.is-admin)[data-view="attendance"] #attendance .admin-reminders {
    display: grid !important;
    gap: 12px !important;
    align-self: start !important;
    width: 100% !important;
    max-width: none !important;
    padding: 14px !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-summary {
    grid-area: summary !important;
    grid-template-columns: 1fr !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-summary h3 {
    grid-column: 1 !important;
    margin-bottom: 0 !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-summary .next-event {
    width: 100% !important;
    min-height: 122px !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-counts {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-count-card {
    min-width: 0 !important;
    min-height: 58px !important;
    padding: 9px 10px !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-reminder-actions {
    display: none !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .admin-reminders {
    grid-area: response !important;
    display: grid !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .admin-reminders h3 {
    margin-bottom: 0 !important;
    font-size: 18px !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .reminder-summary {
    display: grid !important;
    gap: 8px !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .reminder-summary .muted {
    margin: 4px 0 0 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-list {
    grid-area: list !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(260px, 1fr)) !important;
    gap: 12px 14px !important;
    max-width: none !important;
    max-height: 470px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 8px !important;
    scrollbar-gutter: stable !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-group {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding-bottom: 6px !important;
  }

  body:not(.is-admin)[data-view="attendance"] #attendance .attendance-row {
    width: 100% !important;
    min-width: 0 !important;
  }
}
