/* Scoped annual recap presentation; the rest of Gallery keeps its existing layout. */
#yearInBooksOverview { --yib-ink:#f3f2e9; --yib-muted:#bdc6bf; --yib-surface:#202923; --yib-line:#48544a; --yib-accent:#d6bc77; margin-block:1.5rem; color:var(--yib-ink); }
body[data-theme="light"] #yearInBooksOverview { --yib-ink:#25382e; --yib-muted:#536257; --yib-surface:#f1f1e6; --yib-line:#c5cebd; --yib-accent:#795e23; }
#yearInBooksOverview[hidden] { display:none; }
.yib-overview-controls { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:1rem; }
.yib-overview-controls label { display:flex; align-items:center; gap:.75rem; font-size:.875rem; }
.yib-overview-controls select { min-height:44px; padding:.4rem 2rem .4rem .75rem; border:1px solid var(--yib-line); border-radius:7px; background:var(--yib-surface); color:var(--yib-ink); font:inherit; }
.yib-overview-controls > span { color:var(--yib-muted); font-size:.75rem; }
#yearInBooksStatus { color:var(--yib-muted); margin-block:1rem; }
#yearInBooksStatus:empty { display:none; }
.yib-overview-hero { display:grid; grid-template-columns:1fr 1fr; gap:2rem; align-items:center; background:var(--yib-surface); border:1px solid var(--yib-line); border-radius:1rem; padding:clamp(1.25rem,4vw,3rem); margin-block:1.25rem; }
#yearInBooksOverview h2 { color:var(--yib-ink); font-family:Georgia,serif; font-weight:400; font-size:clamp(2rem,4vw,3.5rem); line-height:1.1; margin-block:.75rem 1rem; }
#yearInBooksOverview h2 span { display:block; color:var(--yib-accent); font-size:1.2em; }
#yearInBooksOverview p { line-height:1.6; }
.yib-overview-cutoff { color:var(--yib-muted); font-size:.875rem; }
.yib-overview-total { margin-block:1.25rem; }
.yib-overview-total strong { font-size:1.65rem; font-variant-numeric:tabular-nums; font-weight:600; }
.yib-overview-copy { margin-bottom:24px; }
.yib-overview-wait { min-height:12rem; border-block:1px solid var(--yib-line); }
.yib-no-covers { max-width:14rem; text-align:center; color:var(--yib-muted); font-family:Georgia,serif; font-size:1.5rem; }
.yib-button { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; min-width:44px; min-height:44px; padding:.5rem .85rem; font:inherit; font-size:.875rem; line-height:1.2; color:var(--yib-ink,#f3f2e9); background:transparent; border:1px solid var(--yib-line,#48544a); border-radius:8px; cursor:pointer; text-decoration:none; }
.yib-button-primary { background:#cbbb89; color:#1b2820; border-color:#cbbb89; font-weight:600; }
.yib-button:disabled { opacity:.4; cursor:default; }
.yib-button[hidden] { display:none; }
.yib-button:focus-visible, .yib-about summary:focus-visible, #yearInBooksYear:focus-visible, .yib-story-content:focus-visible { outline:3px solid #bca66b; outline-offset:3px; }
.yib-kicker { color:var(--yib-accent,#d6bc77); font-size:.75rem; letter-spacing:.12em; text-transform:uppercase; line-height:1.5; }
.yib-coverage { font-size:.75rem; color:var(--yib-muted,#bdc6bf); line-height:1.6; margin-block:.75rem; overflow-wrap:anywhere; }
.yib-about { color:var(--yib-muted,#bdc6bf); border-top:1px solid var(--yib-line,#48544a); padding-block:.85rem; font-size:.8rem; margin-block:1.5rem 0; text-align:left; }
.yib-about summary { width:fit-content; cursor:pointer; min-height:44px; align-content:center; padding-inline:.25rem; }
.yib-about p { margin-block:.65rem; line-height:1.6; }
.yib-cover-fan { display:flex; justify-content:center; align-items:center; padding:1.5rem .5rem; min-height:230px; isolation:isolate; }
.yib-cover-fan:empty { display:none; }
.yib-cover { min-width:0; width:100%; margin:0; }
.yib-cover-fan .yib-cover { width:min(31%,140px); flex:0 1 140px; transform:rotate(-9deg); }
.yib-cover-fan .yib-cover:nth-child(2) { transform:translateY(-.8rem) rotate(1deg); margin-inline:-.5rem; z-index:2; }
.yib-cover-fan .yib-cover:nth-child(3) { transform:rotate(9deg); }
.yib-cover-image, .yib-cover-empty { aspect-ratio:2/3; width:100%; border:1px solid #596258; border-radius:5px; background:#303b32; overflow:hidden; box-shadow:0 10px 20px #0003; }
.yib-cover-image { position:relative; }
.yib-cover-image img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; display:block; }
.yib-cover-empty { display:flex; align-items:center; justify-content:center; text-align:center; color:#c6cdc2; font-size:.7rem; line-height:1.7; }
.yib-cover figcaption { display:flex; flex-direction:column; gap:.25rem; margin-top:.7rem; font-size:.8rem; line-height:1.35; overflow-wrap:anywhere; }
.yib-cover figcaption strong { font-weight:500; }
.yib-cover figcaption span { color:#bdc6bf; font-size:.7rem; }
body[data-year-story-open] { overflow:hidden; }
#yearInBooksStory { --yib-ink:#f3f2e9; --yib-muted:#bdc6bf; --yib-surface:#1c2520; --yib-line:#465047; --yib-accent:#d6bc77; position:fixed; inset:0; margin:auto; width:min(980px,calc(100vw - 24px)); height:calc(100dvh - 24px); max-width:100vw; max-height:100dvh; padding:0; border:1px solid #4a564c; border-radius:16px; background:#1c2520; color:#f3f2e9; box-shadow:0 24px 90px #0008; overflow:hidden; box-sizing:border-box; font:1rem/1.5 system-ui,sans-serif; }
#yearInBooksStory:not([open]) { display:none; }
#yearInBooksStory[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
#yearInBooksStory * { box-sizing:border-box; }
#yearInBooksStory::backdrop { background:#0e1511d9; }
.yib-story-header { padding:.6rem 1.2rem .25rem; border-bottom:1px solid #3b493e; }
.yib-story-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem; }
.yib-brand { color:#d6bc77; letter-spacing:.17em; font-size:.7rem; }
.yib-close { border-color:transparent; padding-inline:.3rem; }
.yib-close span { font-size:1.5rem; }
.yib-progress { height:3px; margin-top:.3rem; background:#495249; border-radius:3px; overflow:hidden; }
.yib-progress span { display:block; height:100%; background:#d6bc77; transition:width 150ms ease; }
.yib-position { font-size:.7rem; color:#bdc6bf; margin:.35rem 0; }
.yib-story-content { display:grid; grid-template-columns:minmax(0,1fr) 260px; min-height:0; overflow:hidden; overflow-anchor:none; scroll-behavior:auto!important; }
.yib-stage { min-width:0; min-height:0; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.yib-canvas-frame { position:relative; flex:none; aspect-ratio:9/16; }
.yib-slide { position:absolute; inset:0 auto auto 0; width:1080px; height:1920px; transform-origin:top left; padding:120px 90px; display:flex; flex-direction:column; justify-content:flex-start; background:#1c2520; color:#f3f2e9; font:48px/1.5 system-ui,sans-serif; opacity:1; }
:is(#yearInBooksStory,.yib-export-scope) .yib-slide h2 { font:400 96px/1.12 Georgia,serif; overflow-wrap:anywhere; margin:24px 0 60px; }
.yib-slide .yib-kicker { font-size:36px; margin:0 0 12px; }
.yib-slide-opening,.yib-slide-closing { justify-content:center; text-align:center; }
.yib-reader-name { font-size:68px; font-weight:600; margin:0 0 48px; overflow-wrap:anywhere; }
.yib-reader-name[data-long-name="true"] { font-size:48px; }
.yib-slide-opening h2 { margin-bottom:24px!important; }
.yib-slide .yib-year { color:#d6bc77; font:160px/1.1 Georgia,serif; margin:0; }
.yib-slide .yib-cover-fan { min-height:0; padding:80px 20px; }
.yib-slide .yib-cover-fan .yib-cover { width:31%; flex:0 1 280px; }
.yib-slide .yib-cover-fan .yib-cover:nth-child(2) { transform:translateY(-24px) rotate(1deg); margin-inline:-20px; }
.yib-slide .yib-copy { color:#d5dcd2; font-size:48px; line-height:1.6; margin:40px 0 60px; overflow-wrap:anywhere; }
.yib-slide .yib-number { font:240px/1.08 Georgia,serif; color:#d6bc77; margin:100px 0 24px; overflow-wrap:anywhere; }
.yib-slide .yib-unit { color:#cdd5ca; font-size:48px; margin:0 0 64px; }
.yib-breakdown { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); border-block:1px solid #48534a; gap:48px 24px; padding-block:60px; margin:48px 0; }
.yib-breakdown dt { font-size:44px; color:#bdc6bf; overflow-wrap:anywhere; }
.yib-breakdown dd { margin:16px 0 0; font-size:76px; font-variant-numeric:tabular-nums; }
.yib-month-chart { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); align-items:end; gap:8px; list-style:none; margin:80px 0; padding:0; }
.yib-month-chart li { text-align:center; font-size:32px; color:#cdd5ca; }
.yib-month-chart li > span { display:block; margin-bottom:16px; }
.yib-month-chart abbr { text-decoration:none; font-size:30px; }
.yib-bar-track { height:435px; position:relative; border-bottom:1px solid #657561; margin-bottom:20px; }
.yib-bar-track i { display:block; position:absolute; inset:auto 6px 0; height:var(--yib-bar); min-height:2px; border-radius:9px 9px 0 0; background:#8ca687; }
.yib-month-chart .is-future { opacity:.5; }
.yib-highlight-value { color:#d6bc77; font:120px/1.2 Georgia,serif; margin:24px 0; }
.yib-book-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; margin:32px 0; }
.yib-slide-books .yib-book-row:has(> :only-child) { grid-template-columns:600px; justify-content:center; }
.yib-slide-books .yib-book-row:has(> :first-child:nth-last-child(2)) { grid-template-columns:repeat(2,410px); justify-content:center; }
.yib-slide .yib-cover-image,.yib-slide .yib-cover-empty { border-radius:15px; font-size:36px; }
.yib-slide figcaption { font-size:38px; margin-top:24px; }
.yib-slide figcaption span { display:none; }
.yib-slide figcaption strong { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.yib-main-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:60px 48px; margin:24px 0; }
.yib-main-choice { min-width:0; text-align:center; }
.yib-main-choice h3 { font:500 44px/1.4 system-ui; color:#d6bc77; margin:0 0 20px; }
.yib-main-choice .yib-cover-image,.yib-main-choice .yib-cover-empty { width:310px; margin-inline:auto; }
.yib-main-unset { display:grid; place-content:center; height:465px; margin:0; border:1px dashed #596258; color:#bdc6bf; font-size:40px; }
.yib-ranking-label { color:#bdc6bf; font-size:40px; margin:0 0 24px; }
.yib-terms { list-style:none; padding:0; margin:24px 0; }
.yib-terms li { border-bottom:1px solid #455147; padding-block:20px; display:flex; flex-direction:column; gap:12px; position:relative; }
.yib-terms li[hidden] { display:none; }
.yib-terms strong { color:#d6bc77; font:400 56px/1.3 Georgia,serif; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.yib-rank { font-variant-numeric:tabular-nums; }
.yib-terms span:not(.yib-rank) { font-size:40px; color:#bdc6bf; }
.yib-term-bar { display:block; width:var(--yib-term); height:9px; border-radius:9px; background:#8ca687; }
.yib-slide-books { padding:80px; }
:is(#yearInBooksStory,.yib-export-scope) .yib-slide-books h2 { font-size:88px; margin:16px 0 28px; }
.yib-slide-books .yib-highlight-value { font-size:140px; margin:12px 0 36px; }
.yib-slide-books figcaption { font-size:50px; line-height:1.25; text-align:center; }
.yib-slide-length { padding:88px 80px; }
:is(#yearInBooksStory,.yib-export-scope) .yib-slide-length h2 { font-size:88px; margin:16px 0 40px; }
.yib-slide-length .yib-number { margin:48px 0 24px; }
.yib-slide-length .yib-unit { font-size:44px; margin-bottom:32px; }
.yib-length-books { margin-top:auto; margin-bottom:48px; }
.yib-slide-length .yib-book-row { grid-template-columns:repeat(3,270px); justify-content:center; }
.yib-slide-length .yib-book-row[data-count="1"] { grid-template-columns:440px; }
.yib-slide-length .yib-book-row[data-count="2"] { grid-template-columns:repeat(2,350px); }
.yib-slide-length figcaption { font-size:44px; line-height:1.25; text-align:center; }
.yib-slide-terms { padding:80px; }
:is(#yearInBooksStory,.yib-export-scope) .yib-slide-terms h2 { font-size:88px; margin:16px 0 32px; }
.yib-slide-terms .yib-ranking-label { margin-bottom:12px; }
.yib-slide-terms .yib-terms { margin:16px 0; }
.yib-slide-terms .yib-terms li { padding-block:12px; gap:4px; }
.yib-slide-terms .yib-terms strong { font-size:52px; line-height:1.2; }
.yib-slide-terms .yib-terms span:not(.yib-rank) { line-height:1.3; }
.yib-slide-terms .yib-book-row { grid-template-columns:repeat(3,270px); justify-content:center; margin:24px 0; }
.yib-slide-terms .yib-book-row[data-count="1"] { grid-template-columns:270px; }
.yib-slide-terms .yib-book-row[data-count="2"] { grid-template-columns:repeat(2,270px); }
.yib-slide-terms figcaption { font-size:44px; line-height:1.25; text-align:center; margin-top:16px; }
.yib-slide-ratings { padding:66px 72px; }
:is(#yearInBooksStory,.yib-export-scope) .yib-slide-ratings h2 { font-size:80px; line-height:1.05; margin:12px 0 18px; }
.yib-slide-ratings .yib-kicker { font-size:32px; line-height:1.3; margin-bottom:8px; }
.yib-slide-ratings .yib-highlight-value { font-size:100px; line-height:1.1; margin:8px 0; }
.yib-rating-grid { --yib-rating-item:296px; --yib-rating-cover:220px; display:flex; flex-wrap:wrap; justify-content:center; gap:28px 24px; margin:auto 0; flex:none; }
.yib-rating-grid > .yib-cover { flex:0 0 var(--yib-rating-item); width:var(--yib-rating-item); }
.yib-rating-grid .yib-cover-image,.yib-rating-grid .yib-cover-empty { width:var(--yib-rating-cover); margin-inline:auto; }
.yib-slide-ratings figcaption { font-size:44px; line-height:1.15; margin-top:12px; text-align:center; }
.yib-rating-grid[data-count="1"] { --yib-rating-item:600px; --yib-rating-cover:600px; }
.yib-rating-grid[data-count="1"] figcaption { font-size:52px; }
.yib-rating-grid[data-count="2"] { --yib-rating-item:420px; --yib-rating-cover:410px; }
.yib-rating-grid[data-count="3"] { --yib-rating-cover:280px; }
.yib-rating-grid[data-count="4"] { --yib-rating-item:420px; --yib-rating-cover:340px; }
.yib-rating-grid:is([data-count="2"],[data-count="3"],[data-count="4"]) figcaption { font-size:48px; }
.yib-rating-grid:is([data-count="5"],[data-count="6"]) { --yib-rating-cover:280px; }
.yib-rating-grid:is([data-count="5"],[data-count="6"]) figcaption { font-size:46px; }
.yib-final-count { font-size:48px; line-height:1.8; margin:48px 0; }
.yib-final-count strong { color:#d6bc77; font-size:70px; }
.yib-slide-closing .yib-final-count { margin:24px 0; }
.yib-slide-closing .yib-breakdown { border:0; padding:16px 0; margin:0; gap:16px 24px; }
.yib-slide-closing .yib-breakdown dt { font-size:40px; }
.yib-slide-closing .yib-breakdown dd { font-size:60px; margin-top:8px; }
.yib-slide-closing .yib-copy { margin:24px 0; font-size:44px; }
.yib-support { min-width:0; overflow:auto; overscroll-behavior:contain; overflow-anchor:none; padding:12px 16px; border-left:1px solid #3b493e; scrollbar-width:thin; }
.yib-support .yib-about { margin-block:0; border-top:0; }
.yib-more { font-size:.85rem; color:#cdd5ca; margin-block:0; }
.yib-more summary { min-height:44px; align-content:center; cursor:pointer; width:fit-content; }
.yib-more summary:focus-visible,.yib-support:focus-visible { outline:3px solid #bca66b; outline-offset:-3px; }
.yib-month-details { border-top:1px solid #48534a; margin-top:12px; padding-block:8px; }
.yib-month-details h3 { color:#d6bc77; font:400 1.2rem/1.4 Georgia,serif; }
.yib-support .yib-book-row { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.yib-support .yib-cover-image,.yib-support .yib-cover-empty { box-shadow:none; }
.yib-support figcaption { font-size:.85rem; }
.yib-support figcaption span { font-size:.8rem; color:#bdc6bf; }
.yib-detail-list { padding-left:1.2rem; margin:.5rem 0 1rem; }
.yib-detail-list li { padding-block:.45rem; overflow-wrap:anywhere; }
.yib-detail-list li > span { display:block; color:#bdc6bf; margin-top:.2rem; }
.yib-full-ranking { list-style:none; padding-left:0; }
.yib-story-navigation { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:.5rem; border-top:1px solid #3b493e; padding:.6rem 1.2rem; }
.yib-prefetch { position:absolute; inset:auto 0 0; width:1px; height:1px; overflow:hidden; opacity:0; pointer-events:none; }
.yib-prefetch .yib-cover,.yib-prefetch .yib-cover-image,.yib-prefetch img { width:1px; height:1px; min-width:0; aspect-ratio:auto; }
@media(max-width:640px) {
  .yib-overview-hero { grid-template-columns:1fr; gap:1rem; }
  .yib-overview-hero > .yib-cover-fan { grid-row:1; min-height:180px; }
  .yib-overview-hero .yib-cover { max-width:105px; }
  #yearInBooksStory { width:100vw; height:100dvh; border:0; border-radius:0; }
  .yib-story-content { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) 104px; }
  .yib-support { border-left:0; border-top:1px solid #3b493e; }
  .yib-support .yib-book-row { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .yib-story-header { padding-top:max(.3rem,env(safe-area-inset-top)); padding-inline:max(1rem,env(safe-area-inset-left)) max(1rem,env(safe-area-inset-right)); }
  .yib-story-navigation { padding-bottom:max(.6rem,env(safe-area-inset-bottom)); padding-inline:max(1rem,env(safe-area-inset-left)) max(1rem,env(safe-area-inset-right)); }
}
@media(prefers-reduced-motion:reduce) { #yearInBooksStory *, #yearInBooksOverview .cover-skeleton::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
.yib-export { position:relative; margin-left:auto; }
.yib-export > [aria-disabled="true"] { opacity:.6; cursor:progress; }
.yib-export-menu { position:absolute; right:0; top:calc(100% + 4px); z-index:5; width:min(270px,calc(100vw - 48px)); padding:4px; border:1px solid #48544a; border-radius:8px; background:#202923; box-shadow:0 8px 24px #0006; }
.yib-export-menu[hidden],.yib-export-status[hidden] { display:none; }
.yib-export-menu button { display:block; width:100%; min-height:44px; text-align:left; padding:8px 12px; font:inherit; font-size:.875rem; border:0; border-radius:4px; background:transparent; color:#f3f2e9; cursor:pointer; }
.yib-export-menu button:hover,.yib-export-menu button:focus-visible { background:#354239; outline:2px solid #bca66b; outline-offset:-2px; }
.yib-export-status { font-size:.8rem; color:#bdc6bf; padding-block:4px; overflow-wrap:anywhere; }
.yib-export-scope { position:fixed; top:0; left:-12000px; width:1080px; height:1920px; --yib-accent:#d6bc77; --yib-ink:#f3f2e9; --yib-muted:#bdc6bf; font:48px/1.5 system-ui,sans-serif; }
.yib-export-scope,.yib-export-scope * { box-sizing:border-box; }
.yib-export-scope *,.yib-export-scope ::before,.yib-export-scope ::after { animation:none!important; transition:none!important; }
/* Capture uses full text, not WebKit's clipped viewer excerpts. Keep line boxes
   non-shrinking and leave glyph/descender room for the canvas text renderer. */
.yib-export-scope .yib-slide > * { flex-shrink:0; }
.yib-export-scope .yib-slide .yib-number { line-height:1.2; margin-bottom:40px; overflow-wrap:normal; }
/* Metric numerals need extra descent room in the rasterized Georgia font. */
.yib-export-scope .yib-slide-length .yib-number { line-height:1.3; margin-bottom:80px; }
.yib-export-scope .yib-slide .yib-unit { line-height:1.4; }
.yib-export-scope .yib-slide figcaption { line-height:1.4; padding-bottom:8px; }
.yib-export-scope .yib-slide figcaption strong,
.yib-export-scope .yib-terms strong { display:block; -webkit-line-clamp:unset; overflow:visible; padding-bottom:8px; }
.yib-export-scope .yib-terms strong { line-height:1.4; }
@media print { .yib-export,.yib-export-status,.yib-export-scope { display:none!important; } }
