/* Alexandra O — app shell. Colours sampled from the reference: paper #F5F5F2, ink #161714. */
:root {
  --bg: #F6EEE2;
  --bg-raised: #FAF4EA;
  --surface: #ECE1D3;
  --surface-2: #E3D5C1;
  --menu: rgba(246, 238, 226, .97);
  --line: #E3D5C1;
  --line-strong: #D6C4AC;
  --text: #362316;
  --text-2: #4A3526;
  --muted: #7D6857;
  --faint: #947F6D;
  --text-muted: #6B5443;
  --accent: #F8CD5F; /* text grey: 5.2:1 on --bg, 4.8:1 on --surface (WCAG AA). --muted/--faint stay for non-text */
  --danger: #C9302C;
  --danger-soft: #E7A2A0;
  --btn-dark: #362316;
  --btn-dark-text: #F6EEE2;
  --scrim: rgba(28, 28, 26, .24);
  --shadow-menu: 0 12px 40px rgba(20, 20, 18, .14), 0 1px 3px rgba(20, 20, 18, .08);
  --shadow-cover: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 14px rgba(0, 0, 0, .10);
  --flap-edge: #DCCDB8;
  --flap-mid: #EFE5D6;
  --flap-fold: #FBF6ED;
  --mark: rgba(248, 216, 74, .55);
  --f-display: "Lora", Georgia, "Times New Roman", serif;
  --f-ui: "Jost", "Golos Text", system-ui, -apple-system, sans-serif;
  --f-text: "Public Sans", "Golos Text", system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --tabbar-h: 68px;
  --gutter: 20px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #161615;
  --bg-raised: #1E1E1C;
  --surface: #232321;
  --surface-2: #2B2B29;
  --menu: rgba(40, 40, 38, .97);
  --line: #353532;
  --line-strong: #474744;
  --text: #EDEDE8;
  --text-2: #CFCFCA;
  --muted: #A3A39E;
  --faint: #8A8A85;
  --text-muted: #A3A39E;
  --danger: #FF7A72;
  --danger-soft: #8C4B48;
  --btn-dark: #EDEDE8;
  --btn-dark-text: #161615;
  --scrim: rgba(0, 0, 0, .5);
  --shadow-menu: 0 12px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .05);
  --shadow-cover: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 18px rgba(0, 0, 0, .35);
  --flap-edge: #2A2A28;
  --flap-mid: #222220;
  --flap-fold: #1B1B1A;
  --mark: rgba(248, 216, 74, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100%; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--f-ui); font-size: 17px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow: hidden; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; }
input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; line-height: 0; }
.ico svg { display: block; }

/* ---------- shell ---------- */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.view {
  flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding: calc(var(--sat) + 14px) calc(var(--gutter) + var(--sar)) calc(var(--tabbar-h) + var(--sab) + 28px) calc(var(--gutter) + var(--sal));
}
.view > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
body.reading .app { visibility: hidden; }

/* ---------- library head ---------- */
.lib-head { padding-top: 30px; }
.lib-head-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 52px; }
.lib-head-row > .title-btn { justify-self: start; }
.lib-head-row > .text-btn { justify-self: end; grid-column: 3; }
.lib-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0; grid-column: 3; }
.lib-sig { grid-column: 2; width: clamp(84px, 26vw, 150px); aspect-ratio: 4287 / 1943; background: var(--text); -webkit-mask: url(/img/signature.svg) center / contain no-repeat; mask: url(/img/signature.svg) center / contain no-repeat; }
.author-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 52px; height: 44px; padding: 0 4px; color: var(--text); border-radius: 12px; }
.author-btn:active { background: var(--surface); }
.author-mark { width: 24px; height: 18px; background: currentColor; -webkit-mask: url(/img/mark.svg) center / contain no-repeat; mask: url(/img/mark.svg) center / contain no-repeat; }
.author-label { font-size: 11px; line-height: 1; letter-spacing: .02em; color: var(--text-muted); white-space: nowrap; }
.lib-wave { color: var(--line-strong); width: 100%; margin: 10px auto 0; line-height: 0; }
.lib-wave svg { display: block; }
@media (max-width: 640px) {
  .lib-head-row { row-gap: 2px; }
  .lib-head-row > .lib-sig { grid-row: 1; }
  .lib-head-row > .lib-actions, .lib-head-row > .text-btn { grid-row: 1; }
  .lib-head-row > .title-btn { grid-row: 2; grid-column: 1 / -1; }
}
.author-photo { display: block; width: min(100%, 360px); height: auto; margin: 0 auto 18px; }
.author-bio { font-size: 18px; line-height: 1.55; color: var(--text-2); margin: 0; }
.title-btn { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; text-align: left; padding: 2px 4px 2px 0; border-radius: 8px; }
.display-title { font-family: var(--f-display); font-weight: 400; font-size: 32px; line-height: 1.1; letter-spacing: -.01em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-chev { color: var(--muted); transform: translateY(-3px); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text); flex: none; }
.icon-btn.sm { width: 40px; height: 40px; color: var(--muted); }
.icon-btn.danger { color: var(--danger); }
.icon-btn:active { background: var(--surface); }
.more-btn { margin-right: -8px; }
.text-btn { font-size: 18px; min-height: 44px; padding: 0 4px; color: var(--text); }
.lib-sub { margin: 2px 0 0; color: var(--text-muted); font-size: 16px; }

.lib-search-wrap { margin-top: 10px; }
.search { position: relative; display: flex; align-items: center; height: 48px; border-radius: 15px; border: 1px solid var(--line); background: var(--bg-raised); }
.search-ico { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search input { -webkit-appearance: none; appearance: none; width: 100%; height: 100%; border: 0; background: transparent; padding: 0 14px 0 44px; font-size: 18px; font-family: var(--f-ui); outline: none; border-radius: 15px; }
.search input::placeholder { color: var(--text-muted); opacity: 1; }
.search:focus-within { border-color: var(--line-strong); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.lib-body { padding-top: 14px; }
.group-title { font-family: var(--f-display); font-weight: 500; font-size: 22px; margin: 22px 0 6px; }

/* grid */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 22px 14px; }
.book { display: flex; text-align: center; border-radius: 10px; }
.book-tile { flex-direction: column; align-items: center; gap: 0; padding: 6px 2px 4px; }
.book-cover-wrap { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 2 / 3; width: 68%; }
.book-tile .book-cover-wrap { width: 70%; max-width: 170px; }
/* fixed cover zone (Fedir 01.11): any cover proportion is centred inside it, the text below never shifts */
.book-cover-wrap .cover { position: absolute; inset: 0; margin: auto; width: auto; height: auto; }
.book-cover-wrap .cover.wide { width: 100%; }
.book-cover-wrap .cover.tall { height: 100%; }
.cover { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 3px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-cover); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-meta { display: flex; flex-direction: column; align-items: center; min-width: 0; width: 100%; }
.book-tile .book-title { margin-top: 12px; min-height: 2.5em; font-size: 18px; line-height: 1.25; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.book-prog { display: block; width: 100%; height: 3px; margin-top: 8px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 .5px var(--line-strong); overflow: hidden; }
.book-prog i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
:root[data-theme="dark"] .book-prog { background: rgba(255,255,255,.9); }
.book:active .cover { transform: scale(.98); }
.book.is-selected .cover { outline: 2px solid var(--text); outline-offset: 3px; }

/* list */
.book-list { display: flex; flex-direction: column; }
.book-row { flex-direction: row; align-items: center; gap: 16px; padding: 10px 0; text-align: left; border-bottom: 1px solid var(--line); border-radius: 0; }
.book-row .book-cover-wrap { width: 54px; }
.book-row .book-meta { align-items: flex-start; }
.book-row .book-title { font-size: 18px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.book-author { font-size: 15px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.book-row .book-prog { margin-top: 8px; max-width: 220px; }

/* generated plaque cover */
.cover.plaque { background: var(--plaque-bg); color: var(--plaque-fg); display: flex; container-type: inline-size; }
.plaque-inner { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 14% 10% 12%; border: 1px solid color-mix(in srgb, var(--plaque-fg) 28%, transparent); margin: 6%; min-width: 0; }
.plaque-title { font-family: var(--f-display); font-size: 11.5cqw; line-height: 1.22; text-align: center; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.plaque-author { font-family: var(--f-ui); font-size: 6.4cqw; letter-spacing: .08em; text-transform: uppercase; text-align: center; opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-row .plaque-inner { padding: 8% 6%; margin: 5%; }
.book-row .plaque-title { -webkit-line-clamp: 4; }
.book-row .plaque-author { display: none; }

/* selection */
.sel-dot { position: absolute; top: -8px; left: -8px; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-raised); border: 1.5px solid var(--line-strong); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.12); color: var(--btn-dark-text); }
.book.is-selected .sel-dot { background: var(--btn-dark); border-color: var(--btn-dark); }
.sel-dot svg { width: 16px; height: 16px; }
.select-card { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px 16px; margin-bottom: 18px; background: var(--bg); }
.select-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.select-count { font-size: 17px; }
.select-links { display: flex; gap: 16px; }
.link { font-size: 17px; color: var(--text); min-height: 40px; }
.link.muted, .link:disabled { color: var(--text-muted); }
.select-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.chip-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 13px; background: var(--surface); font-size: 17px; color: var(--text); min-width: 0; padding: 0 6px; white-space: nowrap; }
.chip-btn .ico { color: var(--muted); }
.chip-btn:disabled { color: var(--faint); }
.chip-btn.danger { color: var(--danger); }
.chip-btn.danger .ico { color: currentColor; }
.chip-btn.danger:disabled { color: var(--danger-soft); }
.chip-btn:not(:disabled):active { background: var(--surface-2); }

/* empty */
.empty { text-align: center; padding: 72px 12px 24px; max-width: 420px; margin: 0 auto; }
.empty.small { padding-top: 40px; color: var(--text-muted); }
.empty-title { font-family: var(--f-display); font-weight: 400; font-size: 26px; margin: 0 0 10px; }
.empty-body { color: var(--text-muted); font-size: 17px; margin: 0 0 22px; }
.soon-badge { display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 15px; color: var(--text-muted); margin-bottom: 14px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 14px; font-size: 18px; }
.btn-dark { background: var(--btn-dark); color: var(--btn-dark-text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); }
.btn-block { width: 100%; }
.btn:active { opacity: .85; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: calc(var(--tabbar-h) + var(--sab)); padding: 0 calc(12px + var(--sar)) var(--sab) calc(12px + var(--sal));
  background: linear-gradient(to top, var(--bg) 72%, color-mix(in srgb, var(--bg) 0%, transparent));
}
.tabbar > * { justify-self: center; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; min-height: 52px; justify-content: center; color: var(--text-muted); font-size: 14px; }
.tab.is-active { color: var(--text); }
.tab .ico svg { width: 24px; height: 24px; }
.tab-spacer { visibility: hidden; }
.resume-pill { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 24px 0 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-raised); font-size: 19px; color: var(--text); }
.resume-pill .ico { color: var(--muted); }
.resume-pill:disabled { color: var(--faint); }
@media (min-width: 900px) { .tabbar { grid-template-columns: 200px auto 200px; justify-content: center; } }

/* ---------- menus ---------- */
.menu-scrim { position: fixed; inset: 0; z-index: 99; }
.menu {
  position: fixed; z-index: 100; min-width: 250px; max-width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto;
  background: var(--menu); border-radius: 18px; box-shadow: var(--shadow-menu); padding: 6px 0;
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  animation: menuIn .16s cubic-bezier(.2, .8, .2, 1);
}
.menu.out { animation: menuOut .14s ease-in forwards; }
.menu-narrow { min-width: 220px; }
@keyframes menuIn { from { opacity: 0; transform: scale(.94); } }
@keyframes menuOut { to { opacity: 0; transform: scale(.96); } }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 48px; padding: 10px 22px; text-align: left; font-size: 19px; color: var(--text); }
.menu-item:focus-visible { background: color-mix(in srgb, var(--text) 6%, transparent); outline: none; border-radius: 0; }
.menu-item:disabled { color: var(--text); cursor: default; }
.menu-item.has-hint:disabled .menu-label { color: var(--text); }
.menu-item.danger { color: var(--danger); }
.menu-label { display: flex; flex-direction: column; min-width: 0; }
.menu-hint { font-size: 14px; color: var(--text-muted); margin-top: 3px; line-height: 1.3; }
.menu-check { color: var(--text); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 22px; }
.menu-heading { padding: 12px 22px 4px; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }

/* ---------- sheets ---------- */
.sheet-scrim, .dialog-scrim { position: fixed; inset: 0; z-index: 90; background: var(--scrim); opacity: 0; transition: opacity .28s ease; }
.sheet-scrim.in, .dialog-scrim.in { opacity: 1; }
.sheet {
  position: fixed; z-index: 91; left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); bottom: calc(8px + var(--sab) * .4);
  max-height: calc(100dvh - var(--sat) - 30px); display: flex; flex-direction: column;
  background: var(--bg); border-radius: 34px; box-shadow: 0 -4px 40px rgba(0,0,0,.12);
  transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
  max-width: 640px; margin: 0 auto;
}
.sheet.in { transform: translateY(0); }
.sheet-full { height: calc(100dvh - var(--sat) - 30px); }
.sheet-grabber { flex: none; height: 26px; position: relative; touch-action: none; cursor: grab; }
.sheet-grabber::after { content: ""; position: absolute; left: 50%; top: 10px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line-strong); }
.sheet-scroll { flex: 1; overflow-y: auto; padding: 8px 28px 24px; overscroll-behavior: contain; }
.sheet-title { font-family: var(--f-display); font-weight: 400; font-size: 34px; line-height: 1.15; margin: 6px 0 10px; }
.sheet-intro { color: var(--text-muted); font-size: 17px; margin: 0 0 14px; }
.sheet-footer { flex: none; padding: 12px 28px calc(20px + var(--sab) * .6); }
.group-label { font-family: var(--f-ui); font-weight: 400; font-size: 15px; color: var(--text-muted); margin: 22px 4px 8px; }
.group-label:first-child { margin-top: 8px; }
.group { background: var(--surface); border-radius: 18px; overflow: hidden; }
.group-note { color: var(--text-muted); font-size: 15px; margin: 8px 4px 0; }
.set-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 8px 18px 8px 22px; text-align: left; font-size: 18px; position: relative; }
.set-row + .set-row::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 1px; background: var(--line); }
.row-label { flex: 1; min-width: 0; }
.row-value { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.row-chev { color: var(--faint); margin-right: -4px; }
button.set-row:active { background: var(--surface-2); }
.switch { position: relative; width: 62px; height: 44px; flex: none; background: none; }
.switch::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 36px; border-radius: 999px; background: var(--line-strong); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 7px; left: 3px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.switch[aria-checked="true"]::before { background: #362316; }
:root[data-theme="dark"] .switch[aria-checked="true"]::before { background: #5E5E5A; }
.switch[aria-checked="true"]::after { transform: translateX(26px); }
.muted-note { color: var(--text-muted); font-size: 17px; margin: 10px 0; }
.add-row { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 18px; color: var(--text); }
.shelf-list, .pick-list { list-style: none; margin: 6px 0 0; padding: 0; }
.shelf-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; border-bottom: 1px solid var(--line); }
.shelf-name { display: flex; flex-direction: column; font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.shelf-name small { color: var(--text-muted); font-size: 14px; }
.shelf-actions { display: flex; flex: none; }
.pick-row { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 54px; font-size: 18px; border-bottom: 1px solid var(--line); text-align: left; gap: 10px; overflow-wrap: anywhere; }
.icon-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 10px 0 6px; }
.icon-preview img { width: 120px; height: 120px; border-radius: 27px; box-shadow: var(--shadow-cover); }
.icon-preview-name { display: inline-flex; gap: 6px; align-items: center; font-size: 17px; }
.about-text { font-size: 17px; color: var(--text-2); margin: 0 0 18px; }
.credits { margin: 0; padding: 0 0 0 4px; list-style: none; color: var(--text-muted); font-size: 15px; display: grid; gap: 6px; }

/* dialogs */
.dialog-scrim { z-index: 110; }
.dialog {
  position: fixed; z-index: 111; left: 50%; top: 50%; width: min(360px, calc(100vw - 40px)); transform: translate(-50%, -50%);
  background: var(--bg); border-radius: 24px; padding: 24px 22px 18px; box-shadow: var(--shadow-menu);
  animation: dlgIn .18s cubic-bezier(.2,.8,.2,1);
}
.dialog.out { animation: dlgOut .16s ease-in forwards; }
@keyframes dlgIn { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }
@keyframes dlgOut { to { opacity: 0; transform: translate(-50%, -50%) scale(.97); } }
.dialog-title { font-family: var(--f-display); font-weight: 400; font-size: 24px; line-height: 1.2; margin: 0 0 8px; }
.dialog-body { color: var(--text-muted); font-size: 16px; margin: 0 0 18px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.dialog-actions .btn { padding: 0 12px; }
.field { width: 100%; font-size: 18px; font-family: var(--f-ui); padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--bg-raised); outline: none; -webkit-appearance: none; appearance: none; }
.field:focus { border-color: var(--text); }

/* toast */
.toast {
  position: fixed; z-index: 120; left: 50%; bottom: calc(var(--tabbar-h) + var(--sab) + 18px); transform: translate(-50%, 12px);
  max-width: calc(100vw - 40px); width: max-content; padding: 12px 20px; border-radius: 999px;
  background: var(--btn-dark); color: var(--btn-dark-text); font-size: 16px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }
body.reading .toast { bottom: calc(var(--sab) + 96px); }

.drop-hint { position: fixed; inset: 12px; z-index: 130; border: 2px dashed var(--line-strong); border-radius: 26px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg) 88%, transparent); font-size: 20px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.drop-hint.in { opacity: 1; }

@media (min-width: 900px) {
  :root { --gutter: 48px; }
  .display-title { font-size: 44px; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 30px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (hover: hover) {
  .menu-item:not(:disabled):hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
  .icon-btn:hover, .chip-btn:not(:disabled):hover { background: var(--surface); }
  .book:hover .cover { box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 10px 24px rgba(0,0,0,.14); }
}

/* ---------- catalog books (remote: true) ---------- */
.dl-ring { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; border-radius: 3px; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.dl-ring::before { content: ""; width: 46%; max-width: 54px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--text) calc(var(--p, 0) * 1turn), color-mix(in srgb, var(--text) 16%, transparent) 0); -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%); }
.book.is-loading .dl-ring { display: flex; }
html.offline .book.is-remote .cover { filter: grayscale(1); opacity: .55; }
.shelf-lock { color: var(--muted); width: 40px; height: 40px; align-items: center; justify-content: center; }
