html.fd-story-open { overflow: hidden; }

#first-day-story {
  --fd-ink: #2b222c;
  --fd-rule: #e6dcd6;
  --fd-gutter: clamp(18px, 5vw, 28px);
  --fd-accent: #a02953;
  position: fixed;
  inset: 0;
  width: min(438px, calc(100% - 24px));
  height: min(674px, calc(100vh - 30px));
  height: min(674px, calc(100dvh - 30px));
  max-width: none;
  max-height: none;
  padding: 0;
  margin: auto;
  overflow: hidden;
  border: 1px solid #fffcf9;
  border-radius: 26px;
  background: #fffcf9;
  color: var(--fd-ink);
  box-shadow: 0 20px 90px #1b0e2759;
  text-align: start;
  overscroll-behavior: contain;
}
#first-day-story[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
#first-day-story::backdrop { background: #211924b8; backdrop-filter: blur(5px); }
#first-day-story button { font: inherit; }
#first-day-story button:focus-visible { outline: 3px solid var(--fd-accent); outline-offset: 2px; }
#first-day-story .fd-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#first-day-story .fd-header { padding: 9px var(--fd-gutter) 14px; }
#first-day-story .fd-topline { display: flex; align-items: center; gap: 9px; min-height: 43px; }
#first-day-story .fd-brand { flex: none; width: 24px; height: 26px; object-fit: contain; }
#first-day-story .fd-topline h2 { flex: 1; font-size: 15px; font-weight: 750; line-height: 1.25; letter-spacing: -.025em; }
#first-day-story .fd-count {
  flex: none;
  color: #765e66;
  font: 600 11px/1.2 ui-monospace, monospace;
  letter-spacing: .07em;
}
#first-day-story .fd-close {
  display: grid;
  place-content: center;
  width: 44px;
  height: 44px;
  margin-inline-end: -9px;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--fd-ink);
}
#first-day-story .fd-close span {
  display: grid;
  place-content: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--fd-rule);
  border-radius: 50%;
  font: 23px/1 Arial, sans-serif;
}
#first-day-story .fd-close:hover span { background: #f4ebe5; }
#first-day-story .fd-progress { display: flex; gap: 4px; margin-top: 5px; }
#first-day-story .fd-progress i { flex: 1; height: 3px; border-radius: 3px; background: #e9dfd9; }
#first-day-story .fd-progress .fd-filled { background: var(--fd-accent); }

#first-day-story .fd-page { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
#first-day-story .fd-art {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(158px, 33vh, 275px);
  height: clamp(158px, 33dvh, 275px);
  margin: 0 10px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 15px;
  background: #f4e4db;
}
#first-day-story .fd-art > img { width: 100%; height: 100%; object-fit: cover; }
#first-day-story .fd-copy { padding: clamp(17px, 3.1vh, 27px) var(--fd-gutter) 20px; }
#first-day-story .fd-copy h3 {
  margin: 0 0 10px;
  color: var(--fd-ink);
  font-size: clamp(25px, 3.7vh, 36px);
  line-height: 1.1;
  letter-spacing: -.05em;
  overflow-wrap: break-word;
}
#first-day-story .fd-copy h3:focus { outline: none; }
#first-day-story .fd-body { margin: 0; color: #544750; font-size: 15px; line-height: 1.55; }

/* A conversation cue precedes the question; the final page revisits the day's three scenes. */
#first-day-story[data-screen="4"] .fd-art {
  height: clamp(85px, 17vh, 142px);
  background: linear-gradient(120deg, #f8e9de, #f5d3dc);
}
#first-day-story .fd-bubble {
  position: absolute;
  width: clamp(58px, 10vh, 80px);
  aspect-ratio: 1.55;
  border-radius: 18px;
  box-shadow: 0 8px 13px #822b4624;
}
#first-day-story .fd-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  inset-inline-start: 12px;
  width: 14px;
  height: 14px;
  background: inherit;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
#first-day-story .fd-bubble-back { background: #c64e70; transform: translate(-31%, -21%) rotate(-11deg); }
#first-day-story .fd-bubble-front {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #fffaf5;
  transform: translate(29%, 13%) rotate(7deg);
}
#first-day-story .fd-bubble-front i { width: 6px; height: 6px; border-radius: 50%; background: #ad4663; }
#first-day-story[data-screen="5"] .fd-art {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 20px 9%;
  background: linear-gradient(145deg, #eee4e5, #f7ecd9);
}
#first-day-story[data-screen="5"] .fd-art img {
  width: 126%;
  max-width: none;
  height: 76%;
  border: 4px solid #fffaf6;
  border-bottom-width: 12px;
  box-shadow: 0 5px 14px #503b4026;
  transform: rotate(-9deg) translateY(3%);
}
#first-day-story[data-screen="5"] .fd-art img:nth-child(2) { z-index: 1; transform: rotate(2deg) translateY(-5%); }
#first-day-story[data-screen="5"] .fd-art img:nth-child(3) { transform: rotate(10deg) translateY(4%); }

#first-day-story .fd-answers { display: grid; gap: 8px; margin-top: 16px; }
#first-day-story .fd-answers button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #cebfc3;
  border-radius: 12px;
  background: #fff;
  color: var(--fd-ink);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 650;
  text-align: start;
}
#first-day-story .fd-answers button::before { content: ''; flex: none; width: 14px; height: 14px; border: 1.5px solid #97848d; border-radius: 50%; }
#first-day-story .fd-answers button:hover:not([aria-disabled="true"]) { border-color: var(--fd-accent); }
#first-day-story .fd-answers button[aria-pressed="true"] { border-color: #b26064; background: #fff1ec; }
#first-day-story .fd-answers button[aria-pressed="true"]::before { border: 4px solid #a34652; }
#first-day-story .fd-answers button[aria-disabled="true"] { cursor: default; }
#first-day-story .fd-answers button[aria-disabled="true"][aria-pressed="true"] { border-color: #719486; background: #eef6ef; }
#first-day-story .fd-answers button[aria-disabled="true"][aria-pressed="true"]::before { border-color: #436c5b; }
#first-day-story .fd-feedback { color: #97394c; font-size: 13px; font-weight: 650; line-height: 1.45; }
#first-day-story .fd-feedback:not(:empty) { margin-top: 11px; }
#first-day-story .fd-feedback[data-correct="true"] { color: #355e4d; }

#first-day-story .fd-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--fd-gutter) 16px;
  border-top: 1px solid var(--fd-rule);
  background: #fffcf9;
}
#first-day-story .fd-nav button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 0;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
}
#first-day-story .fd-back { padding: 7px 0; background: transparent; color: #675662; }
#first-day-story .fd-back:hover { color: var(--fd-accent); }
#first-day-story .fd-next { margin-inline-start: auto; padding: 9px 20px; background: var(--fd-ink); color: #fff; }
#first-day-story .fd-next:hover:enabled { background: #513242; }
#first-day-story .fd-next:disabled { color: #705f67; background: #e8dedc; cursor: default; }
#first-day-story .fd-next-icon, #first-day-story .fd-back span:first-child { font-size: 19px; line-height: .9; }

@media (max-height: 535px) {
  #first-day-story { height: calc(100vh - 12px); height: calc(100dvh - 12px); border-radius: 18px; }
  #first-day-story .fd-header { padding-block: 1px 7px; }
  #first-day-story .fd-progress { margin-top: 0; }
  #first-day-story .fd-art, #first-day-story[data-screen="4"] .fd-art { height: 84px; }
  #first-day-story[data-screen="5"] .fd-art { padding-block: 4px; }
  #first-day-story .fd-copy { padding-block: 12px; }
  #first-day-story .fd-nav { padding-block: 5px; }
}
@media (min-width: 520px) and (max-height: 535px) {
  #first-day-story { width: min(700px, calc(100% - 22px)); }
  #first-day-story .fd-page {
    display: grid;
    grid-template-columns: minmax(0, .32fr) minmax(0, .68fr);
    align-items: start;
  }
  #first-day-story .fd-art, #first-day-story[data-screen="4"] .fd-art {
    position: sticky;
    top: 0;
    height: calc(100vh - 129px);
    height: calc(100dvh - 129px);
    margin: 0 4px 0 10px;
  }
  #first-day-story .fd-copy { padding: 4px 18px 14px 12px; }
  #first-day-story .fd-answers { margin-top: 9px; }
  #first-day-story[data-screen="5"] .fd-art img { height: 55%; }
}
@media (forced-colors: active) {
  #first-day-story .fd-progress i { border: 1px solid GrayText; }
  #first-day-story .fd-progress .fd-filled { background: Highlight; forced-color-adjust: none; }
  #first-day-story .fd-nav button { border: 1px solid ButtonText; }
}
