/* Coach Pods is intentionally isolated from the community feed and private
   messages. Every selector is scoped so the feature cannot restyle either. */
.coach-pods-page {
  display: grid;
  gap: 0;
  min-width: 0;
  padding-bottom: max(18px, var(--fruit-up-safe-bottom, env(safe-area-inset-bottom)));
}

.coach-pod-fallback-hero,
.coach-pod-identity,
.coach-pod-capacity,
.coach-pod-roster,
.coach-pod-management,
.coach-pod-announcements,
.coach-pod-error,
.coach-pod-loading {
  width: min(100%, 1120px);
  margin-inline: auto;
}

.coach-pod-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--lime, #b9e531) 44%, var(--line, #dce5dc));
  background:
    radial-gradient(circle at 100% 0, rgba(185, 229, 49, .18), transparent 38%),
    linear-gradient(145deg, var(--surface, #fff), var(--surface-soft, #f6f8f6));
}

.coach-pod-identity h2,
.coach-pod-capacity h2,
.coach-pod-roster h2,
.coach-pod-management h2,
.coach-pod-announcements h2,
.coach-pod-error h2,
.coach-pod-empty h2,
.coach-pod-empty h3,
.coach-pod-coach-announcement h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.coach-pod-identity p,
.coach-pod-capacity p,
.coach-pod-coach-announcement p,
.coach-pod-empty p,
.coach-pod-error p {
  margin: 7px 0 0;
  line-height: 1.58;
}

.coach-pod-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--lime, #b9e531) 58%, var(--line, #dce5dc));
  border-radius: 50%;
  color: #f7ffe9;
  background: linear-gradient(145deg, #183022, #315a37);
  box-shadow: 0 8px 20px rgba(18, 48, 27, .18);
  font-weight: 900;
  letter-spacing: .025em;
}

.coach-pod-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.coach-pod-avatar-large {
  width: 72px;
  height: 72px;
  font-size: 1.15rem;
}

.coach-pod-capacity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  border-left: 6px solid var(--lime, #b9e531);
}

.coach-pod-capacity.is-over {
  border-color: #f0a044;
  background: linear-gradient(145deg, #fff8ed, var(--surface, #fff));
}

.coach-pod-capacity .status {
  justify-self: end;
  white-space: nowrap;
}

.coach-pod-roster,
.coach-pod-management,
.coach-pod-announcements {
  margin-bottom: 28px;
  scroll-margin-top: calc(96px + var(--fruit-up-safe-top, 0px));
}

.coach-pod-roster .section-head,
.coach-pod-management .section-head,
.coach-pod-announcements .section-head {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.coach-pod-roster .section-head p,
.coach-pod-management .section-head p,
.coach-pod-announcements .section-head p {
  margin: 5px 0 0;
}

.coach-pod-heading-actions,
.coach-pod-member-actions,
.coach-pod-composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.coach-pod-heading-actions .button,
.coach-pod-member-actions .button,
.coach-pod-composer-actions .button,
.coach-pod-private-reply .button,
.coach-pod-identity > .button,
.coach-pod-error .button {
  min-height: 48px;
}

.coach-pod-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 14px;
}

.coach-pod-member {
  display: grid;
  gap: 18px;
  align-content: space-between;
  min-width: 0;
}

.coach-pod-member-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.coach-pod-member-identity > div:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.coach-pod-member-identity strong,
.coach-pod-member-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.coach-pod-member-identity strong {
  font-size: 1.05rem;
}

.coach-pod-member-identity small {
  color: var(--muted, #617064);
  white-space: nowrap;
}

.coach-pod-member-actions .button {
  flex: 1 1 128px;
  min-width: 0;
}

.coach-pod-feed,
.coach-pod-coach-feed {
  display: grid;
  gap: 14px;
}

.coach-pod-announcement,
.coach-pod-coach-announcement {
  scroll-margin-top: calc(104px + var(--fruit-up-safe-top, 0px));
  transition:
    border-color var(--motion-duration-quick) var(--motion-ease-standard),
    box-shadow var(--motion-duration-quick) var(--motion-ease-standard),
    background-color var(--motion-duration-quick) var(--motion-ease-standard);
}

.coach-pod-announcement.is-unread {
  border-color: color-mix(in srgb, var(--orange, #ff5e00) 58%, var(--line, #dce5dc));
  box-shadow: var(--surface-shadow-raised, 0 16px 38px rgba(29,37,32,.12));
}

.coach-pod-announcement:target,
.coach-pod-announcement.is-route-target,
.coach-pod-coach-announcement:target,
.coach-pod-coach-announcement.is-route-target {
  outline: 4px solid color-mix(in srgb, var(--orange, #ff5e00) 30%, transparent);
  outline-offset: 3px;
}

.coach-pod-announcement details,
.coach-pod-announcement summary {
  min-width: 0;
}

.coach-pod-announcement summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 52px;
  list-style: none;
  cursor: pointer;
}

.coach-pod-announcement summary::-webkit-details-marker {
  display: none;
}

.coach-pod-announcement summary:focus-visible {
  border-radius: 10px;
  outline: 3px solid rgba(255, 94, 0, .3);
  outline-offset: 5px;
}

.coach-pod-announcement-heading {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.coach-pod-announcement-heading strong {
  font-size: clamp(1.08rem, 3vw, 1.3rem);
  overflow-wrap: anywhere;
}

.coach-pod-announcement-heading small,
.coach-pod-coach-announcement small,
.coach-pod-availability,
.coach-pod-private-reply small {
  color: var(--muted, #617064);
}

.coach-pod-read-state {
  display: inline-flex;
  min-width: 58px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.coach-pod-read-state.is-new {
  color: #fff;
  background: var(--orange, #ff5e00);
}

.coach-pod-read-state.is-read {
  color: var(--muted, #617064);
  background: var(--surface-2, #edf2ed);
}

.coach-pod-announcement-body {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line, #dce5dc);
}

.coach-pod-announcement-body > p {
  margin: 0;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.coach-pod-availability {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-soft, #f6f8f6);
}

.coach-pod-private-reply {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--lime, #b9e531) 44%, var(--line, #dce5dc));
  border-radius: 16px;
  background: color-mix(in srgb, var(--lime, #b9e531) 7%, var(--surface, #fff));
}

.coach-pod-private-reply .field,
.coach-pod-composer .field {
  margin: 0;
}

.coach-pod-private-reply textarea,
.coach-pod-composer textarea {
  min-height: 116px;
  resize: vertical;
}

.coach-pod-coach-announcement {
  display: grid;
  gap: 14px;
}

.coach-pod-coach-announcement > header,
.coach-pod-coach-announcement > footer {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.coach-pod-coach-announcement > header > div {
  min-width: 0;
}

.coach-pod-coach-announcement > p {
  margin: 0;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.coach-pod-coach-announcement > footer {
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line, #dce5dc);
}

.coach-pod-receipts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.coach-pod-receipts > div {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line, #dce5dc);
  border-radius: 13px;
  background: var(--surface-soft, #f6f8f6);
}

.coach-pod-receipts dt {
  color: var(--muted, #617064);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.coach-pod-receipts dd {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
}

.coach-pod-receipt-note {
  margin: -2px 0 0 !important;
  color: var(--muted, #617064);
  font-size: .84rem;
  line-height: 1.5 !important;
}

.coach-pod-composer {
  margin: 0 0 16px;
  border-color: color-mix(in srgb, var(--orange, #ff5e00) 48%, var(--line, #dce5dc));
  background: linear-gradient(145deg, var(--surface, #fff), color-mix(in srgb, var(--orange, #ff5e00) 5%, var(--surface, #fff)));
}

.coach-pod-composer[hidden],
.coach-pod-composer [hidden] {
  display: none !important;
}

.coach-pod-composer form {
  display: grid;
  gap: 16px;
}

.coach-pod-composer .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.coach-pod-privacy-reminder,
.coach-pod-offline {
  margin: 0 0 16px;
}

.coach-pod-privacy-reminder p,
.coach-pod-offline p {
  margin: 5px 0 0;
}

.coach-pod-schedule-choice,
.coach-pod-privacy-confirmation {
  display: flex;
  min-height: 48px;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line, #dce5dc);
  border-radius: 14px;
  background: var(--surface-soft, #f6f8f6);
  cursor: pointer;
}

.coach-pod-schedule-choice input,
.coach-pod-privacy-confirmation input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--orange, #ff5e00);
}

.coach-pod-privacy-confirmation > span {
  display: grid;
  gap: 4px;
}

.coach-pod-privacy-confirmation small {
  color: var(--muted, #617064);
  line-height: 1.45;
}

.coach-pod-empty,
.coach-pod-error,
.coach-pod-loading {
  text-align: left;
}

.coach-pod-empty {
  grid-column: 1 / -1;
  min-height: 150px;
  align-content: center;
  border-style: dashed;
}

.coach-pod-error .button {
  margin-top: 16px;
}

.coach-pod-loading {
  min-height: 180px;
  display: grid;
  place-items: center;
}

html[data-theme="dark"] .coach-pod-identity,
html[data-theme="dark"] .coach-pod-composer,
html[data-theme="dark"] .coach-pod-private-reply {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--lime, #b9e531) 36%, var(--line));
  background:
    radial-gradient(circle at 100% 0, rgba(185, 229, 49, .12), transparent 40%),
    linear-gradient(145deg, var(--surface, #151e18), var(--surface-soft, #1b251e));
}

html[data-theme="dark"] .coach-pod-capacity.is-over {
  color: var(--ink);
  border-color: #c87b35;
  background: linear-gradient(145deg, #2d2218, var(--surface, #151e18));
}

html[data-theme="dark"] .coach-pod-read-state.is-read,
html[data-theme="dark"] .coach-pod-availability,
html[data-theme="dark"] .coach-pod-receipts > div,
html[data-theme="dark"] .coach-pod-schedule-choice,
html[data-theme="dark"] .coach-pod-privacy-confirmation {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-soft);
}

html[data-theme="dark"] .coach-pod-announcement.is-unread {
  border-color: #ff9254;
  background: color-mix(in srgb, var(--orange, #ff5e00) 7%, var(--surface));
}

html[data-theme="dark"] .coach-pod-announcement-heading small,
html[data-theme="dark"] .coach-pod-coach-announcement small,
html[data-theme="dark"] .coach-pod-availability,
html[data-theme="dark"] .coach-pod-private-reply small,
html[data-theme="dark"] .coach-pod-member-identity small,
html[data-theme="dark"] .coach-pod-receipts dt,
html[data-theme="dark"] .coach-pod-privacy-confirmation small,
html[data-theme="dark"] .coach-pod-receipt-note {
  color: #c5d1c7;
}

@media (max-width: 760px) {
  .coach-pod-fallback-hero,
  .coach-pod-identity,
  .coach-pod-capacity,
  .coach-pod-roster,
  .coach-pod-management,
  .coach-pod-announcements,
  .coach-pod-error,
  .coach-pod-loading {
    width: 100%;
  }

  .coach-pod-identity {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 18px;
  }

  .coach-pod-identity > .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .coach-pod-capacity {
    grid-template-columns: 1fr;
  }

  .coach-pod-capacity .status {
    justify-self: start;
  }

  .coach-pod-roster .section-head,
  .coach-pod-management .section-head,
  .coach-pod-announcements .section-head,
  .coach-pod-coach-announcement > header,
  .coach-pod-coach-announcement > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .coach-pod-heading-actions,
  .coach-pod-composer-actions,
  .coach-pod-heading-actions .button,
  .coach-pod-composer-actions .button,
  .coach-pod-announcements .section-head > .button,
  .coach-pod-coach-announcement > footer .button,
  .coach-pod-private-reply .button,
  .coach-pod-error .button {
    width: 100%;
  }

  .coach-pod-composer .form-grid,
  .coach-pod-receipts {
    grid-template-columns: 1fr;
  }

  .coach-pod-member-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .coach-pod-member-actions .button {
    width: 100%;
    padding-inline: 10px;
  }

  .coach-pod-management,
  .coach-pod-announcements {
    padding-bottom: max(24px, var(--fruit-up-safe-bottom, env(safe-area-inset-bottom)));
  }
}

@media (max-width: 410px) {
  .coach-pod-identity {
    grid-template-columns: 1fr;
  }

  .coach-pod-avatar-large {
    width: 64px;
    height: 64px;
  }

  .coach-pod-member-actions {
    grid-template-columns: 1fr;
  }

  .coach-pod-announcement summary {
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .coach-pod-announcement,
  .coach-pod-coach-announcement {
    scroll-behavior: auto;
    transition: none;
  }
}
