/* Course cards, the registration journey, books, student course pieces and the
   matching administrator screens. */

/* The statement that keeps books and courses apart ------------------------- */

.keep-apart { border-radius: var(--r-lg); display: flex; gap: var(--s4); align-items: flex-start; margin: var(--s5) 0; padding: var(--s4) var(--s5); background: var(--ochre-soft); border-left: 3px solid var(--ochre); color: #3a2806; max-width: 56rem; }
.keep-apart p { margin: 0; font-weight: 500; line-height: 1.55; }
.keep-apart-mark { flex: none; color: var(--ochre); margin-top: 0.15rem; }
.keep-apart-mark .icon { width: 1.3rem; height: 1.3rem; }
.keep-apart-compact { padding: var(--s3) var(--s4); font-size: var(--fs-sm); }

.launch-page .lede { margin-bottom: var(--s4); }
.launch-page .button-row { margin-block: var(--s5) var(--s4); }
.launch-page .contact { margin-top: var(--s5); }

/* Course cards: the free preview set apart, the paid courses side by side. */

.year-5 { --accent-year: #0f6b53; }
.year-6 { --accent-year: #294260; }

.options { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 0.85fr) repeat(2, minmax(0, 1fr)); gap: var(--s5); align-items: stretch; }
.option { position: relative; display: flex; flex-direction: column; min-width: 0; padding: var(--s6) var(--s5) var(--s5); border-radius: var(--r-xl); background: #fff; border: 1px solid var(--cream-line); color: var(--ink); text-align: left; }
.option-course { border-top: 4px solid var(--accent-year); box-shadow: 0 18px 36px -30px rgb(20 35 58 / 0.55); }
.option-free { background: var(--cream); margin-right: var(--s3); }
.option h2, .option h3 { font: 600 1.55rem/1.2 var(--font-editorial); margin-bottom: var(--s1); }
.option-for { color: var(--ink-2); font-size: var(--fs-sm); margin-bottom: var(--s3); }
.option-flag { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0 0 var(--s3); font-size: var(--fs-sm); }
.option-flag strong { padding: 0.2rem 0.6rem; border-radius: var(--r-xs); background: var(--emerald); color: #fff; letter-spacing: 0.02em; }
.option-flag span { font-weight: 600; color: var(--emerald); }
.cost { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); margin: 0; font-variant-numeric: tabular-nums; }
.cost strong { font: 600 2.9rem/1.05 var(--font-editorial); letter-spacing: -0.025em; }
.cost del { font: 500 1.6rem/1 var(--font-editorial); color: var(--was); text-decoration-thickness: 2px; }
.cost-saving { font-size: var(--fs-sm); font-weight: 700; color: var(--was); }
.option-term { font-size: var(--fs-sm); color: var(--ink-3); margin: var(--s1) 0 0; }
.option-list { list-style: none; padding: var(--s4) 0 0; margin: var(--s4) 0 var(--s5); border-top: 1px solid var(--cream-line); display: grid; gap: var(--s2); font-size: var(--fs-base); }
.option-list li { display: flex; gap: var(--s3); align-items: flex-start; color: var(--ink-2); }
.option-list .icon { color: var(--emerald); margin-top: 0.25rem; }
.option-note { font-size: var(--fs-sm); color: var(--ink-2); }
.option > .button { margin-top: auto; }
.button.option-wait, .button.option-wait:disabled { opacity: 1; background: #e7e8e4; border-color: #d3d6d0; color: #3f4a5a; cursor: not-allowed; transform: none; }
.options-terms { display: flex; justify-content: center; gap: var(--s3); margin: var(--s5) auto 0; max-width: 48rem; font-size: var(--fs-sm); color: var(--ink-2); }
.options-terms .icon { width: 1.25rem; height: 1.25rem; color: var(--ochre); margin-top: 0.15rem; }
.options-preview { grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 19rem)); margin-top: var(--s4); font-size: var(--fs-base); }

/* The registration journey --------------------------------------------------- */

.journey { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); gap: clamp(var(--s6), 4vw, 4rem); align-items: start; }
.summary { position: sticky; top: 6rem; padding: var(--s6); border-radius: var(--r-xl); background: var(--cream); color: var(--ink-2); border: 1px solid var(--cream-line); view-transition-name: order-summary; }
.summary-label { font-weight: 600; font-size: var(--fs-sm); color: var(--emerald); margin-bottom: var(--s2); }
.summary-title { font-family: var(--font-editorial); font-size: 1.5rem; color: var(--ink); margin-bottom: var(--s2); }
.summary-total { font-family: var(--font-editorial); font-size: 3rem; line-height: 1; color: var(--ink); margin-bottom: var(--s1); font-variant-numeric: tabular-nums; }
.summary-total del { font-size: 1.5rem; color: var(--was); }
.summary-kind { font-size: var(--fs-sm); font-weight: 700; color: var(--emerald); }
.summary dl { margin: var(--s5) 0; border-top: 1px solid var(--cream-line); }
.summary dl > div { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--cream-line); font-size: var(--fs-sm); }
.summary dd { margin: 0; font-weight: 700; color: var(--ink); text-align: right; }
.summary .fine { color: var(--ink-2); margin: var(--s3) 0 0; }

/* The journey --------------------------------------------------------------- */

.stepper { margin-bottom: var(--s7); view-transition-name: stepper; }
.stepper progress { appearance: none; -webkit-appearance: none; width: 100%; height: 3px; border: 0; background: var(--paper-line); display: block; }
.stepper progress::-webkit-progress-bar { background: var(--paper-line); }
.stepper progress::-webkit-progress-value { background: var(--emerald); transition: width 0.5s var(--spring); }
.stepper progress::-moz-progress-bar { background: var(--emerald); }
.stepper ol { list-style: none; display: flex; justify-content: space-between; gap: var(--s2); margin: var(--s3) 0 0; padding: 0; }
.stepper li { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--ink-3); }
.stepper-node { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid #8a97a8; font-size: var(--fs-xs); font-weight: 700; }
.stepper li.is-done .stepper-node { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.stepper li.is-current { color: var(--ink); font-weight: 700; }
.stepper li.is-current .stepper-node { background: var(--ink); border-color: var(--ink); color: #fff; }
.stepper-count { display: none; font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--s2); }

.journey fieldset { border: 0; padding: 0; margin: 0 0 var(--s5); display: grid; gap: var(--s4); min-width: 0; }
.journey legend { font-family: var(--font-editorial); font-size: 1.35rem; padding: 0; margin-bottom: var(--s3); }
.journey input:not([type='checkbox']):not([type='radio']), .journey select { transition: border-color 0.2s, box-shadow 0.25s var(--spring); }
.journey input:focus, .journey select:focus { box-shadow: 0 0 0 4px rgb(52 211 153 / 0.25); }
.journey input:user-invalid { border-color: var(--bad); }
.choice-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-cards legend { grid-column: 1 / -1; }
.choice-card { display: flex; gap: var(--s3); padding: var(--s4); border: 1px solid #8a97a8; border-radius: var(--r-lg); cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.choice-card input { accent-color: var(--emerald); width: 1.15rem; height: 1.15rem; flex: none; margin-top: 0.2rem; }
.choice-card small { display: block; color: var(--ink-3); }
.choice-card:has(input:checked) { border-color: var(--emerald); background: var(--mint); box-shadow: inset 0 0 0 1px var(--emerald); }
.signed-in-as { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); background: var(--mint); border-radius: var(--r-lg); }
/* A student buying for themselves has no separate buyer to describe. */
.details-form:has(input[name='buyer'][value='student']:checked) .buyer-fields { display: none; }
.honey { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@supports selector(:has(a)) {
  .guardian-fields { display: none; }
  form:has(select[name='age'] option[value='under16']:checked) .guardian-fields { display: block; }
}

.books-step { max-width: 46rem; margin-bottom: var(--s7); }
.recommend { margin-top: var(--s8); scroll-margin-top: 6rem; }

.review-card { border: 1px solid var(--paper-line); border-radius: var(--r-lg); padding: var(--s5); margin-bottom: var(--s4); }
.review-card header { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); }
.review-card h2 { font-family: var(--font-editorial); font-weight: 500; font-size: 1.35rem; }
.review-card > :last-child { margin-bottom: 0; }
.consent-form { margin-top: var(--s6); }
.consent-optional { padding: var(--s4) var(--s5); border: 1px dashed #8a97a8; border-radius: var(--r-lg); }
.pay-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s5); border-radius: var(--r-lg); background: var(--mint); border: 1px solid #bfe6d4; }
.pay-bar p { margin: 0; }
.pay-bar p span, .pay-bar p small { display: block; font-size: var(--fs-sm); color: var(--ink-2); }
.pay-bar strong { font-family: var(--font-editorial); font-weight: 500; font-size: 2.4rem; line-height: 1.1; }

.result { max-width: 40rem; margin: var(--s7) auto; text-align: center; }
.result .lede { margin-inline: auto; }
.result .button-row { justify-content: center; }
.receipt { text-align: left; padding: var(--s2) var(--s5); border: 1px solid var(--paper-line); border-radius: var(--r-lg); }
.next-step { margin-top: var(--s6); }
.success-mark svg { width: 5rem; height: 5rem; fill: var(--mint); stroke: var(--emerald); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; margin-bottom: var(--s4); }
.success-mark path { fill: none; stroke-width: 5; stroke-dasharray: 60; }
.loader { display: inline-block; width: 3.5rem; height: 3.5rem; margin-bottom: var(--s4); border-radius: 50%; border: 3px solid var(--paper-line); border-top-color: var(--emerald); animation: spin 0.9s linear infinite; }
@media (prefers-reduced-motion: no-preference) {
  body:not([data-motion='off']) .success-mark path { animation: draw 0.8s 0.2s var(--spring) both; }
  body:not([data-motion='off']) .success-mark svg { animation: pop 0.6s var(--spring) both; }
}
@keyframes draw { from { stroke-dashoffset: 60; } }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
@keyframes settle { from { opacity: 0.2; transform: translateY(6px); } }
.is-changing { animation: settle 0.4s var(--spring); }
body[data-motion='off'] .is-changing { animation: none; }

/* Books --------------------------------------------------------------------- */

.books-head { margin-bottom: var(--s7); }
.books-head .keep-apart { margin-bottom: 0; background: #fff; }
.book-filter { margin-bottom: var(--s6); }
.books-empty { max-width: 40rem; }

/* A book: the real cover with page edges and a spine shadow around it. */
.volume { --w: 9.5rem; width: var(--w); perspective: 900px; flex: none; }
.volume-sm { --w: 5rem; }
.volume-md { --w: 10.5rem; }
.volume-lg { --w: min(18rem, 66vw); }
.volume-body { position: relative; aspect-ratio: 2 / 3; transform-style: preserve-3d; transform: rotateY(-14deg); transition: transform 0.45s var(--ease); border-radius: 1px 3px 3px 1px; box-shadow: 16px 20px 30px -18px rgb(20 35 58 / 0.6); background: var(--navy-900); }
.volume-body::before { content: ''; position: absolute; top: 1.5%; bottom: 1.5%; right: -9px; width: 10px; background: repeating-linear-gradient(90deg, #f6f5f0 0 1px, #d3d1c6 1px 2px); transform: rotateY(55deg); transform-origin: left; }
.volume-body::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, rgb(0 0 0 / 0.26), transparent 6%, rgb(255 255 255 / 0.14) 8%, transparent 13%); pointer-events: none; }
.volume img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.volume-pending { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 14% 12%; color: #eef6f3; border-radius: inherit; background: var(--navy-900); }
.volume-pending span { font-family: var(--font-editorial); font-size: calc(var(--w) * 0.115); line-height: 1.15; overflow-wrap: anywhere; }
.volume-pending small { font-size: var(--fs-xs); color: #b4c8da; }
a:hover > .volume, .volume:hover .volume-body { transform: rotateY(-4deg); }

/* A book presented as a product. */
.showcase { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(var(--s6), 5vw, var(--s9)); align-items: start; padding-block: var(--s7); border-top: 1px solid var(--paper-line); }
.showcase-art { display: grid; place-items: center; align-self: stretch; padding: var(--s8) var(--s5); background: var(--paper); border-radius: var(--r-xl); align-content: center; }
.showcase-art > a { text-decoration: none; color: inherit; }
.showcase-text { min-width: 0; }
.showcase-title { font: 500 clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem)/1.12 var(--font-editorial); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.showcase-title a { color: inherit; text-decoration: none; }
.showcase-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.showcase-description { color: var(--ink-2); max-width: 40em; white-space: pre-line; }
.showcase-facts { margin: var(--s5) 0 0; border-top: 1px solid var(--paper-line); }
.showcase-facts > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--paper-line); font-size: var(--fs-sm); }
.showcase-facts dt { font-weight: 700; }
.showcase-facts dd { margin: 0; color: var(--ink-2); }
.showcase-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); margin: 0; }
.showcase-contents { margin-top: var(--s7); }
.showcase-contents h2 { font: 600 1.4rem/1.3 var(--font-editorial); }
.showcase-contents ul { padding: 0; list-style: none; border-top: 1px solid var(--paper-line); }
.showcase-contents li { padding: var(--s2) 0; border-bottom: 1px solid var(--paper-line); color: var(--ink-2); }

.formats { list-style: none; padding: 0; margin: var(--s6) 0 var(--s4); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--wash-line); border-radius: var(--r-xl); background: #fff; }
.formats-1 { grid-template-columns: minmax(0, 1fr); max-width: 24rem; }
.formats li { display: flex; flex-direction: column; padding: var(--s5); min-width: 0; }
.formats li + li { border-left: 1px solid var(--wash-line); }
.format-name { display: flex; align-items: center; gap: var(--s2); margin: 0; font-weight: 700; }
.format-price { margin: var(--s2) 0; font: 500 2.4rem/1.1 var(--font-editorial); font-variant-numeric: tabular-nums; }
.format-price span { font-size: 1.25rem; }
.format-text { color: var(--ink-2); font-size: var(--fs-sm); }
.formats .button { margin-top: auto; }

.book-detail > * + * { margin-top: var(--s8); }
.book-detail .showcase { margin-top: var(--s4); }

.samples { scroll-margin-top: 6rem; padding-top: var(--section); }
.book-detail .samples { padding-top: 0; }
.samples ul { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 44%), 1fr)); gap: var(--s5); }
.samples figure { margin: 0; }
.samples a { display: block; border: 1px solid var(--paper-line); background: var(--paper); cursor: zoom-in; transition: border-color var(--t), box-shadow var(--t); }
.samples a:hover { border-color: var(--emerald); box-shadow: 0 12px 24px -18px rgb(20 35 58 / 0.45); }
.samples img { display: block; width: 100%; height: auto; aspect-ratio: 400 / 565; object-fit: contain; }
.samples figcaption { margin-top: var(--s2); font-size: var(--fs-sm); color: var(--ink-2); }
.zoom-dialog { width: min(56rem, calc(100vw - 1rem)); max-height: calc(100dvh - 1rem); }
.zoom-dialog figure { margin: 0; padding: var(--s3); text-align: center; }
.zoom-dialog img { max-width: 100%; max-height: calc(100dvh - 13rem); width: auto; height: auto; }
.zoom-dialog figcaption { padding-top: var(--s3); font-size: var(--fs-sm); }

.buying h2, .buying h3 { font: 600 1.6rem/1.25 var(--font-editorial); }
.buying ol { list-style: none; counter-reset: buy; padding: 0; margin: var(--s4) 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); }
.buying li { counter-increment: buy; border-top: 2px solid var(--wash-line); padding-top: var(--s3); color: var(--ink-2); font-size: var(--fs-sm); }
.buying li::before { content: counter(buy); display: block; font: 500 1.6rem/1.2 var(--font-editorial); color: var(--emerald); }
.buying strong { display: block; color: var(--ink); font-size: var(--fs-base); margin-bottom: var(--s1); }
.lulu-note { border-radius: var(--r-lg); display: flex; gap: var(--s3); padding: var(--s4); background: var(--paper); font-size: var(--fs-sm); max-width: 56rem; }
.lulu-note p { margin: 0; }

.pending { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s6); align-items: start; padding-block: var(--s6); border-top: 1px solid var(--paper-line); }
.pending h3 { font: 600 1.5rem/1.25 var(--font-editorial); }
.pending p { color: var(--ink-2); max-width: 36em; }

/* Recommended books inside the journey and the dashboard. */
.book-shelf { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(30rem, 100%), 1fr)); gap: var(--s7) var(--s6); margin-block: var(--s6); }
.book-entry { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s6); align-items: start; padding-top: var(--s6); border-top: 1px solid var(--paper-line); }
.book-entry h2, .book-entry h3 { font: 600 1.45rem/1.2 var(--font-editorial); }
.book-entry h2 a, .book-entry h3 a { color: inherit; text-decoration: none; }
.book-entry h2 a:hover, .book-entry h3 a:hover { text-decoration: underline; }
.book-sub { font-family: var(--font-editorial); font-style: italic; font-size: 1.15rem; color: var(--ink-2); }
.editions { list-style: none; padding: 0; margin: var(--s4) 0 var(--s3); }
.editions li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); padding: var(--s3) 0; border-top: 1px dashed var(--paper-line); }
.edition-name { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 600; }
.edition-price { margin-right: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Student pieces ------------------------------------------------------------ */

.course-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
.course-card { padding: var(--s4); border: 1px solid var(--border); border-left: 4px solid var(--accent-year, var(--emerald)); border-radius: 3px; }
.course-card-head, .request-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); align-items: center; margin-bottom: var(--s2); }
.course-card progress { width: 100%; height: 0.5rem; accent-color: var(--accent-year, var(--emerald)); }
.curriculum-list { margin-bottom: var(--s4); }
.curriculum-list details { border-bottom: 1px solid var(--border); }
.curriculum-list summary { display: flex; align-items: center; gap: var(--s3); min-height: 3rem; cursor: pointer; list-style: none; font-weight: 600; }
.curriculum-list summary::-webkit-details-marker { display: none; }
.curriculum-list summary span { flex: 1; }
.curriculum-list summary small { color: var(--text-3); font-weight: 500; }
.curriculum-list summary .icon { transition: transform 0.3s; }
.curriculum-list details[open] summary .icon { transform: rotate(180deg); }
.curriculum-list ul { list-style: none; padding: 0 0 var(--s3); margin: 0; }
.curriculum-list li { display: flex; gap: var(--s3); align-items: center; padding: var(--s1) 0; }
.curriculum-list li.is-locked { color: var(--text-3); }
.upgrade { display: flex; flex-wrap: wrap; gap: var(--s5); align-items: center; justify-content: space-between; padding: var(--s6); border-radius: 3px; background: var(--navy-900); color: #d9e7f2; overflow: hidden; }
.upgrade h2 { font-family: var(--font-editorial); font-weight: 500; font-size: 1.7rem; color: #fff; }
.upgrade > div { flex: 1 1 18rem; }
.upgrade p { margin-bottom: var(--s2); }
.upgrade .fine { color: #b7d3c9; margin: 0; }
.upgrade :focus-visible { outline-color: #6ee7b7; }
.request-list { list-style: none; padding: 0; }
.request-list > li { padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.request-list summary, .blockers summary { cursor: pointer; min-height: 2rem; font-weight: 600; font-size: var(--fs-sm); }

.locked-block { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); padding: var(--s5); border: 1px dashed var(--border-control); border-radius: 3px; background: var(--surface-2); }
.locked-block > div { flex: 1 1 14rem; }
.locked-block h2 { margin: 0; }
.locked-mark { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--surface-3); color: var(--text-2); transition: transform 0.35s var(--spring); }
.locked-block:hover .locked-mark { transform: rotate(-12deg) scale(1.06); }
.path-item.is-locked .path-card { background: var(--surface-2); border-style: dashed; }
.path-item.is-locked .row-title { color: var(--text-2); }
.contents-locked { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0; color: var(--text-3); }

@media (prefers-reduced-motion: no-preference) {
  body:not([data-motion='off']) .ring-value { animation: ring 1.1s var(--spring) both; }
  body:not([data-motion='off']) .complete-bar.is-done .complete-mark { animation: pop 0.6s var(--spring) both; }
  body:not([data-motion='off']) .course-card { animation: settle 0.5s var(--spring) both; }
}
@keyframes ring { from { stroke-dashoffset: 100; } }

/* Administration ------------------------------------------------------------- */

.figures { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr)); gap: var(--s3); }
.figures li { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.figures li > * { display: flex; flex-direction: column; gap: 0.15rem; width: 100%; padding: var(--s4); text-decoration: none; color: var(--text); }
.figures a:hover { background: var(--surface-2); color: var(--text); }
.figures strong { font: 700 var(--fs-2xl)/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.figures span { font-size: var(--fs-sm); color: var(--text-2); }
.figures small { font-size: var(--fs-xs); color: var(--text-3); }
.access-tree, .access-tree ul { list-style: none; margin: 0; padding: 0; }
.access-tree > li { margin-bottom: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s3) var(--s4); }
.access-tree ul { padding-left: var(--s5); }
.access-tree summary { cursor: pointer; font-size: var(--fs-sm); color: var(--text-3); min-height: 1.8rem; }
.access-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s3); align-items: center; padding: var(--s2) 0; border-top: 1px solid var(--border); }
.access-topic { border-top: 0; }
.consent-list { list-style: none; padding: 0; }
.consent-list li { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.consent-list p { margin: 0; }
.preview-box { max-height: 22rem; overflow: auto; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: var(--s4); }

/* Leaving for Lulu */
.leave-dialog p + p { margin-top: var(--s3); }

/* Smaller screens ----------------------------------------------------------- */

@media (max-width: 68rem) {
  .options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .option-free { grid-column: 1 / -1; margin-right: 0; }
  .options-preview { grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); }
  .options-preview .option-free { grid-column: auto; }
  .buying ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 62rem) {
  .journey, .showcase, .pending { grid-template-columns: minmax(0, 1fr); }
  .showcase-art { padding-block: var(--s7); }
  .summary { position: static; }
  .journey > .summary { order: -1; }
  .journey > .summary .fine, .journey > .summary dl { display: none; }
  .journey > .summary { padding: var(--s4) var(--s5); }
  .journey > .summary .summary-total { font-size: 2.2rem; }
}
@media (max-width: 40rem) {
  .options, .choice-cards, .formats, .buying ol { grid-template-columns: minmax(0, 1fr); }
  .formats li + li { border-left: 0; border-top: 1px solid var(--wash-line); }
  .showcase-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .launch-page .button { width: 100%; }
  .book-entry { grid-template-columns: minmax(0, 1fr); }
  .book-entry-cover { justify-self: center; padding-block: var(--s3); }
  .editions .button { width: 100%; }
  .stepper-count { display: block; }
  .stepper ol { display: none; }
  .pay-bar .button { width: 100%; }
  .access-row { grid-template-columns: minmax(0, 1fr) auto; }
  .access-row > :first-child { grid-column: 1 / -1; }
}

/* The cover is wrapped in a link: its placeholder text is not underlined. */
.book-entry-cover { text-decoration: none; color: inherit; }
.book-feature .showcase { border-top: 0; padding-top: 0; }
.sample-manager { margin-top: var(--s5); }
/* Wide pages end with a section that needs room before the footer. */
.site-main:not(.site-main-padded) { padding-bottom: var(--s8); }
/* The administrator menu has many entries: keep them compact. */
.shell-admin .side-link { min-height: 2.25rem; padding-block: 0.25rem; }
.shell-admin .side-group { margin-bottom: var(--s2); }
.shell-admin .side-group > p { margin-bottom: 0.15rem; }

/* Long web addresses in policy text wrap on narrow phones. */
.document a, .prose a, .document, .site-main .document-wrap { overflow-wrap: anywhere; }
.doc > * { min-width: 0; }

/* The way to the free samples, beneath each book. ---------------------------- */

.sample-link { display: flex; align-items: center; gap: var(--s3); margin: 0 0 var(--s4); padding: var(--s3) var(--s4); max-width: 34rem; background: var(--wash); border: 1px solid var(--wash-line); border-radius: var(--r-lg); font-weight: 600; color: var(--accent-800); text-decoration: none; transition: background-color var(--t), border-color var(--t); }
.sample-link:hover { background: var(--accent-100); border-color: var(--emerald); color: var(--accent-800); }
.sample-link span { flex: 1; }
.sample-link .icon { width: 1.3rem; height: 1.3rem; }
