/* How Much Is the Milk? — book site. Builds on /css/site.css (strategem.pro "Flow" design system):
   same faces, night ground, square gold buttons, form fields. Only book-specific pieces live here. */

/* Wordmark in the top bar */
.book-divider { flex: none; width: 1px; height: 26px; background: rgba(195, 206, 220, 0.25); margin: 0 -6px; }
.book-mark { flex: none; font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--white); text-decoration: none; white-space: nowrap; }
.book-mark em { font-style: normal; color: var(--gold); }
.nav-home { display: none !important; }
/* Phones: the bar holds the book's name and the Menu button; the way home moves into the menu. */
@media (max-width: 600px) {
  .book-home, .book-divider { display: none; }
  .nav-home { display: flex !important; }
}

/* Hero */
.b-hero { padding-block: 72px 88px; text-align: center; }
.b-duo { display: grid; grid-template-columns: auto auto; gap: clamp(32px, 6vw, 88px); align-items: start; justify-content: center; }
.b-ken { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.b-ken img { width: clamp(180px, 20vw, 270px); height: auto; box-shadow: 24px 32px 60px -18px rgba(0, 0, 0, 0.7); }
.b-ken figcaption { max-width: 24ch; font-family: var(--display); font-weight: 500; font-size: clamp(18px, 2vw, 24px); line-height: 1.3; color: var(--mist); text-wrap: balance; }
.b-cover { display: flex; flex-direction: column; align-items: center; }
.cover-btn { background: none; border: 0; padding: 0; cursor: zoom-in; transition: transform 0.25s ease; }
.cover-btn:hover { transform: translateY(-5px); }
.cover-btn img { width: clamp(220px, 26vw, 340px); height: auto; box-shadow: 0 0 110px 10px rgba(242, 177, 72, 0.28), 24px 32px 60px -18px rgba(0, 0, 0, 0.7); }
.cover-hint { margin-top: 16px; font-size: 14px; color: #8A99AD; }
.b-title { margin-top: clamp(40px, 6vh, 64px); font-size: clamp(44px, 7.4vw, 112px); color: var(--gold) !important; }
.b-sub { margin: 22px auto 0; max-width: 34em; font-size: clamp(17px, 1.5vw, 20px); color: var(--mist); }
@media (max-width: 760px) { .b-duo { grid-template-columns: 1fr; justify-items: center; } }

/* Ken's background */
.b-strip { border-top: 1px solid rgba(195, 206, 220, 0.12); border-bottom: 1px solid rgba(195, 206, 220, 0.12); }
.b-strip .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.b-strip .wrap > div { padding: 34px 24px; border-left: 1px solid rgba(195, 206, 220, 0.12); display: grid; gap: 8px; }
.b-strip .wrap > div:first-child { border-left: 0; padding-left: 0; }
.b-strip b { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 4.2vw, 56px); line-height: 1; letter-spacing: -0.03em; color: var(--white); font-variant-numeric: tabular-nums; }
.b-strip sup { font-size: 0.45em; color: var(--gold); }
@media (max-width: 860px) {
  .b-strip .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-strip .wrap > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .b-strip .wrap > div:nth-child(n+3) { border-top: 1px solid rgba(195, 206, 220, 0.12); }
}

/* Who it's for */
.seats { margin-top: 48px; border-top: 2px solid var(--navy); }
.seat { display: grid; grid-template-columns: 64px minmax(0, 260px) minmax(0, 1fr); gap: 24px; align-items: baseline; padding: 28px 0; border-bottom: 1px solid var(--line); }
.seat i { font-style: normal; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; color: var(--gold-dk); }
.seat h3 { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.02em; color: var(--navy); }
.seat p { font-size: 18px; color: var(--body); }
@media (max-width: 760px) { .seat { grid-template-columns: 44px minmax(0, 1fr); row-gap: 6px; } .seat p { grid-column: 2; font-size: 16px; } }

/* Photo windows */
.pwin { position: relative; height: 64vh; min-height: 380px; background-position: center; background-size: cover; background-attachment: fixed; }
.pwin.p1 { background-image: url("/book/assets/parallax-signing.jpg"); }
.pwin.p2 { background-image: url("/book/assets/parallax-ken.jpg"); }
.pwin::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 24, 35, 0.75), transparent 22%, transparent 78%, rgba(15, 24, 35, 0.75)); }
.pwin.p1::after { content: ""; position: absolute; inset: 0; background: rgba(27, 39, 56, 0.45); }
@media (hover: none), (prefers-reduced-motion: reduce) { .pwin { background-attachment: scroll; } }

/* Read a chapter: an open book. Ken's words set in a reading serif on warm paper, two pages to a
   spread, turned like a book. Without JavaScript the text simply reads straight down the page. */
.b-reading { background: #EEF0F3; overflow-x: clip; } /* a page in mid-turn never makes the page scroll sideways */
.head--c { text-align: center; }
.head--c p { margin-left: auto; margin-right: auto; }
.book {
  /* A 6 x 9 trade page: width : height = 2 : 3, as large as the screen allows. Margins and type scale with the page. */
  --pw: min(540px, calc((100vw - 2 * var(--gutter)) / 2), calc((100svh - 220px) / 1.5));
  --paper: #FBF8F1; --ink: #2B2A27;
  --pad-out: calc(var(--pw) * 0.11); --pad-in: calc(var(--pw) * 0.085);
  --pad-top: calc(var(--pw) * 0.135); --pad-bot: calc(var(--pw) * 0.125);
  --text-h: calc(var(--pw) * 1.5 - var(--pad-top) - var(--pad-bot));
  margin-top: 56px;
}
.book-spread { position: relative; max-width: 1100px; margin: 0 auto; }
.book.is-paged .book-spread { width: calc(var(--pw) * 2); max-width: none; }
.book-page { display: none; }
.book-flow { font-family: 'Literata', Georgia, 'Times New Roman', serif; font-size: clamp(14.5px, calc(var(--pw) * 0.0325), 17.5px); line-height: 1.6; color: var(--ink); font-optical-sizing: auto; }
.book-flow p { margin: 0; text-align: justify; -webkit-hyphens: auto; hyphens: auto; widows: 2; orphans: 2; }
.book-flow p + p { text-indent: 1.5em; }
.b-chap { text-align: center !important; font-family: var(--display); font-size: 11.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-dk); }
.bk-title { margin: 18px 0 26px; text-align: center; font-family: 'Literata', Georgia, serif; font-weight: 600; font-size: clamp(22px, calc(var(--pw) * 0.055), 30px); line-height: 1.15; letter-spacing: -0.01em; color: var(--navy); break-after: avoid; }
.b-first { text-indent: 0 !important; }
.b-first::first-letter { float: left; font-weight: 600; font-size: 4.1em; line-height: 0.8; padding: 0.07em 0.09em 0 0; color: var(--navy); }
.b-first .sc { font-variant: small-caps; letter-spacing: 0.05em; }
.b-end { margin-top: 30px !important; text-indent: 0 !important; text-align: center !important; font-family: var(--display); font-size: 11.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: #8A8478; }
.b-end span { color: var(--gold); letter-spacing: 0.4em; font-size: 15px; }

.bk-endcard { margin-top: 40px; text-align: center; text-indent: 0; font-family: var(--text); }
.bk-endcard img { width: 112px; height: auto; margin: 0 auto; box-shadow: 10px 14px 28px -12px rgba(15, 24, 35, 0.45); }
.bk-endcard p { margin: 22px 0 18px !important; text-align: center !important; text-indent: 0 !important; font-family: 'Literata', Georgia, serif; font-style: italic; font-size: 19px; color: var(--navy); }
.book.is-paged .bk-endcard { break-before: column; margin-top: 0; padding-top: 18%; }

/* Paged (JavaScript on): fixed pages, text flowing column to column */
.book.is-paged .book-spread { height: calc(var(--pw) * 1.5); }
.book.is-paged .book-page {
  display: block; position: absolute; top: 0; bottom: 0; width: 50%; background: var(--paper);
}
.book-page--l {
  left: 0;
  background-image: linear-gradient(to left, rgba(60, 45, 20, 0.16), rgba(60, 45, 20, 0.04) 26px, transparent 64px) !important;
  box-shadow: -1px 1px 0 #E8E1D2, -2px 2px 0 var(--paper), -3px 3px 0 #E3DBCA, -4px 4px 0 var(--paper), -5px 5px 0 #DED5C2, -22px 30px 50px -24px rgba(15, 24, 35, 0.45);
  border-radius: 4px 0 0 4px;
}
.book-page--r {
  right: 0;
  background-image: linear-gradient(to right, rgba(60, 45, 20, 0.16), rgba(60, 45, 20, 0.04) 26px, transparent 64px) !important;
  box-shadow: 1px 1px 0 #E8E1D2, 2px 2px 0 var(--paper), 3px 3px 0 #E3DBCA, 4px 4px 0 var(--paper), 5px 5px 0 #DED5C2, 22px 30px 50px -24px rgba(15, 24, 35, 0.45);
  border-radius: 0 4px 4px 0;
}
.book-page { background-color: var(--paper); }
.book-page .run { position: absolute; top: calc(var(--pad-top) * 0.4); left: 0; right: 0; text-align: center; font-family: var(--display); font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #A39A88; }
.book-page .folio { position: absolute; bottom: calc(var(--pad-bot) * 0.36); font-family: 'Literata', Georgia, serif; font-size: 13px; color: #8A8478; }
.book-page--l .folio { left: var(--pad-out); }
.book-page--r .folio { right: var(--pad-out); }
.book.is-paged .book-view { position: absolute; z-index: 1; top: var(--pad-top); left: var(--pad-out); right: var(--pad-out); height: var(--text-h); overflow: hidden; }
.book.is-paged .book-flow { height: 100%; column-count: 2; column-gap: calc(var(--pad-in) * 2); column-fill: auto; }

/* Turning a page (book.js): a layer over the spread holds the two pages underneath and the leaf in flight */
.book-turn { position: absolute; inset: 0; z-index: 3; pointer-events: none; perspective: calc(var(--pw) * 4); }
.book.is-turning .book-view { visibility: hidden; }
.book.is-paged .turn-face { box-shadow: none; }
.turn-text { position: absolute; top: var(--pad-top); height: var(--text-h); overflow: hidden; }
.book-page--l .turn-text { left: var(--pad-out); right: var(--pad-in); }
.book-page--r .turn-text { left: var(--pad-in); right: var(--pad-out); }
.turn-shade { position: absolute; inset: 0; opacity: 0; }
.book-page--l .turn-shade { background: linear-gradient(to left, rgba(40, 30, 12, 0.3), rgba(40, 30, 12, 0.1) 45%, rgba(40, 30, 12, 0.03)); }
.book-page--r .turn-shade { background: linear-gradient(to right, rgba(40, 30, 12, 0.3), rgba(40, 30, 12, 0.1) 45%, rgba(40, 30, 12, 0.03)); }
.turn-leaf { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; }
.turn-leaf--r { right: 0; transform-origin: 0 50%; }
.turn-leaf--l { left: 0; transform-origin: 100% 50%; }
.book.is-paged .turn-leaf .turn-face { left: 0; right: 0; width: auto; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.turn-leaf .turn-back { transform: rotateY(180deg); }

/* Page edges: click to turn, with a quiet corner fold on hover */
.book-edge { position: absolute; z-index: 2; top: 0; bottom: 0; width: 46px; padding: 0; border: 0; background: none; cursor: pointer; }
.book-edge--prev { left: 0; }
.book-edge--next { right: 0; }
.book-edge::after { content: ""; position: absolute; bottom: 0; width: 0; height: 0; transition: width 0.25s, height 0.25s; }
.book-edge--next::after { right: 0; background: linear-gradient(225deg, #EEF0F3 45%, #DCD3C1 50%, #F4EFE4 60%); border-radius: 0 0 4px 0; }
.book-edge--prev::after { left: 0; background: linear-gradient(135deg, #EEF0F3 45%, #DCD3C1 50%, #F4EFE4 60%); border-radius: 0 0 0 4px; }
.book-edge:hover::after, .book-edge:focus-visible::after { width: 34px; height: 34px; }
.book-edge:disabled { cursor: default; }
.book-edge:disabled::after { width: 0; height: 0; }

/* Turn controls and progress */
.book-bar { max-width: 520px; margin: 40px auto 0; display: flex; align-items: center; gap: 18px; }
.book-bar .car-btn:disabled { opacity: 0.3; cursor: default; background: transparent; color: var(--navy); }
.book-progress { flex: 1; display: grid; gap: 10px; text-align: center; }
.book-progress span { font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.book-progress i { display: block; height: 3px; background: #D6DBE2; }
.book-progress b { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }

/* Listen to This Excerpt: the gold button opens a slim player under the book */
.listen { max-width: 520px; margin: 32px auto 0; display: flex; justify-content: center; }
.listen-player { width: 100%; display: flex; align-items: center; gap: 16px; padding: 14px 18px 12px 14px; background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--gold); }
.listen-player[hidden] { display: none; }
.listen-toggle { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border: 0; background: var(--navy); color: var(--white); cursor: pointer; }
.listen-toggle:hover { background: #26364D; }
.listen-toggle .i-play, .listen-player.is-playing .i-pause { display: block; }
.listen-toggle .i-pause, .listen-player.is-playing .i-play { display: none; }
.listen-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.listen-head { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.listen-head span { flex: none; font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-dk); }
.listen-head b { font-family: 'Literata', Georgia, serif; font-weight: 600; font-size: 15px; color: var(--navy); }
.listen-body input { --p: 0%; width: 100%; height: 18px; margin: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.listen-body input::-webkit-slider-runnable-track { height: 4px; background: linear-gradient(to right, var(--gold) var(--p), #D6DBE2 var(--p)); }
.listen-body input::-moz-range-track { height: 4px; background: linear-gradient(to right, var(--gold) var(--p), #D6DBE2 var(--p)); }
.listen-body input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 0; background: var(--navy); }
.listen-body input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 0; background: var(--navy); }
.listen-body input:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.listen-time { display: flex; justify-content: space-between; font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); font-variant-numeric: tabular-nums; }

/* One page at a time on narrower screens */
@media (max-width: 899px) {
  .book { --pw: min(480px, calc(100vw - 2 * var(--gutter)), calc((100svh - 190px) / 1.5)); --pad-out: calc(var(--pw) * 0.085); }
  .book.is-paged .book-spread { width: var(--pw); }
  .book.is-paged .book-page--l { display: none; }
  .book.is-paged .book-page--r { left: 0; width: auto; background-image: none !important; border-radius: 4px; }
  .book.is-paged .book-flow { column-count: 1; column-gap: calc(var(--pad-out) * 2); }
  .book-turn { perspective-origin: 0 50%; } /* the page hinges on its left edge */
  .turn-leaf--r { width: 100%; }
  .book-page--r .turn-text { left: var(--pad-out); }
  .book-flow { font-size: clamp(15px, calc(var(--pw) * 0.036), 17px); }
  .book-bar { margin-top: 28px; }
}

.reader-end { max-width: 1100px; margin: 44px auto 0; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.reader-end p { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--navy); }
.reader-end .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Testimonials */
.b-praise .head h2, .b-members .head h2 { color: var(--white); }
.b-praise .head p, .b-members .head p { color: var(--mist); }
.t-card { margin-top: 48px; max-width: 1080px; min-height: 360px; display: flex; flex-direction: column; border: 1px solid rgba(195, 206, 220, 0.16); padding: clamp(26px, 4vw, 48px); background: rgba(195, 206, 220, 0.04); }
.t-quote { flex: 1; display: flex; align-items: center; }
.t-quote blockquote { margin: 0; font-size: clamp(21px, 2.4vw, 30px); line-height: 1.45; color: var(--white); text-wrap: pretty; animation: tFade 0.5s ease; }
.t-quote blockquote.long { font-size: clamp(16px, 1.6vw, 19px); line-height: 1.7; }
@keyframes tFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.t-cite { margin-top: 24px; font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mist); }
.t-cite b { color: var(--white); }
.t-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 28px; padding-top: 22px; border-top: 1px solid rgba(195, 206, 220, 0.14); }
.t-stars { color: var(--gold); font-size: 17px; letter-spacing: 0.22em; }
.t-nav { display: flex; align-items: center; gap: 14px; }
.t-dots { display: flex; gap: 8px; }
.t-dot { width: 9px; height: 9px; padding: 0; border: 0; background: rgba(195, 206, 220, 0.25); cursor: pointer; }
.t-dot[aria-current="true"] { background: var(--gold); }
.t-arrow { width: 44px; height: 44px; border: 2px solid rgba(255, 255, 255, 0.45); background: transparent; color: var(--white); font-size: 17px; font-weight: 700; cursor: pointer; }
.t-arrow:hover { background: var(--white); color: var(--navy); }

/* Members */
.benefits { margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid rgba(195, 206, 220, 0.16); }
.benefits > div { padding: 26px 26px 6px 0; }
.benefits > div + div { padding-left: 26px; border-left: 1px solid rgba(195, 206, 220, 0.16); }
.benefits h3 { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--white); }
.benefits p { margin-top: 8px; font-size: 16px; color: var(--mist); }
@media (max-width: 760px) {
  .benefits { grid-template-columns: 1fr; }
  .benefits > div, .benefits > div + div { padding: 20px 0 4px; border-left: 0; border-top: 1px solid rgba(195, 206, 220, 0.16); }
  .benefits > div:first-child { border-top: 0; }
}
.m-actions { margin-top: 40px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.m-hello { flex-basis: 100%; margin-bottom: 6px; font-size: 18px; color: var(--white); }
.m-hello span[data-member-left] { color: var(--mist); }

/* Speaking */
.venues { list-style: none; padding: 0; margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 12px 32px; font-family: var(--display); font-weight: 600; font-size: clamp(17px, 1.6vw, 22px); color: var(--navy); }
.venues li { display: flex; align-items: center; gap: 10px; }
.venues li::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--gold); }
.press { margin-top: 44px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.press div { aspect-ratio: 1 / 1; display: grid; place-items: center; background: var(--light); border: 1px solid var(--line); overflow: hidden; }
.press img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 860px) { .press { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Signed copy band */
.b-signed { background: var(--gold); color: var(--navy); padding-block: 44px; }
.b-signed .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.b-signed h2 { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 2.6vw, 34px); text-transform: uppercase; letter-spacing: -0.01em; }
.b-signed p { margin-top: 6px; font-weight: 600; }
.b-navy { background: var(--navy); color: var(--white); border-color: var(--navy); }
.b-navy:hover { background: #26364D; border-color: #26364D; }

/* Footer additions */
.foot-pub, .foot-contact { margin-top: 14px !important; font-size: 14px; }
.foot-pub b { color: var(--white); font-weight: 600; }
.foot-pub a, .foot-contact a { display: inline; padding: 0; }

/* ===== Dialogs ===== */
.b-modal { position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(8, 12, 18, 0.84); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.b-modal[hidden] { display: none !important; }
body.has-modal { overflow: hidden; }
.b-panel { width: min(640px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--night); border: 1px solid rgba(195, 206, 220, 0.18); border-top: 3px solid var(--gold); color: var(--mist); }
.b-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 26px 0; }
.b-top h2 { font-family: var(--display); font-weight: 700; font-size: 24px; text-transform: uppercase; letter-spacing: -0.01em; color: var(--white); }
.b-top p { margin-top: 4px; font-size: 15px; }
.b-close { flex: none; width: 40px; height: 40px; border: 2px solid rgba(255, 255, 255, 0.4); background: none; color: var(--white); font-size: 22px; line-height: 1; cursor: pointer; }
.b-close:hover { border-color: var(--gold); color: var(--gold); }
.b-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; padding: 22px 26px 26px; }
.b-form[hidden] { display: none; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--mist); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.full { grid-column: 1 / -1; }
.ts { min-height: 65px; }
.fine { font-size: 13px; color: #8A99AD; }
.fine a { color: var(--mist); }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--mist); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--gold); }
.step-lead { font-size: 16px; color: var(--mist); }
.step-lead b { color: var(--white); }
.code-in { font-family: var(--display) !important; font-size: 30px !important; letter-spacing: 0.4em; text-align: center; }
.b-done { padding: 24px 26px 30px; }
.b-done h3 { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--white); }
.b-done p { margin: 10px 0 22px; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
@media (max-width: 600px) { .b-form { grid-template-columns: 1fr; } .b-top, .b-form, .b-done { padding-inline: 18px; } }

/* Gallery */
.b-panel--gallery { width: min(900px, 100%); height: min(88vh, 860px); display: flex; flex-direction: column; overflow: hidden; }
.b-panel--gallery .b-top { padding-bottom: 14px; border-bottom: 1px solid rgba(195, 206, 220, 0.12); }
.b-stage { flex: 1; overflow-y: auto; padding: 24px; }
.b-stage img { display: block; margin: 0 auto; width: min(100%, 560px); height: auto; box-shadow: 0 24px 70px -18px rgba(0, 0, 0, 0.85); }
.b-gfoot { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 14px; border-top: 1px solid rgba(195, 206, 220, 0.12); }
.b-thumbs { display: flex; gap: 10px; }
.b-thumbs button { padding: 2px; border: 2px solid transparent; background: none; cursor: pointer; }
.b-thumbs button[aria-current="true"] { border-color: var(--gold); }
.b-thumbs img { height: 58px; width: auto; display: block; }
@media (max-width: 600px) { .b-thumbs img { height: 42px; } .b-stage { padding: 14px; } }

/* Ask the Milk: the chat framed by the book's cover */
.bm-frame { width: min(1000px, 100%); height: min(88vh, 820px); padding: clamp(10px, 2.6vw, 34px); background: url("/book/assets/cover.png") center / cover; box-shadow: 0 0 120px 12px rgba(242, 177, 72, 0.25), 0 40px 80px -20px rgba(0, 0, 0, 0.8); }
.bm-page { height: 100%; display: flex; flex-direction: column; background: #F7F4EE; color: #1E2632; overflow: hidden; box-shadow: 0 10px 40px rgba(20, 12, 6, 0.45); }
.bm-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 22px; background: var(--night); }
.bm-title { font-family: var(--display); font-weight: 700; font-size: 20px; text-transform: uppercase; color: var(--white); }
.bm-title span { color: var(--gold); }
.bm-sub { margin-top: 2px; font-size: 13.5px; color: var(--mist); }
.bm-msgs { flex: 1; overflow-y: auto; padding: 24px 22px; display: flex; flex-direction: column; gap: 14px; }
.bm-msg { max-width: 78ch; padding: 14px 18px; font-size: 16px; line-height: 1.65; }
.bm-msg.user { align-self: flex-end; background: var(--navy); color: var(--white); white-space: pre-wrap; }
.bm-msg.bot { align-self: flex-start; background: var(--white); border: 1px solid #E4DED3; border-left: 3px solid var(--gold); }
.bm-msg.bot p + p, .bm-msg.bot p + ol, .bm-msg.bot p + ul, .bm-msg.bot ol + p, .bm-msg.bot ul + p { margin-top: 10px; }
.bm-msg.bot ol, .bm-msg.bot ul { margin: 0; padding-left: 22px; }
.bm-msg.bot li { margin: 6px 0; }
.bm-msg.bot li::marker { color: var(--gold-dk); font-weight: 700; }
.bm-msg.bot a { color: var(--navy); }
.bm-msg.err { align-self: flex-start; background: #FDF0EC; border: 1px solid #ECC5B8; color: #8C3A22; }
.bm-thinking { align-self: flex-start; font-size: 14px; color: var(--muted); }
.bm-thinking i { font-style: normal; animation: blink 1.2s infinite; }
.bm-thinking i:nth-child(2) { animation-delay: 0.2s; }
.bm-thinking i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
.bm-input { display: flex; gap: 10px; padding: 16px 22px; border-top: 1px solid #E4DED3; background: #EFEAE2; }
.bm-input input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 13px 14px; border: 1px solid #CFC6B8; background: var(--white); color: var(--navy); }
.bm-input input:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.bm-input button { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; padding: 0 22px; border: 0; background: var(--gold); color: var(--navy); cursor: pointer; }
.bm-input button:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 600px) { .bm-frame { height: calc(100vh - 24px); padding: 8px; } .bm-msgs, .bm-head, .bm-input { padding-inline: 14px; } }
