@layer components {
  .journey-rail { display: flex; overflow-x: auto; list-style: none; padding: .5rem 0; margin: 1rem 0; }
  .journey-marker { display: flex; flex: 1 0 36px; position: relative; min-height: 48px; align-items: center; justify-content: center; }
  .journey-marker:not(:last-child)::after { content: ""; position: absolute; top: 50%; left: calc(50% + 19px); right: calc(-50% + 19px); height: 1px; background: #697299; }
  .journey-marker a { display: grid; min-width: 48px; min-height: 48px; place-items: center; }
  .journey-marker a:focus-visible { outline: 2px solid var(--lilac); outline-offset: -2px; }
  .journey-marker-completed:not(.journey-marker-current) .care-phase-symbol { background: rgb(201 207 244 / 4%); color: rgb(201 207 244 / 38%); }
  .journey-marker-current .care-phase-symbol { background: var(--coral); color: white; outline: 3px solid #6c4550; outline-offset: 2px; }
  .journey-chapter { margin-block: 2rem; }
  .journey-chapter h2 { font-size: 1.6rem; }
  .journey-steps { list-style: none; padding: 0; margin: 1rem 0; }
  .journey-step { border-bottom: 1px solid var(--line-strong); scroll-margin-top: 1rem; }
  .journey-step-heading { display: flex; gap: 1rem; align-items: center; padding-block: 1rem; min-height: 48px; }
  summary.journey-step-heading { cursor: pointer; list-style: none; }
  .journey-step-details > summary::-webkit-details-marker { display: none; }
  .journey-step-heading > span:nth-child(2) { flex: 1; }
  .journey-step-details strong { font-size: 1.1rem; }
  .journey-step-details small { display: block; margin-top: .25rem; color: var(--muted); }
  .journey-step-current > .journey-step-details > .journey-step-heading strong, .journey-step-current > .journey-step-details > .journey-step-heading .journey-step-icon { color: var(--coral); }
  .journey-step-icon { flex: 0 0 32px; color: var(--periwinkle); }
  .journey-step-icon svg { width: 24px; height: 24px; }
  .journey-step-body { padding: 0 0 1.25rem 3rem; }
  .journey-step-body p + p { margin-top: .65rem; }
  .journey-step-details[open] > .journey-step-heading > .care-disclosure { transform: rotate(225deg); }
  .journey-instructions { white-space: pre-line; }
  .journey-history { border-top: 1px solid var(--line-strong); }
  .journey-history > summary { padding-block: 1rem; min-height: 48px; cursor: pointer; }
  .journey-editor { max-width: 1000px; margin-inline: auto; }
  .journey-editor > p, .journey-clinic > p { margin-block: 1rem; color: var(--muted); }
  .journey-editor fieldset { border: 0; border-top: 1px solid var(--line-strong); padding: 1.25rem 0; }
  .journey-editor legend { font-weight: 700; padding-right: 1rem; }
  .journey-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .journey-fields label { display: grid; gap: .4rem; }
  .journey-fields label > span { display: flex; align-items: center; gap: .6rem; min-height: 48px; }
  .journey-fields input[type="checkbox"] { width: 1.2rem; min-height: 1.2rem; padding: 0; margin: 0; flex: 0 0 auto; accent-color: var(--coral); }
  .journey-fields [hidden] { display: none; }
  .journey-wide { grid-column: 1 / -1; }
  .journey-clinic { margin-block: 2rem; padding-block: 1.5rem; border-block: 1px solid var(--line-strong); }
  .journey-clinic h2 { margin-bottom: .75rem; }
  .journey-clinic summary { min-height: 48px; padding-block: .75rem; cursor: pointer; }
  .journey-clinic form { margin-bottom: 1rem; }
  .journey-clinic .journey-fields { max-width: 760px; margin-block: 1rem; }
  .journey-patient-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
  .journey-patient-nav a { min-height: 48px; display: flex; align-items: center; text-decoration: underline; }
  @media (max-width: 600px) { .journey-fields { grid-template-columns: 1fr; } }
}

@layer components {
  .journey-timeline .journey-step { position: relative; border: 0; padding-bottom: .75rem; }
  .journey-timeline .journey-step:not(:last-child)::before { content: ""; position: absolute; left: 27px; top: 64px; bottom: -16px; width: 1px; background: var(--line-strong); }
  .journey-timeline .journey-step-heading { gap: .75rem; align-items: flex-start; }
  .journey-timeline-marker { flex: 0 0 56px; height: 56px; display: grid; place-items: center; color: var(--muted); background: transparent; position: relative; }
  .journey-timeline-marker svg { width: 24px; height: 24px; }
  .journey-timeline .journey-step-current .journey-timeline-marker { color: var(--coral); }
  .journey-step-title { min-width: 0; overflow-wrap: anywhere; }
  .journey-timeline .care-disclosure { margin-top: .7rem; flex-shrink: 0; }
  .journey-timeline .journey-step-body { padding: .25rem 0 1.25rem 3.25rem; }
  .journey-result-preview { display: block; margin-top: .4rem; font-size: .9375rem; }
  .journey-result-section, .journey-phase-instructions { margin-top: 1.5rem; }
  .journey-result-section h3, .journey-phase-instructions h3 { font: 700 1rem/1.4 var(--font-sans); margin-bottom: .75rem; }
  .journey-phase-instructions > summary { min-height: 48px; padding-block: .75rem; cursor: pointer; font-weight: 700; }
  .journey-result-fields { margin: .75rem 0; font-variant-numeric: tabular-nums; }
  .journey-result-fields > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; padding-block: .5rem; border-bottom: 1px solid var(--line); align-items: baseline; }
  .journey-result-fields dt { color: var(--muted); }
  .journey-result-fields dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
  .journey-result-fields dd small { font-size: .8rem; }
  .journey-embryos { list-style: none; padding: 0; }
  .journey-embryos > li { padding-block: 1rem; border-top: 1px solid var(--line-strong); }
  .journey-embryos header { display: flex; gap: .5rem 1rem; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
  .journey-embryos h4 { font: 700 1rem/1.4 var(--font-sans); margin: 0; overflow-wrap: anywhere; }
  .journey-embryos header > span { font-size: .875rem; color: var(--muted); }
  .journey-culture-day, .journey-study { border-bottom: 1px solid var(--line-strong); }
  .journey-culture-day > summary, .journey-study > summary { min-height: 48px; padding-block: .75rem; cursor: pointer; }
  .journey-study > summary > span { display: block; }
  .journey-timeline .journey-step-heading:focus-visible { outline: 3px solid var(--periwinkle); outline-offset: 3px; border-radius: 4px; }
  @media (max-width: 400px) {
    .journey-timeline .journey-step-body { padding-left: 2rem; }
    .journey-result-fields > div { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  }
}

@layer components {
  .journey-instruction-list { list-style: none; padding: 0; margin: 0; }
  .journey-instruction-row { padding-block: .875rem; border-bottom: 1px solid var(--line-strong); overflow-wrap: anywhere; }
  .journey-instruction-row .journey-instruction-name { display: block; font-size: 1rem; line-height: 1.4; }
  .journey-instruction-row p { margin: .25rem 0 0; }
  .journey-step-body .journey-instruction-row p + p { margin-top: .25rem; }
  .journey-instruction-meta { color: var(--muted); font-size: .875rem; }
  .journey-instruction-dose { font-variant-numeric: tabular-nums; }
  .journey-instruction-action { font-weight: 600; }
  .journey-instruction-notes > summary { cursor: pointer; color: var(--periwinkle); font-size: .875rem; padding-block: .625rem; min-height: 44px; }
  .journey-instruction-notes p { font-size: .9375rem; }
  .journey-instruction-notes .medication-catalog-source { display: block; }
  .journey-instruction-notes > summary:focus-visible { outline: 3px solid var(--periwinkle); outline-offset: 2px; }
}

@layer components {
  .journey-phase-link { color: var(--ink); text-decoration: none; border-radius: 12px; padding-inline: .5rem; margin-inline: -.5rem; }
  .journey-step-title strong { font: 700 1.1rem/1.35 var(--font-sans); }
  .journey-step-title small { display: block; color: var(--muted); margin-top: .3rem; }
  .journey-step-current > .journey-phase-link { background: var(--coral-soft, #FDEDE6); }
  .journey-step-chevron { flex: 0 0 24px; margin-top: .5rem; color: var(--muted); }
  .journey-sheet-dialog { position: fixed; inset: auto 0 0; width: min(100%, 44rem); max-width: 100%; max-height: 86dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 28px 28px 0 0; background: white; color: var(--ink); overscroll-behavior: contain; }
  .journey-sheet-dialog::backdrop { background: rgb(30 36 66 / 38%); }
  .journey-sheet-dialog[open] { animation: journey-sheet-enter 220ms cubic-bezier(.16, 1, .3, 1); }
  .journey-sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 12px auto 0; }
  .journey-sheet-close { position: sticky; top: 8px; display: grid; place-items: center; margin: 0 .5rem 0 auto; width: 48px; height: 48px; padding: 0; border: 0; background: white; color: var(--ink); border-radius: 50%; z-index: 1; }
  html.journey-sheet-document, html:has(> .journey-sheet-page) { background: white; }
  .journey-sheet-page { background: white; margin: 0; }
  .journey-sheet-page main { width: 100%; }
  .journey-phase-content { --journey-content-inset: 1.5rem; padding: .5rem var(--journey-content-inset) max(2rem, env(safe-area-inset-bottom)); color: var(--ink); overflow-wrap: anywhere; }
  .journey-phase-identity { display: flex; gap: 1rem; align-items: center; }
  .journey-phase-identity > div { min-width: 0; }
  .journey-phase-content > header h1 { font: 400 2rem/1.15 var(--font-serif); margin: 0 0 .5rem; }
  .journey-phase-content > header { margin-bottom: 1.5rem; }
  .journey-instruction-time { font-weight: 700; margin-bottom: .5rem !important; }
  .journey-phase-timing { display: flex; gap: 1rem; align-items: center; padding-block: 1rem; border-block: 1px solid var(--line-strong); margin-bottom: 1rem; }
  .journey-phase-timing svg { flex-shrink: 0; }
  .journey-instruction-notes { margin-top: 1rem; }
  .journey-sheet-back { display: inline-flex; align-items: center; min-height: 48px; margin: .5rem 1.5rem; }
  @media (hover: hover) and (pointer: fine) { .journey-phase-link:hover { background: var(--line); } }
  @media (prefers-reduced-motion: reduce) { .journey-sheet-dialog[open] { animation: none; } }
  @keyframes journey-sheet-enter { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
}

@layer components {
  .journey-instruction-month { margin-top: 2.5rem; }
  .journey-month-heading { font: 700 1.125rem/1.4 var(--font-sans); margin: 1.25rem 0 .25rem; text-transform: capitalize; }
  .journey-instruction-day { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; padding-block: 1.25rem; }
  .journey-instruction-day + .journey-instruction-day { margin-top: .5rem; }
  .journey-date-column { display: flex; flex-direction: column; gap: .125rem; font-variant-numeric: tabular-nums; }
  .journey-date-number { font: 400 2.5rem/1 var(--font-serif); }
  .journey-date-month { color: var(--periwinkle); font-size: .75rem; line-height: 1.4; text-transform: uppercase; letter-spacing: .06em; margin-top: .25rem; }
  .journey-date-year { color: var(--muted); font-size: .75rem; }
  .journey-instruction-day > .journey-instruction-list { border-left: 1px solid var(--line-strong); padding-left: 1rem; min-width: 0; }
  .journey-instruction-day .journey-instruction-row { padding: 0; border: 0; }
  .journey-instruction-day .journey-instruction-row + .journey-instruction-row { margin-top: 1.5rem; }
  .journey-instruction-day .journey-instruction-time { font-size: 1.25rem; line-height: 1.3; margin-top: 0; }
  .journey-instruction-day .journey-instruction-notes { margin-top: .75rem; color: var(--muted); }
  .journey-instruction-day-undated { grid-template-columns: minmax(0, 1fr); }
  .journey-instruction-day-undated > .journey-instruction-list { border: 0; padding-left: 0; }
  @media (max-width: 360px) {
    .journey-phase-content { --journey-content-inset: 1rem; }
    .journey-instruction-day { grid-template-columns: 3rem minmax(0, 1fr); gap: .75rem; }
    .journey-instruction-day > .journey-instruction-list { padding-left: .75rem; }
    .journey-instruction-day-undated { grid-template-columns: minmax(0, 1fr); }
  }
}

@layer components {

  .journey-ultrasound { --journey-date-width: 3.5rem; --journey-date-gap: 1rem; }
  .journey-ultrasound-summary { display: grid; grid-template-columns: var(--journey-date-width) minmax(0, 1fr); gap: var(--journey-date-gap); align-items: center; min-height: 48px; cursor: pointer; list-style: none; }
  .journey-ultrasound-summary::-webkit-details-marker { display: none; }
  .journey-ultrasound-summary:focus-visible { outline: 2px solid var(--periwinkle); outline-offset: 4px; }
  .journey-ultrasound-overview { display: flex; justify-content: space-between; align-items: center; gap: .75rem; font-size: .9375rem; color: var(--muted); }
  .journey-ultrasound[open] > summary .care-disclosure { transform: rotate(225deg); }
  .journey-ultrasound + .journey-ultrasound { margin-top: 2rem; }
  .journey-ultrasound-results { border-left: 1px solid var(--line-strong); padding-left: 1rem; min-width: 0; margin: 1rem 0 0 calc(var(--journey-date-width) + var(--journey-date-gap)); }
  .journey-ovary-result + .journey-ovary-result { margin-top: 1.5rem; }
  .journey-result-identity { display: flex; align-items: flex-start; gap: .5rem; }
  .journey-result-identity > img { flex-shrink: 0; }
  .journey-ovary-result h4 { font: 400 1.125rem/1.25 var(--font-serif); margin: 0; }
  .journey-ovary-result h4 span { display: block; margin-top: .25rem; font: 400 .8125rem/1.4 var(--font-sans); color: var(--muted); }
  .journey-follicle-measurements { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: .75rem 0 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
  .journey-follicle-measurements li { white-space: nowrap; font-size: .9375rem; }
  .journey-follicle-measurements li span { font-weight: 600; color: var(--periwinkle); }
  .journey-ultrasound-unmeasured { color: var(--muted); font-size: .8125rem; margin: .5rem 0 0; }
  .journey-endometrium-result { margin: 1.5rem 0 0; }
  .journey-endometrium-result dt { display: flex; align-items: center; gap: .5rem; font: 400 1.125rem/1.25 var(--font-serif); }
  .journey-endometrium-result dt img { flex-shrink: 0; }
  .journey-endometrium-result dd { margin: .5rem 0 0 2.5rem; font-weight: 600; font-size: 1.125rem; color: var(--periwinkle); font-variant-numeric: tabular-nums; }
  @media (max-width: 360px) {
    .journey-ultrasound { --journey-date-width: 3rem; --journey-date-gap: .75rem; }
    .journey-ultrasound-results { padding-left: .75rem; }
  }
}

@layer components {
  .journey-indications-group { margin-top: 2.75rem; }
  .journey-group-heading { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; margin: 0 0 1.5rem; background: var(--lilac-soft, #EDEFFC); color: var(--ink); font: 700 1.125rem/1.4 var(--font-sans); }
  .journey-group-heading > img { flex-shrink: 0; }
  .journey-phase-content .journey-group-heading { margin-inline: calc(-1 * var(--journey-content-inset)); padding-inline: var(--journey-content-inset); }
  .journey-indications-group > .journey-instruction-month:first-of-type { margin-top: 0; }
  .journey-indications-group .journey-month-heading { font-size: .9375rem; color: var(--muted); margin-top: 0; }
}
