/* account-messages.css: THE banner carousel at the top of the coach app (js/account-messages.js).
 *
 * The ChatGPT banner's light, playful look (css/chatgpt-intro.css), in the same place, at a
 * FIXED size: Alex, 23 Oct 2026, "We don't change the size of it, it just stays in that
 * area." The media box is a fixed 16:9 tile, the body is clamped, so a long message or a
 * video never makes the dashboard jump. Large plain text for 50+ coaches; phone first.
 * Themes: mint (default), peach, sky, plain. The sheets reuse .rel-editor (CBSheet).
 *
 * Since 24 Nov 2026 every banner in the slot is a card in one carousel (Alex: "like how Netflix has
 * banners or Amazon Prime has that main headline banner… You can almost see the countdown, and then it
 * flips to the next one"). Every card sits in the SAME grid cell (.amsg-slide), so the box is the
 * tallest card's and never changes between cards; only the card on show is visible. The controls
 * (Pause, the arrows, the dots, Not now, Past messages) sit over the card's bottom padding, bottom
 * right, where the arrows always were; the active dot stretches into a thin bar that fills over the
 * card's 8 seconds. */
.amsg-bar { margin: 0 0 18px; position: relative; }
.amsg-bar[hidden] { display: none !important; }
.amsg-slides { display: grid; grid-template-columns: minmax(0, 1fr); }
.amsg-slides.is-sliding { overflow: hidden; border-radius: var(--radius-lg, 18px); }
.amsg-slide { grid-area: 1 / 1; min-width: 0; display: flex; flex-direction: column; visibility: hidden; }
.amsg-slide.is-active, .amsg-slide.is-out { visibility: visible; }
.amsg-slide > .amsg-card { flex: 1 1 auto; }
/* Nothing on show, something closed: only "Past messages", small, where the banner would be. */
.amsg-bar.is-empty { margin: 0 0 8px; display: flex; justify-content: flex-end; }
.amsg-bar.is-empty .amsg-slides { display: none; }

.amsg-card {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "body actions";
  gap: 12px 22px; align-items: center; height: 176px; overflow: hidden; box-sizing: border-box;
  padding: 18px 56px 40px 20px; border-radius: var(--radius-lg, 18px); color: #1C1E26;
  border: 1px solid #CDEFE1; background: linear-gradient(100deg, #E8FAF2 0%, #F4FBF7 45%, #FFF4EC 100%);
}
.amsg-card.has-media { grid-template-columns: 200px minmax(0, 1fr) auto; grid-template-areas: "media body actions"; }
.amsg-theme-peach { background: linear-gradient(100deg, #FFF1E8 0%, #FFF8F2 55%, #FDF3FA 100%); border-color: #F6D9C6; }
.amsg-theme-sky { background: linear-gradient(100deg, #EAF3FF 0%, #F5F9FF 55%, #EEF8F6 100%); border-color: #CFE0F7; }
.amsg-theme-plain { background: #FFFFFF; border-color: #DDE4E1; }

.amsg-media {
  grid-area: media; position: relative; width: 200px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: #10171A; border: 0; padding: 0; display: block; align-self: center;
}
.amsg-media img, .amsg-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.amsg-play { cursor: pointer; }
.amsg-play-ic {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.amsg-play-ic::after {
  content: ""; position: absolute; left: 18px; top: 14px; border-style: solid; border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent #0B7A5E;
}
.amsg-play:focus-visible { outline: 3px solid #F5C451; outline-offset: 2px; }

.amsg-body { grid-area: body; min-width: 0; }
.amsg-badge {
  display: inline-block; margin: 0 0 6px; padding: 2px 10px; border-radius: 999px; border: 1px solid #9FE3C7;
  color: #0B6B53; background: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.amsg-title { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 800; color: #1C1E26; }
.amsg-text {
  margin: 4px 0 0; font-size: 16px; line-height: 1.45; color: #3F4350; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.amsg-count { margin: 8px 0 0; font-size: 15px; color: #3F4350; }
.amsg-count strong { display: inline-block; padding: 2px 10px; border-radius: 8px; background: #1C1E26; color: #fff; font-variant-numeric: tabular-nums; }

.amsg-actions { grid-area: actions; display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.amsg-go {
  min-height: 46px; padding: 0 22px; border: 0; border-radius: 12px; cursor: pointer; white-space: nowrap;
  background: #0B7A5E; color: #fff; font-size: 16px; font-weight: 700; box-shadow: 0 4px 12px rgba(11, 122, 94, 0.25);
}
.amsg-go:hover { background: #096A51; }
.amsg-go2 {
  min-height: 44px; padding: 0 18px; border-radius: 12px; cursor: pointer; white-space: nowrap;
  border: 1px solid #0B7A5E; background: #fff; color: #0B6B53; font-size: 15px; font-weight: 700;
}
.amsg-go:focus-visible, .amsg-go2:focus-visible, .amsg-arrow:focus-visible, .amsg-past:focus-visible { outline: 3px solid #F5C451; outline-offset: 2px; }

.amsg-close {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: #5B6070; font-size: 24px; line-height: 1; cursor: pointer;
}
.amsg-close:hover, .amsg-close:focus-visible { background: rgba(28, 30, 38, 0.07); color: #1C1E26; }
.amsg-close:focus-visible { outline: 3px solid #F5C451; outline-offset: 1px; }

/* Above the cards (z-index), over their bottom padding; the box under it is the bar, the card's own size. */
.amsg-foot { position: absolute; right: 16px; bottom: 8px; display: flex; align-items: center; gap: 4px; justify-content: flex-end; z-index: 3; }
.amsg-foot[hidden] { display: none; }
.amsg-bar.is-empty .amsg-foot { position: static; }
.amsg-arrow {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(28, 30, 38, 0.15); background: #fff;
  color: #1C1E26; font-size: 20px; line-height: 1; cursor: pointer;
}
.amsg-past { margin-left: 0; border: 0; background: transparent; color: #0B6B53; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 6px 4px; white-space: nowrap; }
.amsg-bar.is-empty .amsg-past { margin-left: 0; }
/* A small clock beside "Past messages", drawn in the link's own colour. */
.amsg-clock {
  display: inline-block; position: relative; width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px;
  border: 2px solid currentColor; border-radius: 50%; box-sizing: border-box;
}
.amsg-clock::before, .amsg-clock::after { content: ""; position: absolute; left: 50%; background: currentColor; border-radius: 1px; }
.amsg-clock::before { top: 1px; width: 1.5px; height: 4.5px; margin-left: -0.75px; }
.amsg-clock::after { top: 4.25px; width: 3.5px; height: 1.5px; margin-left: -0.75px; }

/* ── The rotation: Pause and the dots in the foot; the arrows either side of the banner ──
   The arrows sit half over the banner's left and right edges, at its middle (Prime Video's and Netflix's heroes),
   over the cards' side padding and into the page's gutter, so they never touch a card's words or its foot. */
.amsg-side {
  position: absolute; top: 50%; margin-top: -18px; z-index: 3; width: 36px; height: 36px; padding: 0 0 2px;
  box-shadow: 0 4px 12px rgba(28, 30, 38, 0.16);
}
.amsg-side:hover { background: #F4F6F5; }
.amsg-side-prev { left: -18px; }
.amsg-side-next { right: -18px; }
/* The page's gutter is 36px down to 769px wide (app-styles-v2.css .main-content) and 16px below, where a swipe pages. */
@media (max-width: 768px) {
  .amsg-side { display: none; }
}

.amsg-rot { display: inline-flex; align-items: center; gap: 4px; }
.amsg-pause {
  position: relative; width: 32px; height: 32px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(28, 30, 38, 0.15); background: #fff; color: #1C1E26;
}
.amsg-pause-ic { position: absolute; left: 50%; top: 50%; width: 10px; height: 12px; margin: -6px 0 0 -5px; }
.amsg-pause-ic::before, .amsg-pause-ic::after { content: ""; position: absolute; top: 0; width: 3px; height: 12px; border-radius: 1px; background: currentColor; }
.amsg-pause-ic::before { left: 1px; }
.amsg-pause-ic::after { right: 1px; }
/* Paused: the Play triangle. */
.amsg-pause.is-paused .amsg-pause-ic::before {
  left: 2px; width: 0; height: 0; border-radius: 0; background: transparent;
  border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor;
}
.amsg-pause.is-paused .amsg-pause-ic::after { display: none; }
.amsg-dots { display: inline-flex; align-items: center; }
/* Each dot is a 24px target (WCAG 2.5.8) around an 8px dot; the active one stretches into the countdown bar. */
.amsg-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 32px; padding: 0;
  border: 0; background: transparent; cursor: pointer;
}
.amsg-dot-bar {
  display: block; position: relative; width: 8px; height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(28, 30, 38, 0.28);
}
.amsg-dot:hover .amsg-dot-bar { background: rgba(28, 30, 38, 0.45); }
.amsg-dot.is-active { width: 36px; }
.amsg-dot.is-active .amsg-dot-bar { width: 28px; background: rgba(11, 122, 94, 0.22); }
.amsg-dot-fill {
  position: absolute; inset: 0; display: block; background: #0B7A5E; border-radius: inherit;
  transform: scaleX(0); transform-origin: left center;
}
.amsg-dot:not(.is-active) .amsg-dot-fill { visibility: hidden; }
.amsg-pause:focus-visible, .amsg-dot:focus-visible { outline: 3px solid #F5C451; outline-offset: 2px; }
/* "Not now" (24 Oct 2026): the soft choice beside the close, in Past messages' quiet link style, so
   the one strong button on the card stays the next step. */
.amsg-later { margin-right: 0; border: 0; background: transparent; color: #4A4F5C; font-size: 14px; text-decoration: underline; cursor: pointer; padding: 6px 4px; white-space: nowrap; }
.amsg-later:hover { color: #1C1E26; }
.amsg-later:focus-visible { outline: 3px solid #F5C451; outline-offset: 2px; }

/* ── The book-ahead card with the next times (cta sales_book with cta.times, js bookCardHtml; Alex, 10 Nov 2026:
   "This should all be about working with an expert… It could show the next two or three booking slots…
   some very gentle animations… nothing irritating"). Built from the live call card's parts (.amsg-face, its
   white ring and lavender, the green live dot and its amsgLive pulse, js CALL_CSS) and the ChatGPT banner's
   soft glow behind the marks (chatgpt-intro.css .cgi-bar), at the same fixed desktop size. The motion: the
   expert's dot pulses slowly and the card's edge breathes a soft glow every few seconds; both are shadows,
   so nothing in the layout moves, and neither plays under reduced motion. */
.amsg-card.amsg-book { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "body actions"; padding-top: 16px; padding-bottom: 16px; }
.amsg-card.amsg-book.has-expert { grid-template-columns: 128px minmax(0, 1fr) auto; grid-template-areas: "media body actions"; }
.amsg-book::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(200px 150px at 76px 50%, rgba(106, 76, 241, 0.14), transparent 70%),
    radial-gradient(260px 160px at 100% 50%, rgba(16, 163, 127, 0.12), transparent 70%);
}
.amsg-book > .amsg-expert, .amsg-book > .amsg-body, .amsg-book > .amsg-actions { position: relative; z-index: 1; }
.amsg-book > .amsg-close, .amsg-book > .amsg-foot { z-index: 2; }

.amsg-expert { grid-area: media; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.amsg-expert-pic { position: relative; display: inline-block; }
.amsg-expert .amsg-face { width: 68px; height: 68px; font-size: 24px; box-shadow: 0 0 0 3px #fff, 0 8px 20px rgba(106, 76, 241, 0.28); }
.amsg-expert .amsg-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.amsg-expert-dot {
  position: absolute; right: 1px; bottom: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #1c8e5a; box-shadow: 0 0 0 3px #fff;
}
.amsg-expert-who { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.amsg-expert-name { font-size: 16px; font-weight: 800; color: #1C1E26; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amsg-expert-line { font-size: 13px; color: #4A4F5C; line-height: 1.3; }

.amsg-book .amsg-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* The times column starts at the top and stops short of the foot (Not now, the arrows, Past messages, which sit
   bottom right, 8px up and 32px tall), so "See other times" never touches them: 16 + 18.2 + 6 + 54 + 6 + 26 = 126px,
   10px clear of the foot at 136px. tests/account-messages-book-times.test.js adds it up from these rules. */
.amsg-times { gap: 6px; align-self: start; padding-bottom: 0; }
.amsg-times-label { margin: 0; font-size: 14px; font-weight: 700; color: #0B6B53; line-height: 1.3; white-space: nowrap; }
.amsg-zone { font-weight: 600; color: #4A4F5C; }
.amsg-slots { display: grid; grid-template-columns: repeat(3, 112px); gap: 8px; }
.amsg-slot {
  min-height: 54px; padding: 5px 8px; border-radius: 12px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid #9FE3C7; background: #fff; color: #1C1E26; font: inherit;
  box-shadow: 0 4px 12px rgba(11, 122, 94, 0.12); transition: background-color 0.15s, border-color 0.15s;
}
.amsg-slot-day { font-size: 13px; line-height: 1.25; color: #3F4350; white-space: nowrap; }
.amsg-slot-time { font-size: 17px; line-height: 1.2; font-weight: 800; color: #0B6B53; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amsg-slot:hover { background: #E8FAF2; border-color: #0B7A5E; }
.amsg-other {
  align-self: flex-start; min-height: 26px; padding: 2px 2px; border: 0; line-height: 1.2; background: transparent; cursor: pointer;
  color: #0B6B53; font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.amsg-other:hover { color: #096A51; }
.amsg-slot:focus-visible, .amsg-other:focus-visible { outline: 3px solid #F5C451; outline-offset: 2px; }

/* The expert's dot pulses as the live call card's does (its amsgLive ring, on a layer of its own so the dot keeps
   its white edge), only slower; the card's edge breathes a soft green glow. Both are shadows: nothing moves. */
.amsg-expert-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) {
  .amsg-book .amsg-expert-dot::after { animation: amsgLive 3.2s ease-out infinite; }
  .amsg-card.amsg-book { animation: amsgGlow 5s ease-in-out infinite; }
}
@keyframes amsgGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 163, 127, 0); }
  50% { box-shadow: 0 0 0 4px rgba(16, 163, 127, 0.12), 0 10px 28px -10px rgba(16, 163, 127, 0.45); }
}

/* The sheets: .rel-editor, a little wider for a video or a booking page. */
.amsg-sheet { width: min(560px, calc(100vw - 32px)); }
.amsg-sheet-wide { width: min(920px, calc(100vw - 32px)); }
.amsg-sheet-body { max-height: calc(100vh - 160px); overflow: auto; }
.amsg-frame { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: #10171A; }
.amsg-frame-video { aspect-ratio: 16 / 9; }
.amsg-frame-tall { height: min(680px, calc(100vh - 220px)); background: #fff; }
.amsg-frame iframe, .amsg-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.amsg-sheet-note { margin: 10px 0 0; font-size: 14px; }
.amsg-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.amsg-hist-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #ECEFEE; }
.amsg-hist-main { min-width: 0; }
.amsg-hist-title { margin: 0; font-weight: 700; font-size: 16px; }
.amsg-hist-text { margin: 4px 0 0; font-size: 15px; color: #3F4350; white-space: pre-line; }
.amsg-hist-when { margin: 4px 0 0; font-size: 13px; color: #5B6070; }
.amsg-hist-acts { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }

/* At 1100px and below the app's menu button sits fixed top right (chatgpt-intro.css). */
@media (max-width: 1100px) {
  .amsg-close { right: 60px; }
  .amsg-card { padding-right: 108px; }
}
/* On a phone the cards stack and grow; the controls take the bottom row of the card, Pause and the dots on
   the left (a swipe pages, so the side arrows step aside), Not now and Past messages on the right. */
@media (max-width: 760px) {
  /* align-content: a card shorter than the tallest one keeps its parts together, centred in the shared box. */
  .amsg-card, .amsg-card.has-media {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "body" "actions";
    height: auto; min-height: 0; padding: 16px; padding-top: 52px; padding-bottom: 58px; align-content: center;
  }
  .amsg-foot { left: 16px; right: 16px; bottom: 12px; justify-content: flex-end; }
  .amsg-rot { margin-right: auto; }
  .amsg-text { -webkit-line-clamp: 4; }
  .amsg-media { width: 100%; max-height: 140px; }
  .amsg-close { right: 60px; top: 8px; }
  .amsg-title { font-size: 19px; }
  .amsg-later, .amsg-past { white-space: nowrap; margin-left: 0; margin-right: 0; }
  .amsg-hist-row { flex-direction: column; }
  .amsg-bar.is-empty .amsg-foot { left: auto; right: auto; }
}

/* The book-ahead card by the width the banner actually has (the subnav takes 220px beside some pages, so the
   window's width does not say it): under 1000px the expert column tightens and two times show, so the words
   keep two whole lines at the fixed height; under 780px (a tablet held upright) the times go under the
   words, all three again, and the card grows to fit. A browser without container queries keeps the wide
   layout. On a phone everything stacks: the expert in a row on top, the three times side by side and
   "See other times" a full-width button under them. */
.amsg-bar { container: amsg / inline-size; }
@container amsg (max-width: 999px) {
  .amsg-card.amsg-book.has-expert { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px 18px; }
  .amsg-book .amsg-expert-line { font-size: 12.5px; }
  .amsg-slots { grid-template-columns: repeat(2, 108px); }
  .amsg-slot:nth-child(n+3) { display: none; }
}
@container amsg (max-width: 779px) {
  /* The book-ahead card grows here, so every card goes to its height: the box never changes between cards. */
  .amsg-slides .amsg-card { height: auto; min-height: 176px; align-content: center; }
  .amsg-card.amsg-book { grid-template-columns: minmax(0, 1fr); grid-template-areas: "body" "actions"; height: auto; padding-bottom: 52px; }
  .amsg-card.amsg-book.has-expert { grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "media body" "media actions"; }
  .amsg-expert { align-self: start; padding-top: 8px; }
  .amsg-times { justify-self: start; padding-bottom: 0; }
  .amsg-slots { grid-template-columns: repeat(3, 108px); }
  .amsg-slot:nth-child(n+3) { display: flex; }
  /* The card grows here, so the title is shown in full (it is up to 120 characters). */
  .amsg-book .amsg-title { display: block; -webkit-line-clamp: unset; overflow: visible; }
}
@media (max-width: 760px) {
  .amsg-card.amsg-book, .amsg-card.amsg-book.has-expert {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "body" "actions";
    height: auto; gap: 14px; padding: 52px 16px 58px;
  }
  .amsg-card.amsg-book.has-expert { padding-top: 16px; }
  /* Full width less the close and the menu button, so a long first name ends in an ellipsis before the close. */
  .amsg-expert { flex-direction: row; justify-self: stretch; min-width: 0; text-align: left; gap: 12px; padding-right: 92px; }
  .amsg-expert-pic { flex: 0 0 auto; }
  .amsg-expert-who { flex: 1 1 auto; }
  .amsg-expert .amsg-face { width: 56px; height: 56px; font-size: 20px; }
  .amsg-expert-dot { right: 0; bottom: 1px; width: 12px; height: 12px; }
  .amsg-expert-name { font-size: 17px; }
  .amsg-book .amsg-expert-line { font-size: 14px; }
  .amsg-book::before { background: radial-gradient(180px 140px at 44px 44px, rgba(106, 76, 241, 0.16), transparent 70%); }
  .amsg-times { align-self: stretch; justify-self: stretch; padding-bottom: 0; }
  .amsg-times-label { white-space: normal; }
  .amsg-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .amsg-slot { min-height: 60px; padding: 6px 4px; }
  .amsg-slot-day { font-size: 13px; }
  .amsg-slot-time { font-size: 16px; }
  .amsg-other {
    align-self: stretch; min-height: 46px; border: 1px solid #0B7A5E; border-radius: 12px; background: #fff;
    text-decoration: none; box-shadow: 0 4px 12px rgba(11, 122, 94, 0.12);
  }
}
