  body{ min-height:100dvh;display:flex;flex-direction:column }
  main{flex:1 0 auto}
  a{ color:inherit; text-decoration:none; }
  .wrap{ margin:0 auto; padding:0 var(--s6); }
  .grid{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,340px); gap:var(--s5); padding-bottom:var(--s9); align-items:start; }
  .page-title{ margin:0 0 var(--s3); font-size:var(--t-title); font-weight:800; letter-spacing:var(--h-track); overflow-wrap:anywhere; }
  .drum-title{display:flex;align-items:flex-end;min-width:0;max-width:100%;gap:14px;margin:0 0 24px;font-weight:500;line-height:1.06}
  .drum-count{flex:none;white-space:nowrap;overflow-wrap:normal;word-break:normal;font-size:2.15em;line-height:.9;color:var(--link);font-variant-numeric:lining-nums tabular-nums;letter-spacing:-.03em}
  .drum-d{display:inline-block;width:calc(1ch - .03em);text-align:center;letter-spacing:0}
  .drum-pending .drum-count,.drum-pending .drum-words{visibility:hidden}
  .drum-words{display:flex;flex-direction:column;align-items:flex-start;flex:0 1 auto;min-width:0;max-width:100%;position:relative}
  .drum-books-i{display:block}
  .drum-count,.drum-books-i,.drum-btn{-webkit-text-size-adjust:none;text-size-adjust:none}
  .drum-pick{position:relative;display:block;max-width:100%;width:100%}
  .drum-btn{display:flex;align-items:flex-start;gap:8px;min-height:44px;text-align:left;touch-action:pan-x;font:inherit;font-weight:inherit;letter-spacing:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .drum-btn,.drum-panel button{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
  .drum-btn:focus{outline:none;box-shadow:none}
  .drum-btn:focus-visible .drum-wheel{box-shadow:0 2px 0 var(--link)}
  .drum-btn{max-width:100%}
  .drum-wheel{position:relative;display:block;height:1.2em;overflow:hidden;overflow:clip;min-width:0;flex:0 1 auto}
  .drum-wheel-list{display:block}
  .drum-wheel-list>span{display:block;height:1.2em;line-height:1.2em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  @media(max-width:359px){[data-hearth] h1.drum-title{gap:10px;font-size:24px}}
  @media(max-width:279px){[data-hearth] h1.drum-title{font-size:19px}}
  @media(prefers-reduced-motion:no-preference){.drum-wheel-list{transition:transform .36s cubic-bezier(.3,.8,.2,1)}}
  .drum-chevs{display:inline-grid;margin-top:.34em;color:var(--link);flex:none}
  .drum-chevs svg{width:.56em;height:.56em;stroke-width:2.2}
  .drum-panel{position:absolute;z-index:8;top:calc(100% + 4px);left:-14px;display:block;min-width:min(292px,calc(100vw - 32px));max-height:60svh;overflow:auto;background:var(--surf-2);border:1px solid var(--hair);border-radius:8px;padding:6px;box-shadow:0 14px 30px -16px rgba(40,24,10,.45);opacity:0;transform:scaleY(.86);transform-origin:50% 0;pointer-events:none}
  @media(prefers-reduced-motion:no-preference){.drum-panel{transition:opacity .16s ease-out,transform .2s cubic-bezier(.2,.8,.2,1)}}
  .drum-panel.on{opacity:1;transform:none;pointer-events:auto}
  .drum-panel[hidden]{display:none}
  .drum-panel button{display:flex;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:0 14px;gap:20px;text-align:left;font-size:20px;font-weight:500;color:var(--ink-2);background:none;border:0;border-radius:4px;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .drum-panel button:focus{outline:none;box-shadow:none}
  .drum-panel button:focus-visible{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:5px}
  .drum-panel .drum-row-count{font-variant-numeric:lining-nums tabular-nums}
  .drum-panel{max-width:calc(100vw - 24px)}
  .drum-panel button{flex-wrap:wrap;row-gap:0}
  .drum-panel button > span:first-child{flex:1 1 0;max-width:100%;overflow-wrap:break-word}
  .drum-panel .drum-row-count{flex:0 0 auto;margin-left:auto;white-space:nowrap;overflow-wrap:normal}
  .drum-panel button[aria-selected="true"]{color:var(--ink)}
  .drum-panel button[aria-selected="true"] .drum-row-count{color:var(--link)}
  .drum-panel .drum-extra-first{border-top:1px solid var(--hair);border-radius:0 0 4px 4px;margin-top:4px;padding-top:4px}
  @media(hover:hover){.drum-panel button:hover{background:var(--hair)}}
  .import-actions{display:flex;gap:var(--s3);flex-wrap:wrap}
  .head-row{ display:flex; align-items:flex-end; justify-content:space-between; gap:var(--s4); flex-wrap:wrap; margin-bottom:var(--s3); }
  .head-row :is(h2,h3){ margin:0; font-size:var(--t-sect); font-weight:800; letter-spacing:var(--h-track); display:flex; align-items:center; overflow-wrap:anywhere; }
  .shelf-popover .head-row h2{ font-family:var(--serif); font-size:var(--t-sect); font-weight:800; line-height:inherit; letter-spacing:var(--h-track); text-transform:none; color:inherit; }
  .head-row .count{ font-size:var(--t-label); color:var(--ink-3); letter-spacing:normal; }
  .head-row .actions{ display:inline-flex; align-items:center; gap:var(--s3); position:relative; }
  .lock{ width:12px; height:12px; margin-right:6px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:2; }
  .shelfgrid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(132px,1fr)); gap:var(--s3) var(--s3); padding:var(--s3) var(--s4); }
  .shelfgrid.sparse{ display:flex; flex-wrap:wrap; }
  .shelfgrid.sparse > *{ width:132px; flex:0 0 auto; }
  .stile{ position:relative; display:flex; flex-direction:column; gap:6px; }
  .rrow{ position:relative; display:flex; flex-direction:column; gap:6px; }
  .stile .cover[data-media-work], .rrow .cover[data-media-work]{ width:100%; height:auto; aspect-ratio:2/3; object-fit:cover; border-radius:var(--r-in);corner-shape:squircle; box-shadow:var(--sh-cover); background:var(--surf-3); }
  .stile .t, .rrow .t{ min-width:0; }
  .stile .t h3, .rrow .t h3{ margin:0; font-size:var(--t-sect); font-weight:700; letter-spacing:var(--h-track); line-height:1.25; overflow-wrap:anywhere; }
  .rrow .t h3 a, .stile .t h3 a{ position:relative; display:inline-block; min-width:44px; min-height:24px; padding-block:11px; margin-block:-11px; }
  .stile .t p, .rrow .t p{ margin:2px 0 0; font-size:var(--t-label); font-weight:540; color:var(--ink-3); overflow-wrap:anywhere; letter-spacing:normal; }
  .rrow .t .prev{ position:relative; display:block; padding-block:13.25px; margin:calc(var(--s1) - 13.25px) 0 -13.25px; font-size:var(--t-label); line-height:1.35; color:var(--ink-3); font-style:italic; letter-spacing:normal; }
  .rrow .t .prev span{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .rrow .score{ position:absolute; top:8px; right:8px; background:var(--ink); color:var(--ground); font-size:var(--t-label); font-weight:800; padding:3px 9px; border-radius:var(--r-pill); box-shadow:var(--sh-1); letter-spacing:normal; }
  .rrow .score sub{ font-size:12px; font-weight:650; opacity:.75; margin-left:1px; }
  .rrow .unscored{ font-size:var(--t-label); font-style:italic; color:var(--ink-3); max-width:none; text-align:left; letter-spacing:normal; }
  .tlist{ position:relative; }
  .trow{ position:relative; display:flex; align-items:center; gap:var(--s4); padding:var(--s2) var(--s5); min-height:126px; }
  .trow + .trow{ border-top:1px solid var(--hair-soft); }
  .trow.dragging{ opacity:.55; box-shadow:0 14px 28px -10px rgba(20,14,8,.35); transform:scale(1.015); background:var(--surf); border-radius:var(--r-chip);corner-shape:squircle; z-index:2; }
  .trow.drop-before{ box-shadow:inset 0 3px 0 var(--link); }
  .trow.drop-after{ box-shadow:inset 0 -3px 0 var(--link); }
  .tag{ width:44px; flex:0 0 auto; display:flex; flex-direction:column; align-items:center; gap:3px; }
  .tag .n{ width:28px; height:28px; border-radius:var(--r-pill); background:var(--butter); color:var(--ink-on-accent); display:grid; place-items:center; font-size:var(--t-label); font-weight:800; letter-spacing:normal; }
  .trow.is-now .tag .n{ box-shadow:0 0 0 4px var(--butter-soft); }
  .trow .cover[data-media-work]{ width:78px; height:117px; flex:0 0 auto; object-fit:cover; background:var(--surf-3); border-radius:var(--r-in);corner-shape:squircle; box-shadow:var(--sh-cover); }
  .trow .t{ flex:1; min-width:0; }
  .trow .t h3{ margin:0; line-height:1.25; font-size:var(--t-sect); font-weight:700; letter-spacing:var(--h-track); display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; white-space:normal; }
  .trow .t p{ margin:3px 0 0; font-size:var(--t-label); font-weight:540; color:var(--ink-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; letter-spacing:normal; }
  .trow .grip{ width:32px;min-height:44px; flex:0 0 auto; display:grid;align-content:center;justify-content:start; gap:var(--s1); padding:0 6px; cursor:grab; }
  .trow .grip i{ display:block;width:4px;height:4px;border-radius:var(--r-pill);background:var(--ink-3);color:var(--ink-3);box-shadow:7px 0 0 currentColor;opacity:.55 }
  .trow .reorder-btns{ width:44px; flex:0 0 auto; display:flex; flex-direction:column; gap:var(--s3); }
  .trow .reorder-btns button{
    width:44px; min-width:44px; height:44px; flex-shrink:0; padding:0; border-radius:var(--r-chip);corner-shape:squircle; background-color:var(--surf-2); border:0; color:var(--ink-3);
    display:grid; place-items:center; font-size:var(--t-label); line-height:1; cursor:pointer; letter-spacing:normal; }
  .trow .reorder-btns button:focus-visible{ background-color:var(--butter-soft); color:var(--ink); }
  .trow .reorder-btns button:disabled{ opacity:.3; cursor:default; }
  .trow .remove{
    width:44px; height:44px; flex:0 0 auto; border-radius:var(--r-pill); background:transparent; border:0;
    display:grid; place-items:center; font-size:var(--t-body); line-height:1; color:var(--ink-3); cursor:pointer;
    transition:opacity 220ms var(--ease-out-quart); letter-spacing:normal; }
  @media (hover:hover) and (pointer:fine){ .trow .remove{ opacity:.7; } }
  .trow .remove:focus-visible{ opacity:1; background:var(--rose-soft); color:var(--rose-ink); }
  @media (max-width:600px){
    .trow{ display:grid; grid-template-columns:78px 28px minmax(0,1fr) 44px; grid-template-areas:"cover t t remove" "cover tag btns remove"; column-gap:var(--s4); row-gap:6px; align-items:center; }
    .trow .grip{ display:none; }
    .trow > .cover{ grid-area:cover; }
    .trow .t{ grid-area:t; align-self:end; }
    .trow .tag{ grid-area:tag; width:auto; height:44px; flex-direction:row; align-items:center; align-self:start; }
    .trow .reorder-btns{ grid-area:btns; width:auto; flex-direction:row; gap:6px; align-self:start; justify-self:start; }
    .trow .remove{ grid-area:remove; }
  }
  @media (max-width:359px){
    .trow{ grid-template-columns:56px minmax(0,1fr) 44px; grid-template-areas:"cover t t" "cover tag tag" "btns btns remove"; column-gap:var(--s3); padding-inline:var(--s2); }
    .trow .cover[data-media-work]{ width:56px; height:84px; }
  }
  .empty-shelf{ grid-column:1/-1; padding:var(--s6); text-align:center; color:var(--ink-3); font-size:var(--t-body); letter-spacing:normal; }
  .grid.no-aside{ grid-template-columns:minmax(0,1fr); }
  .grid.no-aside aside{ display:none; }
  #reading-now-section{--reading-tile-height:206px;--reading-row-height:390px;--reading-section-height:476px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s6);min-height:var(--reading-section-height);min-width:0}
  .reading-box{min-width:0;background:var(--surf);border-radius:var(--r-card);corner-shape:squircle;box-shadow:var(--sh-1);padding:var(--s6)}
  .reading-box .head-row{min-height:26px;margin-bottom:var(--s3)}
  .reading-box h2{line-height:26px}
  #reading-now-row,#recently-read-row{display:flex;flex-wrap:nowrap;align-items:start;gap:var(--s4);width:100%;max-width:100%;height:var(--reading-row-height);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-padding-inline:0;overscroll-behavior-x:contain;touch-action:pan-x pan-y;scrollbar-width:none;mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent);-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent)}
  #recently-read-row{--reading-row-height:206px}
  #reading-now-row::-webkit-scrollbar,#recently-read-row::-webkit-scrollbar{display:none}
  #reading-now-row:focus-visible,#recently-read-row:focus-visible{outline:2px solid var(--link);outline-offset:2px;-webkit-mask-image:none;mask-image:none}
  #reading-now-row:focus-visible,#recently-read-row:focus-visible{text-decoration:none!important}
  @media (pointer:coarse){ #shelf-bay .bs-wall .bs-slot{ --slot-width:max(24px,var(--thick)) !important; } }
  #reading-now-row .reading-book-button:focus-visible,#recently-read-row [data-reading-sheet]:focus-visible{outline-offset:-2px}
  .reading-now-placeholder{width:200px;height:var(--reading-row-height);flex:0 0 auto;border-radius:var(--r-chip);corner-shape:squircle}
  #reading-now-section[aria-busy="false"] .reading-now-placeholder{display:none}
  [data-height-hint]{overflow-anchor:none}
  html[data-reading-empty] #reading-now-section{display:none}
  .reading-now-tile{display:grid;grid-template-columns:46px minmax(0,1fr);grid-template-rows:180px 24px;gap:2px var(--s3);width:min(184px,100%);min-width:0;height:var(--reading-tile-height);flex:0 0 min(184px,100%);scroll-snap-align:start}
  .reading-now-tile.current-book{display:flex;flex-direction:column;width:min(200px,100%);height:var(--reading-row-height);flex:0 0 min(200px,100%)}
  .current-book .reading-book-button{display:block;width:100%;height:236px;text-align:left;position:relative}
  .current-book .object{display:flex;align-items:end;position:relative;height:236px;gap:var(--s1);padding-inline:var(--s2);transform-origin:center bottom}
  .current-book .front{display:block;position:relative;width:144px;height:216px;transform:perspective(800px) rotateY(-8deg);transform-origin:left center}
  @media(prefers-reduced-motion:reduce){.current-book .front{transform:none}}
  .current-book .front img{width:100%;height:100%;object-fit:cover;border-radius:var(--r-cover);corner-shape:squircle;box-shadow:var(--sh-cover);background:var(--surf-3)}
  .current-book .spine{height:216px;width:28px;flex:0 0 28px;border:1px solid var(--hair);background:var(--spine-ground,var(--butter-soft));color:var(--spine-ink,var(--ink));border-radius:var(--r-strip-cover);corner-shape:squircle;writing-mode:vertical-rl;display:flex;align-items:center;justify-content:space-between;padding:var(--s3) var(--s1);box-shadow:var(--sh-1);overflow:hidden}
  .current-book .spine strong{font-size:var(--t-label);white-space:nowrap;max-height:168px;overflow:hidden;text-overflow:ellipsis}
  .current-book .spine i{height:var(--s3);width:var(--s3);border-top:1px solid currentColor;border-bottom:1px solid currentColor;opacity:.7}
  .current-book .t{margin-top:var(--s2)}
  .current-book .cover-media-badge{top:auto;bottom:var(--s1);right:var(--s1)}
  .reading-now-tile .resume-link{display:inline-flex;align-items:center;min-height:44px;margin-top:var(--s2);color:var(--link);font-weight:600;text-decoration:none}
  .reading-now-tile .resume-link:focus-visible{outline:2px solid var(--link);outline-offset:2px}
  .reading-now-tile .t{min-width:0}
  .reading-now-tile h3{margin:0;font-size:var(--t-sect);letter-spacing:var(--h-track);line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
  .reading-now-tile h3 button{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-width:44px;min-height:24px;padding-block:1.5px;margin-block:-1.5px;text-align:left}
  .reading-now-tile p.by{margin:2px 0 0;font-size:var(--t-label);color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .reading-now-caption{grid-column:1/-1;min-width:0;height:24px}
  .reading-now-tile .meter{margin:0;height:2px;width:100%}
  .reading-now-tile .prog-line{margin:0;font-size:var(--t-label);line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  @media(max-width:640px){
    #reading-now-section{grid-template-columns:minmax(0,1fr);--reading-section-height:792px}
    .reading-now-tile{width:calc(100% - 56px);flex-basis:calc(100% - 56px)}
    .reading-now-tile.current-book{width:min(200px,calc(100% - 56px));flex-basis:min(200px,calc(100% - 56px))}
  }
  .dnf-toggle{ display:flex; align-items:center; gap:var(--s2); width:100%; padding:var(--s4) var(--s5); background:none; border:0; cursor:pointer; text-align:left; font:inherit; color:var(--ink-2); font-size:var(--t-label); font-weight:650; letter-spacing:normal; }
  .dnf-toggle:focus-visible{ color:var(--ink); }
  .dnf-toggle .chev{ width:12px; height:12px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:2; transition:transform 220ms var(--ease-out-quart); }
  .dnf-toggle[aria-expanded="true"] .chev{ transform:rotate(90deg); }
  .dnf-toggle .count{ color:var(--ink-3); font-weight:540; }
  .iconbtn-mini{ width:32px; height:32px; border-radius:var(--r-pill); background:transparent; border:0; display:grid; place-items:center; color:var(--ink-3); cursor:pointer; }
  .iconbtn-mini:focus-visible{ background:var(--surf-2); color:var(--ink); }
  .iconbtn-mini svg{ width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
  .shelf-menu{ position:absolute; top:100%; right:0; margin-top:6px; background:var(--surf); border-radius:var(--r-in);corner-shape:squircle; box-shadow:var(--sh-2); padding:6px; display:flex; flex-direction:column; min-width:128px; z-index:5; }
  .shelf-menu button{ text-align:left; min-height:44px; padding:9px 10px; border-radius:var(--r-chip);corner-shape:squircle; background:transparent; border:0; font-size:var(--t-label); font-weight:600; color:var(--ink-2); cursor:pointer; letter-spacing:normal; }
  .rename-row, .confirm-row{ align-items:center; }
  .rename-form{ display:flex; align-items:center; gap:var(--s3); flex:1 1 auto; flex-wrap:wrap; }
  .rename-input{ flex:1 1 200px; min-width:140px; height:44px; padding:0 15px; border-radius:var(--r-pill); border:1px solid var(--ink-3); background:var(--surf-2); color:var(--ink); font-size:var(--t-body); font-weight:700; font-family:inherit; letter-spacing:normal; }
  .confirm-text{ margin:0; font-size:var(--t-label); color:var(--ink-2); flex:1 1 auto; letter-spacing:normal; }
  .shelf-inline-btn{ display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 var(--s4); border-radius:var(--r-pill); font-weight:700; font-size:var(--t-label); cursor:pointer; border:0; letter-spacing:normal; }
  .shelf-inline-btn.save{ background:var(--butter-soft); color:var(--ink); }
  .shelf-inline-btn.save:focus-visible{ background:var(--butter); color:var(--ink-on-accent); }
  .shelf-inline-btn.cancel{ background:transparent; color:var(--ink-2); border:1px solid var(--hair); }
  .shelf-inline-btn.cancel:focus-visible{ background:var(--surf-2); color:var(--ink); }
  .shelf-inline-btn.delete{ background:var(--rose-soft); color:var(--rose-ink); }
  .shelf-inline-btn.delete:focus-visible{ background:var(--rose); color:var(--ink); }
  .new-shelf{ padding:var(--s5); }
  .new-shelf h3{ margin:0 0 var(--s3); font-size:var(--t-sect); font-weight:800; letter-spacing:var(--h-track); }
  .new-shelf form{ display:flex; flex-wrap:wrap; gap:var(--s3); align-items:center; }
  .new-shelf input[type=text]{ flex:1 1 180px; min-width:140px; height:44px; padding:0 15px; border-radius:var(--r-pill); border:1px solid var(--ink-3); background:var(--surf-2); color:var(--ink); font-size:var(--t-body); font-family:inherit; letter-spacing:normal; }
  .new-shelf .form-error{ flex:1 1 100%; margin:0; color:var(--rose-ink); font-size:var(--t-label); font-weight:650; letter-spacing:normal; }
  .priv-toggle{ min-width:44px; min-height:44px; display:inline-flex; align-items:center; gap:7px; font-size:var(--t-label); font-weight:600; color:var(--ink-2); cursor:pointer; letter-spacing:normal; }
  .priv-toggle input{ appearance:none; -webkit-appearance:none; width:18px; height:18px; margin:0; border-radius:var(--r-cover);corner-shape:squircle; border:1.5px solid var(--hair); background:var(--surf); display:inline-grid; place-items:center; cursor:pointer; transition:background-color var(--d-quick) var(--ease-quick),border-color var(--d-quick) var(--ease-quick); }
  .priv-toggle input::before{ content:''; width:10px; height:6px; border:2px solid var(--ink-on-accent); border-top:0; border-right:0; transform:rotate(-45deg) translate(1px,-1px); opacity:0; transition:opacity var(--d-quick) var(--ease-quick); }
  .priv-toggle input:checked{ background:var(--butter); border-color:var(--butter); }
  .priv-toggle input:checked::before{ opacity:1; }
  @media (prefers-reduced-motion:reduce){ .priv-toggle input, .priv-toggle input::before{ transition:none; } }
  .assist{ padding:var(--s5); }
  .assist h3{ margin:0; font-size:var(--t-sect); letter-spacing:var(--h-track); }
  .assist p{ font-size:var(--t-label); line-height:1.55; color:var(--ink-2); margin:6px 0 0; letter-spacing:normal; }
  .assist .assist-count{ margin:0; font-size:var(--t-sect); font-weight:700; color:var(--ink); letter-spacing:var(--h-track); line-height:normal; }
  .grid:has(> div > details.shelf-section:not([open])){ grid-template-columns:minmax(0,1fr); }
  .grid:has(> div > details.shelf-section:not([open])) > .rail{ order:-1; }
  @media (min-width:981px){
    .grid:has(> div > details.shelf-section:not([open])) .assist{ display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; column-gap:var(--s6); }
  }
  .duel{ display:flex; align-items:stretch; justify-content:center; gap:var(--s3); margin-top:var(--s5); }
  .duel-pick{ text-align:center; width:110px; min-width:0; display:flex; flex-direction:column; overflow-wrap:anywhere; }
  .duel-q{ margin:var(--s4) 0 0; text-align:center; font-size:var(--t-label); color:var(--ink-2); letter-spacing:normal; }
  .duel-pick img{ width:110px; height:165px; object-fit:cover; background:var(--surf-3); border-radius:var(--r-chip);corner-shape:squircle; margin:0 auto; }
  .duel-pick b{ display:block; margin-top:var(--s2); font-size:var(--t-label); line-height:1.3; letter-spacing:normal; }
  .duel-pick span{ display:block; font-size:var(--t-label); color:var(--ink-3); margin-top:2px; margin-bottom:10px; letter-spacing:normal; }
  .duel-pick button{ display:block; width:100%; min-height:44px; margin:auto 0 0; padding:0 10px; border-radius:var(--r-pill); background:var(--surf-2); font-weight:700; font-size:var(--t-label); letter-spacing:normal; }
  .duel-or{ align-self:center; padding-top:70px; color:var(--ink-3); font-style:italic; font-size:var(--t-label); letter-spacing:normal; }
  #duel-area [data-result][aria-disabled="true"]{ opacity:.5; cursor:not-allowed; }
  #duel-area [data-result][aria-busy="true"]{ cursor:progress; }
  .duel-skip{ min-height:44px; width:100%; color:var(--link); margin-top:var(--s4); background:none; border:0; cursor:pointer; font-size:var(--t-label); letter-spacing:normal; }
  .duel-progress:empty{ display:none; }
  .duel-progress{ font-size:var(--t-label); color:var(--ink-3); margin-top:var(--s3); text-align:center; letter-spacing:normal; }
  .duel-result{ margin-top:var(--s4); text-align:center; }
  .duel-result .done-line{ font-size:var(--t-body); color:var(--ink-2); margin:0 0 var(--s4); letter-spacing:normal; }
  .duel-result button{ min-height:44px; padding:0 var(--s5); border-radius:var(--r-pill); background:var(--butter); color:var(--ink-on-accent); font-weight:700; border:0; cursor:pointer; }
  .rail > * + *{ margin-top:var(--s5); }
  .toast{ max-width:min(560px, calc(100vw - 2 * var(--s4))); }
  .loading{ padding:var(--s5) 0; text-align:center; color:var(--ink-3); font-size:var(--t-body); letter-spacing:normal; }
  @media (max-width:980px){ .grid{ grid-template-columns:minmax(0,1fr); } }
  #spine-library{--shelf-system-count:3;--shelf-directory-row-height:44px;--shelf-directory-floor:calc(var(--shelf-system-count) * var(--shelf-directory-row-height) + (var(--shelf-system-count) - 1) * var(--s1));--shelf-spine-height:190px;--shelf-spine-row-top:var(--s6);--shelf-spine-row-bottom:var(--s7);--shelf-spine-row-height:calc(var(--shelf-spine-height) + var(--shelf-spine-row-top) + var(--shelf-spine-row-bottom));--shelf-bay-floor-rows:3;--shelf-bay-heading-height:calc(var(--t-title) * 1.45 + 4px + var(--t-label) * 1.45 + var(--s3));--shelf-bay-footer-height:calc(44px + var(--s2) + var(--s3));--shelf-bay-floor:calc(var(--shelf-bay-floor-rows) * var(--shelf-spine-row-height) + (var(--shelf-bay-floor-rows) - 1) * var(--s2) + var(--shelf-bay-heading-height) + var(--shelf-bay-footer-height));display:grid;grid-template-columns:200px minmax(0,1fr);grid-template-areas:"directory bay";gap:var(--s5);align-items:start;margin:var(--s5) 0}
  #shelf-directory{grid-area:directory;min-width:0;display:flex;flex-direction:column;gap:var(--s1)}
  #shelf-directory[aria-busy="true"]{min-height:var(--shelf-directory-floor)}
  #shelf-directory button{display:flex;align-items:center;justify-content:space-between;gap:var(--s2);width:100%;min-height:var(--shelf-directory-row-height);padding:var(--s2) var(--s3);border:1px solid transparent;border-radius:var(--r-chip);corner-shape:squircle;background:transparent;color:var(--ink-2);font:inherit;font-size:var(--t-label);text-align:left;touch-action:manipulation;cursor:pointer}
  #shelf-directory button[aria-current="true"]{background:var(--butter-soft);border-color:var(--hair);color:var(--ink);font-weight:750}
  #shelf-directory button:focus-visible{outline:2px solid var(--link);outline-offset:2px}
  #shelf-directory strong{font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
  #shelf-directory .directory-name{overflow-wrap:anywhere}
  #shelf-directory .directory-count{flex-shrink:0}
  .sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
  .directory-placeholder{height:var(--shelf-directory-row-height);flex-shrink:0;border-radius:var(--r-chip);corner-shape:squircle}
  #shelf-directory[data-height-hint] .directory-placeholder{display:none}
  #shelf-bay{grid-area:bay;min-width:0;position:relative}
  #shelf-bay[aria-busy="true"]{min-height:var(--shelf-bay-floor)}
  .shelf-bay-skeleton{padding:var(--shelf-bay-heading-height) var(--s3) var(--shelf-bay-footer-height);border-radius:var(--r-card);corner-shape:squircle}
  .shelf-spine-placeholder{height:var(--shelf-spine-row-height);padding:var(--shelf-spine-row-top) var(--s4) var(--shelf-spine-row-bottom);}
  .shelf-spine-placeholder::before{content:none;display:block;width:44px;height:var(--shelf-spine-height);border-radius:var(--r-chip);corner-shape:squircle}
  .shelf-spine-placeholder + .shelf-spine-placeholder{margin-top:var(--s2)}
  #shelf-bay[data-height-hint] > .shelf-bay-skeleton{position:absolute;inset:0;overflow:hidden}
  #shelf-directory[aria-busy="false"],#shelf-bay[aria-busy="false"]{min-height:0}
  #shelf-bay[aria-busy="false"] > .shelf-bay-skeleton{display:none}
  body #spine-library .bs-wall .bs-rail{min-height:0}
  #loading{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}
  @media(max-width:640px){
    #spine-library{--shelf-directory-floor:calc(var(--shelf-directory-row-height) + 2 * var(--s1));--shelf-bay-heading-height:calc(var(--t-title) * 1.45 + 4px + var(--t-label) * 1.45 + var(--s3) + var(--s2) + 50px);grid-template-columns:minmax(0,1fr);grid-template-areas:"directory" "bay"}
    #shelf-directory{flex-direction:row;overflow-x:auto;touch-action:pan-x pan-y;padding:var(--s1) 0;mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent);-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 40px),transparent)}
    #shelf-directory button{flex:0 0 auto;width:auto;border-radius:var(--r-pill)}
    .directory-placeholder{min-width:120px}
  }
  .shelf-heading{display:flex;align-items:center;gap:var(--s2);flex-wrap:wrap;margin-bottom:var(--s3)}
  #new-shelf-open{grid-auto-flow:column;gap:4px}
  @media(max-width:600px){.shelf-heading .page-title{flex-basis:100%}.shelf-heading .shelf-tool:first-of-type{margin-left:-8px}}
  .shelf-heading .page-title{margin:0}
  .shelf-tool{display:inline-grid;place-items:center;min-width:44px;min-height:44px;padding:0 var(--s2);border:0;border-radius:var(--r-pill);background:transparent;color:var(--ink-3);font:inherit;font-size:var(--t-label);letter-spacing:normal;touch-action:manipulation}
  .shelf-tool:focus-visible{background:var(--surf-2);color:var(--ink)}
  @media (hover:hover) and (pointer:fine){
    .rrow:hover .t .prev{color:var(--ink-2)}
    .trow .reorder-btns button:hover:not(:disabled){background-color:var(--butter-soft);color:var(--ink)}
    .trow:hover .remove,.trow .remove:focus-visible{opacity:1}
    .trow .remove:hover{background:var(--rose-soft);color:var(--rose-ink)}
    .dnf-toggle:hover{color:var(--ink)}
    .iconbtn-mini:hover{background:var(--surf-2);color:var(--ink)}
    .shelf-menu button:hover{background:var(--surf-2);color:var(--ink)}
    .shelf-inline-btn.save:hover{background:var(--butter);color:var(--ink-on-accent)}
    .shelf-inline-btn.cancel:hover{background:var(--surf-2);color:var(--ink)}
    .shelf-inline-btn.delete:hover{background:var(--rose);color:var(--ink)}
    .shelf-tool:hover{background:var(--surf-2);color:var(--ink)}
  }
  @media (prefers-reduced-motion:no-preference){
    .shelf-tool,#shelf-directory button{transition:transform var(--d-press) var(--ease-press)}
    .shelf-tool:active:not(:focus-visible),#shelf-directory button:active:not(:focus-visible){transform:scale(.97)}
  }
  .shelf-popover{position:fixed;inset:auto;margin:0;width:360px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;border:1px solid var(--hair);border-radius:var(--r-card);corner-shape:squircle;background:var(--surf);color:var(--ink);box-shadow:var(--sh-3)}
  .shelf-popover .head-row{align-items:center}.shelf-popover h3{margin:0}
  html[data-shelf-pointer] #bs-sheet-book-title:focus,#bs-sheet-book-title:focus:not(:focus-visible){outline:none}
  #bs-sheet-book-title:focus-visible{outline:2px solid var(--link);outline-offset:var(--s1)}
  @media(prefers-reduced-motion:reduce){.trow .remove,.dnf-toggle .chev{transition:none}}
