/* Books: the design system (spec BK1 §1.1c, the approved board).
   Light is the default; html[data-theme="dark"] is dark mode; "system"
   follows the device. Every colour in Books is one of these tokens, and
   every class is bk- namespaced. Spine colours are the book's own and come
   inline from data, never from here. */

:root,
html[data-palette="lamplit"] {
  --bk-ground: #EFE6D6;
  --bk-surface: #F8F2E7;
  --bk-surface-2: #E6DAC4;
  --bk-ink: #241C13;
  --bk-muted: #6A5D4A;
  --bk-brass: #7A5518;
  --bk-on-brass: #FFF8EA;
  --bk-flame: #E8590C;
  --bk-qr-bg: #FFFFFF;
  --bk-qr-ink: #111111;
  --bk-flame-core: #FFB020;
  --bk-wax: #F3E9D2;
  --bk-wax-edge: #D2BF97;
  --bk-line: #D3C4A8;
  --bk-wood: #B08A5A;
  --bk-wood-edge: #C9A473;
  --bk-lamp-glow: rgba(255, 214, 140, 0.5);
  --bk-lamp-fade: rgba(239, 230, 214, 0);
  --bk-lamp-shade: #A87C34;
  --bk-lamp-cord: #9C8460;
  --bk-lamp-bulb: #FFE2A0;
  --bk-shadow: rgba(80, 55, 20, 0.25);
  --bk-shadow-strong: rgba(80, 55, 20, 0.4);
  --bk-danger: #A3261B;
  --bk-on-danger: #FFF8EA;
  --bk-ok: #2E6B45;
  --bk-scrim: rgba(36, 28, 19, 0.55);
  --bk-serif: "David Libre", "Frank Ruhl Libre", Georgia, serif;
  --bk-sans: "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bk-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --bk-radius: 6px;
  color-scheme: light;
}

/* Dark mode: the lamp-lit dark palette from the boards. Declared once as a
   mixin via a custom-property block, applied to data-theme="dark" and to
   "system" under a dark device, and to the always-dark "den" palette. */
html[data-theme="dark"],
html[data-palette="den"] {
  --bk-ground: #120F0C;
  --bk-surface: #18140F;
  --bk-surface-2: #211C17;
  --bk-ink: #EFE6D2;
  --bk-muted: #A89C86;
  --bk-brass: #D8B46A;
  --bk-on-brass: #15120F;
  --bk-flame: #FF7A2E;
  --bk-qr-bg: #FFFFFF;
  --bk-qr-ink: #111111;
  --bk-flame-core: #FFC84A;
  --bk-wax: #E9DCC0;
  --bk-wax-edge: #B5A27C;
  --bk-line: #3A3128;
  --bk-wood: #4E3B28;
  --bk-wood-edge: #7A6040;
  --bk-lamp-glow: rgba(216, 180, 106, 0.2);
  --bk-lamp-fade: rgba(18, 15, 12, 0);
  --bk-lamp-shade: #B8924A;
  --bk-lamp-cord: #6A5338;
  --bk-lamp-bulb: #F3D99A;
  --bk-shadow: rgba(0, 0, 0, 0.6);
  --bk-shadow-strong: rgba(0, 0, 0, 0.75);
  --bk-danger: #F08A7E;
  --bk-on-danger: #15120F;
  --bk-ok: #7FBF95;
  --bk-scrim: rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bk-ground: #120F0C;
    --bk-surface: #18140F;
    --bk-surface-2: #211C17;
    --bk-ink: #EFE6D2;
    --bk-muted: #A89C86;
    --bk-brass: #D8B46A;
    --bk-on-brass: #15120F;
    --bk-flame: #FF7A2E;
    --bk-qr-bg: #FFFFFF;
    --bk-qr-ink: #111111;
    --bk-flame-core: #FFC84A;
    --bk-wax: #E9DCC0;
    --bk-wax-edge: #B5A27C;
    --bk-line: #3A3128;
    --bk-wood: #4E3B28;
    --bk-wood-edge: #7A6040;
    --bk-lamp-glow: rgba(216, 180, 106, 0.2);
    --bk-lamp-fade: rgba(18, 15, 12, 0);
    --bk-lamp-shade: #B8924A;
    --bk-lamp-cord: #6A5338;
    --bk-lamp-bulb: #F3D99A;
    --bk-shadow: rgba(0, 0, 0, 0.6);
    --bk-shadow-strong: rgba(0, 0, 0, 0.75);
    --bk-danger: #F08A7E;
    --bk-on-danger: #15120F;
    --bk-ok: #7FBF95;
    --bk-scrim: rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

/* The other explored looks, selectable in settings (spec BK1 §1.1b). Each
   is a token set over the same screens; dark mode on them is the lamp-lit
   dark above, which the rule order gives them for free. */
html[data-palette="warm"]:not([data-theme="dark"]) {
  --bk-ground: #F5EFE3;
  --bk-surface: #FFFDF8;
  --bk-surface-2: #EFE6D6;
  --bk-ink: #1E2B45;
  --bk-muted: #5E5A52;
  --bk-brass: #B4532A;
  --bk-on-brass: #FFFDF8;
  --bk-flame: #E8590C;
  --bk-qr-bg: #FFFFFF;
  --bk-qr-ink: #111111;
  --bk-flame-core: #FFB020;
  --bk-wax: #F3E9D2;
  --bk-wax-edge: #D2BF97;
  --bk-line: #E4DACA;
  --bk-wood: #C9A473;
  --bk-wood-edge: #D9B98A;
  --bk-lamp-glow: rgba(255, 214, 140, 0.35);
  --bk-lamp-fade: rgba(245, 239, 227, 0);
  --bk-shadow: rgba(30, 43, 69, 0.18);
  --bk-shadow-strong: rgba(30, 43, 69, 0.3);
  --bk-serif: "Frank Ruhl Libre", "David Libre", Georgia, serif;
  --bk-sans: "Assistant", "Heebo", system-ui, sans-serif;
  --bk-radius: 12px;
}
html[data-palette="bright"]:not([data-theme="dark"]) {
  --bk-ground: #F6F5FF;
  --bk-surface: #FFFFFF;
  --bk-surface-2: #EEEBFF;
  --bk-ink: #1D1A33;
  --bk-muted: #5B5775;
  --bk-brass: #4A2FD6;
  --bk-on-brass: #FFFFFF;
  --bk-flame: #E8590C;
  --bk-qr-bg: #FFFFFF;
  --bk-qr-ink: #111111;
  --bk-flame-core: #FFB020;
  --bk-wax: #F3E9D2;
  --bk-wax-edge: #D2BF97;
  --bk-line: #E3DEFF;
  --bk-wood: #B9AEFF;
  --bk-wood-edge: #D6CFFF;
  --bk-lamp-glow: rgba(255, 201, 60, 0.3);
  --bk-lamp-fade: rgba(246, 245, 255, 0);
  --bk-lamp-shade: #FFC93C;
  --bk-lamp-cord: #B9AEFF;
  --bk-lamp-bulb: #FFF1C9;
  --bk-shadow: rgba(74, 47, 214, 0.15);
  --bk-shadow-strong: rgba(74, 47, 214, 0.3);
  --bk-danger: #C0392B;
  --bk-serif: "Rubik", "Heebo", system-ui, sans-serif;
  --bk-sans: "Rubik", "Heebo", system-ui, sans-serif;
  --bk-radius: 16px;
}

/* ---- base ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body.bk {
  background: var(--bk-ground);
  color: var(--bk-ink);
  font: 16px/1.55 var(--bk-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--bk-brass); }
a:hover { color: var(--bk-ink); }
:focus-visible { outline: 2px solid var(--bk-brass); outline-offset: 2px; }
.bk-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bk-skip {
  position: absolute; inset-inline-start: 8px; top: -60px; z-index: 50;
  background: var(--bk-brass); color: var(--bk-on-brass); padding: 10px 14px; border-radius: var(--bk-radius);
}
.bk-skip:focus { top: 8px; color: var(--bk-on-brass); }

/* ---- type ---------------------------------------------------------------- */
.bk-title { font-family: var(--bk-serif); font-weight: 500; font-size: 28px; line-height: 1.2; margin: 8px 0 14px; }
.bk-h2 { font-family: var(--bk-serif); font-weight: 500; font-size: 20px; margin: 22px 0 10px; }
.bk-lead { color: var(--bk-muted); margin: 0 0 18px; }
.bk-kicker { font-size: 13px; color: var(--bk-muted); }
.bk-muted { color: var(--bk-muted); font-size: 14px; }
.bk-divider { text-align: center; color: var(--bk-muted); font-size: 14px; margin: 16px 0; }
.bk-prose { max-width: 680px; }
.bk-prose h2 { font-family: var(--bk-serif); font-weight: 500; font-size: 20px; margin: 22px 0 6px; }
.bk-draft { background: var(--bk-surface); border: 1px dashed var(--bk-brass); padding: 10px 14px; border-radius: var(--bk-radius); }

/* ---- layout -------------------------------------------------------------- */
.bk-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px; width: 100%;
  position: sticky; top: 0; z-index: 20; background: var(--bk-ground);
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  box-shadow: 0 1px 0 var(--bk-line);
}
.bk-wordmark {
  font-family: var(--bk-serif); font-weight: 700; font-size: 30px; letter-spacing: 1px;
  color: var(--bk-brass); text-decoration: none;
}
html[dir="rtl"] .bk-wordmark { letter-spacing: 0; }
.bk-account { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--bk-muted); }
.bk-account form { margin: 0; }
.bk-layout { flex: 1; display: flex; width: 100%; }
.bk-side { display: none; }
.bk-main { flex: 1; min-width: 0; width: 100%; padding: 0 22px 28px; }
.bk-narrow { max-width: 440px; margin: 0 auto; }
.bk-wide { max-width: 1100px; margin: 0 auto; }
.bk-footer { text-align: center; font-size: 13px; color: var(--bk-muted); padding: 12px 22px 20px; }
.bk-footer a { color: var(--bk-muted); }

/* Bottom navigation on a phone. */
.bk-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  background: var(--bk-surface); border-top: 1px solid var(--bk-line); padding: 6px 4px calc(10px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 14px var(--bk-shadow);
}
body.bk:has(.bk-nav) { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.bk-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 48px; font-size: 12px; color: var(--bk-muted); text-decoration: none;
}
.bk-nav-item[aria-current="page"] { color: var(--bk-brass); font-weight: 700; }
.bk-nav-item[aria-disabled="true"] { opacity: 0.55; }
.bk-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bk-icon--fill { fill: currentColor; stroke: none; }

/* ---- buttons ------------------------------------------------------------- */
.bk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-size: 16px; min-height: 48px; padding: 0 18px; border-radius: var(--bk-radius);
  border: 1px solid var(--bk-line); background: var(--bk-surface); color: var(--bk-ink);
  cursor: pointer; text-decoration: none; transition: border-color 150ms ease, background 150ms ease;
}
.bk-btn:hover { color: var(--bk-ink); border-color: var(--bk-brass); }
.bk-btn--primary { background: var(--bk-brass); border-color: var(--bk-brass); color: var(--bk-on-brass); font-weight: 700; }
.bk-btn--primary:hover { color: var(--bk-on-brass); filter: brightness(1.08); }
.bk-btn--quiet { border-color: transparent; background: none; color: var(--bk-muted); min-height: 44px; padding: 0 10px; font-size: 14px; }
.bk-btn--quiet:hover { border-color: transparent; }
.bk-btn--danger { color: var(--bk-danger); border-color: var(--bk-danger); background: var(--bk-surface); }
.bk-btn--danger:hover { color: var(--bk-danger); }
.bk-btn--wide { width: 100%; }
.bk-btn--small { min-height: 44px; font-size: 14px; padding: 0 12px; }
.bk-btn[aria-disabled="true"], .bk-btn:disabled { opacity: 0.6; cursor: default; }
.bk-stack { display: grid; gap: 10px; margin-top: 16px; }
.bk-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- fields -------------------------------------------------------------- */
.bk-form { display: grid; gap: 14px; }
.bk-field { display: grid; gap: 4px; font-size: 14px; color: var(--bk-muted); }
.bk-help { font-size: 13px; color: var(--bk-muted); }
.bk-check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--bk-ink); min-height: 44px; }
.bk-check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--bk-brass); flex: none; }
.bk-input, .bk-select, .bk-textarea {
  font: inherit; color: var(--bk-ink); background: var(--bk-ground);
  border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 10px 12px; min-height: 44px; width: 100%;
}
.bk-input:focus, .bk-select:focus, .bk-textarea:focus { border-color: var(--bk-brass); outline: none; box-shadow: 0 0 0 2px var(--bk-lamp-glow); }
.bk-textarea { min-height: 96px; resize: vertical; }
.bk-error { color: var(--bk-danger); font-size: 14px; margin: 0; }
.bk-radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-radio {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--bk-line); border-radius: var(--bk-radius); background: var(--bk-surface); cursor: pointer; color: var(--bk-ink);
}
.bk-radio input { accent-color: var(--bk-brass); }
.bk-radio:has(input:checked) { border-color: var(--bk-brass); background: var(--bk-surface-2); }

/* ---- chips: the five choices --------------------------------------------- */
.bk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-chip {
  font: inherit; font-size: 14px; min-height: 44px; padding: 0 14px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--bk-line); background: var(--bk-surface); color: var(--bk-ink);
}
.bk-chip[aria-pressed="true"] { background: var(--bk-brass); border-color: var(--bk-brass); color: var(--bk-on-brass); font-weight: 700; }

/* ---- cards and tiles ----------------------------------------------------- */
.bk-card { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 18px; }
.bk-card--tight { padding: 12px 14px; }
.bk-label-card { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.bk-label-card .bk-label-title { font-family: var(--bk-serif); font-size: 24px; line-height: 1.15; }
.bk-label-card .bk-label-status { font-size: 13px; color: var(--bk-brass); margin-top: 2px; }
.bk-tile { display: flex; flex-direction: column; gap: 6px; width: 104px; text-decoration: none; color: var(--bk-ink); }
.bk-tile-cover {
  height: 150px; border-radius: 3px 8px 8px 3px; padding: 12px 10px; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--spine-bg, var(--bk-surface-2)); color: var(--spine-ink, var(--bk-ink)); box-shadow: 0 6px 14px var(--bk-shadow);
  font-family: var(--bk-serif); font-weight: 700; font-size: 15px; line-height: 1.2;
}
html[dir="rtl"] .bk-tile-cover { border-radius: 8px 3px 3px 8px; }
.bk-tile-cover small { font-family: var(--bk-sans); font-weight: 400; font-size: 11px; }
.bk-tile-meta { font-size: 13px; color: var(--bk-muted); }
.bk-tile-grid { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- feedback: notices, toasts, sheets, dialogs -------------------------- */
.bk-notice { border: 1px solid var(--bk-line); border-inline-start: 3px solid var(--bk-brass); background: var(--bk-surface); padding: 10px 14px; border-radius: var(--bk-radius); }
.bk-notice--ok { border-inline-start-color: var(--bk-ok); }
.bk-notice--danger { border-inline-start-color: var(--bk-danger); }
.bk-toast {
  position: fixed; inset-inline: 16px; bottom: 90px; z-index: 40; margin: 0 auto; max-width: 440px;
  background: var(--bk-ink); color: var(--bk-ground); padding: 12px 16px; border-radius: var(--bk-radius);
  box-shadow: 0 10px 24px var(--bk-shadow-strong); font-size: 15px;
}
.bk-toast--static { position: static; }
.bk-scrim { position: fixed; inset: 0; background: var(--bk-scrim); z-index: 30; }
.bk-sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 35; background: var(--bk-surface);
  border-radius: 14px 14px 0 0; padding: 14px 22px 28px; max-height: 85vh; overflow: auto; box-shadow: 0 -10px 30px var(--bk-shadow-strong);
}
.bk-sheet--static { position: static; border-radius: 14px; box-shadow: 0 6px 20px var(--bk-shadow); }
.bk-sheet-handle { width: 44px; height: 4px; border-radius: 2px; background: var(--bk-line); margin: 0 auto 12px; }
.bk-dialog {
  background: var(--bk-surface); color: var(--bk-ink); border: 1px solid var(--bk-line); border-radius: var(--bk-radius);
  padding: 20px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 20px 40px var(--bk-shadow-strong);
}
.bk-dialog::backdrop { background: var(--bk-scrim); }
.bk-dialog-title { font-family: var(--bk-serif); font-weight: 500; font-size: 22px; margin: 0 0 6px; }
.bk-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---- empty states -------------------------------------------------------- */
.bk-empty { text-align: center; margin-top: 20px; }
.bk-empty .bk-btn { margin-top: 6px; }

/* ---- the lamp and the shelf (board C3) ----------------------------------- */
.bk-room {
  background: radial-gradient(ellipse 70% 60% at 50% 20%, var(--bk-lamp-glow), var(--bk-lamp-fade) 70%);
  padding: 0 0 8px;
}
.bk-lamp { display: flex; justify-content: center; }
.bk-lamp-cord { stroke: var(--bk-lamp-cord); }
.bk-lamp-shade { fill: var(--bk-lamp-shade); }
.bk-lamp-rim { stroke: var(--bk-brass); }
.bk-lamp-bulb { fill: var(--bk-lamp-bulb); }
.bk-room-kicker { text-align: center; margin: 4px 0 8px; }

.bk-shelf { position: relative; }
.bk-shelf-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bk-shelf-scroll::-webkit-scrollbar { display: none; }
.bk-shelf-row { position: relative; height: 214px; direction: ltr; min-width: 100%; }
.bk-shelf-row--empty { height: 150px; }
.bk-shelf-board {
  height: 14px; background: var(--bk-wood); border-top: 2px solid var(--bk-wood-edge);
  box-shadow: 0 8px 14px var(--bk-shadow); min-width: 100%;
}
.bk-shelf-empty { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18px; text-align: center; }
.bk-bookend { position: absolute; bottom: 0; width: 12px; height: 64px; background: var(--bk-lamp-shade); border-radius: 2px 2px 0 0; }
.bk-bookend--start { left: 12%; }
.bk-bookend--end { right: 12%; }
.bk-shelf-hints { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0 0; font-size: 12px; color: var(--bk-muted); }

/* Place, tilt and lift are the shelf's springs (shelf.js), set as an inline
   transform every frame; CSS only draws the book. */
.bk-spine {
  position: absolute; bottom: 0; left: 0; width: var(--spine-w, 28px); height: var(--spine-h, 170px);
  background: var(--spine-bg); color: var(--spine-ink); border: 0; padding: 0; margin: 0; font: inherit;
  border-radius: 2px 2px 1px 1px; cursor: pointer; transform-origin: 50% 100%; will-change: transform;
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.07), inset -5px 0 0 rgba(0, 0, 0, 0.32), 3px 0 4px var(--bk-shadow);
  transition: filter 300ms ease, box-shadow 300ms ease;
  z-index: 1; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.bk-spine:focus-visible { outline: 2px solid var(--bk-brass); outline-offset: 3px; }
/* A tapped book's place on the shelf while it floats over the page (Avi, 2026-10-24):
   the book stays where it is, dimmed, so the shelf never moves. */
.bk-spine.is-lifted { opacity: .32; box-shadow: 0 0 0 1px var(--bk-brass); }
.bk-spine-band {
  position: absolute; top: 10px; left: 4px; right: 4px; height: 3px; pointer-events: none;
  border-top: 1px solid var(--spine-band, rgba(216, 180, 106, 0.6)); border-bottom: 1px solid var(--spine-band, rgba(216, 180, 106, 0.6));
}
.bk-spine--rare { --spine-band: var(--bk-brass); }
.bk-spine--rare::after { content: ""; position: absolute; inset: 3px; border: 1px solid var(--bk-brass); pointer-events: none; border-radius: 1px; }
.bk-spine-title {
  position: absolute; top: 22px; bottom: 34px; left: 2px; right: 2px; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; font-family: var(--bk-serif); font-size: var(--spine-font, 13px); white-space: nowrap; overflow: hidden; pointer-events: none;
  line-height: 1.1; text-align: center;
}
/* Too long for one line: two (shelf.js sets a smaller size if it must). */
.bk-spine-title.is-two { white-space: normal; line-height: 1.05; overflow-wrap: anywhere; }
.bk-spine-author {
  position: absolute; bottom: 8px; left: 0; right: 0; height: 22px; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; font-size: 8px; opacity: 0.8; white-space: nowrap; overflow: hidden; pointer-events: none;
}

/* Bookcase view: two shelves in a wooden case (board C2). */
.bk-case { background: var(--bk-wood); padding: 10px 10px 0; border-radius: 4px; box-shadow: 0 18px 30px var(--bk-shadow-strong); }
.bk-case-back { background: var(--bk-ground); box-shadow: inset 0 10px 18px var(--bk-shadow); padding: 14px 8px 0; }
.bk-case .bk-shelf-row { height: 128px; }
.bk-case-board { height: 14px; background: var(--bk-wood); border-top: 2px solid var(--bk-wood-edge); margin: 0 -10px; display: flex; justify-content: center; align-items: center; }
.bk-case-plate { background: var(--bk-brass); color: var(--bk-on-brass); font-size: 11px; font-weight: 700; padding: 0 8px; border-radius: 1px; line-height: 13px; }


/* Living shelf: drag to arrange (board C1). */
.bk-shelf--living .bk-spine { cursor: grab; touch-action: none; }
.bk-spine.is-dragging { cursor: grabbing; z-index: 6; filter: brightness(1.08); box-shadow: 0 18px 26px var(--bk-shadow-strong), 0 0 0 1px var(--bk-brass); }
.bk-shelf-row.is-arranging { cursor: grabbing; }

/* ---- desktop and tablet (spec BK1 §1.3) ---------------------------------- */
@media (min-width: 700px) {
  .bk-main { padding: 0 32px 32px; }
  .bk-header { padding: 18px 32px; }
}
@media (min-width: 900px) {
  .bk-nav { display: none; }
  body.bk:has(.bk-nav) { padding-bottom: 0; }
  .bk-layout { max-width: 1280px; margin: 0 auto; }
  .bk-side {
    display: flex; flex-direction: column; gap: 4px; width: 200px; flex: none; padding: 8px 20px 24px;
    border-inline-end: 1px solid var(--bk-line);
  }
  .bk-side .bk-nav-item {
    flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; border-radius: 4px; font-size: 15px; min-height: 44px;
  }
  .bk-side .bk-nav-item[aria-current="page"] { background: var(--bk-surface-2); }
  .bk-side-section { margin-top: 22px; padding: 0 12px; }
  .bk-header { max-width: 1280px; margin: 0 auto; }
  .bk-shelf-row { height: 230px; }
  .bk-shelf-row--empty { height: 170px; }
  .bk-home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .bk-aside { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- the catalogue (BK2) ------------------------------------------------- */
.bk-entry-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.bk-entry-row { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); }
.bk-entry-row--actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.bk-entry-row--actions form { margin: 0; }
.bk-entry-link { display: flex; gap: 12px; align-items: center; padding: 10px 12px; text-decoration: none; color: var(--bk-ink); min-height: 64px; }
.bk-entry-link:hover { color: var(--bk-ink); }
.bk-entry-cover { width: 36px; height: 52px; flex: none; background: var(--bk-surface-2); border-radius: 2px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.bk-entry-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bk-entry-cover--large { width: 120px; height: 172px; border-radius: 3px; box-shadow: 0 8px 16px var(--bk-shadow); text-align: center; font-size: 12px; padding: 6px; }
.bk-entry-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bk-entry-title { font-family: var(--bk-serif); font-size: 18px; line-height: 1.2; }
.bk-entry-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }
.bk-plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.bk-plain-list code { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: 4px; padding: 1px 6px; }
.bk-link-row { display: flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--bk-ink); }
.bk-link-row:hover { color: var(--bk-brass); }

/* ---- scanning (BK3) ------------------------------------------------------ */
.bk-tips { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; color: var(--bk-ink); font-size: 15px; }
.bk-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.bk-file-drop { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--bk-brass); border-radius: var(--bk-radius); padding: 10px 12px; background: var(--bk-ground); color: var(--bk-ink); min-height: 56px; }
.bk-file { font: inherit; color: var(--bk-ink); max-width: 100%; }
.bk-scan-preview, .bk-scan-photo { width: 100%; height: auto; border-radius: var(--bk-radius); border: 1px solid var(--bk-line); display: block; margin-top: 12px; }
.bk-reading-bar { height: 4px; background: var(--bk-line); border-radius: 2px; overflow: hidden; margin: 8px auto 14px; max-width: 260px; }
.bk-reading-bar span { display: block; height: 100%; width: 35%; background: var(--bk-brass); animation: bk-reading 1.4s ease-in-out infinite; }
@keyframes bk-reading { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
html[dir="rtl"] .bk-reading-bar span { animation-name: bk-reading-rtl; }
@keyframes bk-reading-rtl { 0% { transform: translateX(100%); } 100% { transform: translateX(-300%); } }
.bk-spine-progress { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px; margin: 4px 0 14px; direction: ltr; }
.bk-spine-tick { width: 5px; height: 18px; border-radius: 1px; background: var(--bk-line); }
.bk-spine-tick:nth-child(3n) { height: 22px; } .bk-spine-tick:nth-child(4n) { height: 15px; }
.bk-spine-tick.is-done { background: var(--bk-brass); }
.bk-scan-cards { display: grid; gap: 14px; margin-top: 12px; }
.bk-scan-card { display: grid; gap: 12px; }
.bk-scan-match { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bk-scan-read { display: flex; flex-direction: column; gap: 2px; }
.bk-scan-read-title { font-family: var(--bk-serif); font-size: 20px; line-height: 1.2; }
.bk-chip-note { font-size: 12px; font-weight: 700; color: var(--bk-brass); border: 1px solid var(--bk-brass); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.bk-candidates { display: grid; gap: 6px; }
.bk-candidate { display: flex; align-items: center; gap: 10px; border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 8px 10px; background: var(--bk-ground); cursor: pointer; min-height: 56px; }
.bk-candidate input { accent-color: var(--bk-brass); flex: none; }
.bk-candidate:has(input:checked) { border-color: var(--bk-brass); background: var(--bk-surface-2); }
.bk-scan-fix { display: grid; gap: 10px; }
.bk-aside { display: grid; gap: 12px; margin-top: 14px; }
a.bk-notice { display: block; text-decoration: none; color: var(--bk-ink); min-height: 44px; }

/* ---- my library (BK4) ---------------------------------------------------- */
.bk-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; margin-bottom: 12px; }
.bk-copy-row { display: flex; align-items: center; }
.bk-copy-row .bk-entry-link { flex: 1; min-width: 0; }
.bk-copy-pick { display: flex; align-items: center; justify-content: center; width: 48px; min-height: 64px; flex: none; cursor: pointer; }
.bk-copy-pick input { width: 20px; height: 20px; accent-color: var(--bk-brass); }
.bk-bulk { margin-top: 12px; display: grid; gap: 8px; }
.bk-offer { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--bk-line); border-radius: var(--bk-radius); background: var(--bk-ground); }
.bk-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.bk-photo { margin: 0; display: grid; gap: 4px; }
.bk-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--bk-radius); border: 1px solid var(--bk-line); }
.bk-barcode-video { width: 100%; border-radius: var(--bk-radius); border: 1px solid var(--bk-line); }

/* ---- the hub (BK5) -------------------------------------------------------- */
.bk-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--bk-muted); }
.bk-bell-n { position: absolute; top: 4px; inset-inline-end: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--bk-brass); color: var(--bk-on-brass); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.bk-near-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.bk-near-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--bk-ink); background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 10px; }
.bk-near-card:hover { color: var(--bk-ink); border-color: var(--bk-brass); }
.bk-near-cover { height: 150px; border-radius: 3px 8px 8px 3px; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; background: var(--spine-bg, var(--bk-surface-2)); color: var(--spine-ink, var(--bk-ink)); font-family: var(--bk-serif); font-weight: 700; font-size: 15px; line-height: 1.2; overflow: hidden; }
.bk-near-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.bk-near-cover--img { padding: 0; }
.bk-rep { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--bk-muted); }
.bk-thread { display: grid; gap: 8px; margin: 10px 0; }
.bk-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; background: var(--bk-surface); border: 1px solid var(--bk-line); }
.bk-msg--mine { margin-inline-start: auto; background: var(--bk-surface-2); }
.bk-msg-meta { display: block; font-size: 12px; color: var(--bk-muted); margin-top: 2px; }
.bk-deal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-deal-actions form { margin: 0; }
.bk-contact { display: grid; gap: 6px; }
.bk-status-pill { display: inline-block; font-size: 13px; font-weight: 700; color: var(--bk-brass); border: 1px solid var(--bk-brass); border-radius: 999px; padding: 2px 12px; }
details.bk-more { margin-top: 14px; }
details.bk-more > summary { cursor: pointer; color: var(--bk-muted); min-height: 44px; display: flex; align-items: center; }
.bk-plain-list { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.bk-unread { border-inline-start: 3px solid var(--bk-brass); }
.bk-near-cover-by { font-family: var(--bk-sans, inherit); font-weight: 400; font-size: 13px; }

/* ---- circles, feedback, the pilot desk (BK6) ------------------------------- */
.bk-circle-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--bk-ink); background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 12px 14px; min-height: 44px; }
.bk-circle-card:hover { color: var(--bk-ink); border-color: var(--bk-brass); }
.bk-circle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.bk-member-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--bk-line); }
.bk-member-row:last-child { border-bottom: 0; }
.bk-member-row form { margin: 0; }
.bk-invite { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bk-invite code { font-size: 20px; letter-spacing: 0; font-family: var(--bk-mono, monospace); background: var(--bk-surface-2); padding: 6px 12px; border-radius: var(--bk-radius); }
.bk-invite input { flex: 1 1 220px; }
.bk-feedback { max-width: 520px; margin: 0 auto 14px; text-align: start; }
.bk-feedback > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: center; color: var(--bk-muted); }
.bk-feedback-thanks { max-width: 520px; margin: 0 auto 10px; }
.bk-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.bk-stat { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.bk-stat b { font-size: 28px; font-family: var(--bk-serif); line-height: 1.1; }
.bk-stat span { color: var(--bk-muted); font-size: 14px; }
.bk-funnel { display: grid; gap: 6px; margin: 10px 0; }
.bk-funnel-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.bk-funnel-bar { height: 22px; background: var(--bk-brass); border-radius: 4px; min-width: 2px; }
.bk-funnel-track { background: var(--bk-surface-2); border-radius: 4px; }
.bk-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.bk-table th, .bk-table td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--bk-line); }
.bk-feedback-item { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 10px 12px; margin-bottom: 8px; }

/* ---- the club (BK7) ----------------------------------------------------------- */
.bk-thread-row { display: grid; gap: 2px; padding: 10px 12px; }
.bk-thread-row .bk-entry-title { font-size: 17px; }
.bk-post { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 12px 14px; margin-bottom: 10px; }
.bk-post--first { border-inline-start: 3px solid var(--bk-brass); }
.bk-post--hidden { opacity: .7; border-style: dashed; }
.bk-post-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--bk-muted); margin-bottom: 6px; }
.bk-post-body { white-space: pre-wrap; max-width: 680px; margin: 0; }
.bk-post-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bk-post-actions form { margin: 0; }
.bk-review { padding: 10px 0; border-bottom: 1px solid var(--bk-line); max-width: 680px; }
.bk-review:last-of-type { border-bottom: 0; }
.bk-person-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.bk-chips form { margin: 0; }
.bk-post-meta a, .bk-review a, .bk-person-head a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }

/* ---- the shelves waiting for you (2026-10-19) ---------------------------------- */
.bk-scanbar { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-bottom: 14px; }
.bk-scanbar span { color: var(--bk-muted); }
.bk-queue { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.bk-queue-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 8px 12px; min-height: 44px; }
.bk-queue-row .bk-entry-title { font-size: 16px; }
.bk-queue-state { color: var(--bk-muted); font-size: 14px; }
.bk-queue-row[data-state="review"] { border-inline-start: 3px solid var(--bk-brass); }
.bk-queue-row[data-state="failed"] { border-inline-start: 3px solid var(--bk-danger); }

/* ---- play (BK8) ---------------------------------------------------------------- */
.bk-streak-card { display: grid; gap: 8px; }
.bk-streak-n { font-family: var(--bk-serif); font-size: 30px; line-height: 1; color: var(--bk-brass); }
.bk-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bk-badge { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 10px 12px; display: grid; gap: 2px; }
.bk-badge b { font-family: var(--bk-serif); font-size: 16px; }
.bk-badge span { font-size: 13px; color: var(--bk-muted); }
.bk-badge--locked { border-style: dashed; }
.bk-badge--locked b { color: var(--bk-muted); }
.bk-board { width: 100%; border-collapse: collapse; }
.bk-board td, .bk-board th { padding: 8px 6px; border-bottom: 1px solid var(--bk-line); text-align: start; }
.bk-board tr.is-me td { font-weight: 700; background: var(--bk-surface); }
.bk-ledger-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bk-line); }
.bk-ledger-row.is-reversed { color: var(--bk-muted); text-decoration: line-through; }

/* ---- discovery (BK9) ------------------------------------------------------------ */
.bk-rec-why { font-size: 13px; color: var(--bk-brass); }
.bk-taste-grid { display: grid; gap: 6px; }
.bk-taste-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 0; border-bottom: 1px solid var(--bk-line); }
.bk-taste-row .bk-radio-row { gap: 6px; }

/* ---- screen real estate (Avi, 2026-10-20): the books first, options folded --- */
/* Compact list rows everywhere: a thin divider, a small cover, one line each. */
.bk-entry-list { gap: 0; margin-top: 6px; }
.bk-entry-list > .bk-entry-row { border: 0; border-bottom: 1px solid var(--bk-line); border-radius: 0; background: transparent; }
.bk-entry-list > .bk-entry-row:first-child { border-top: 1px solid var(--bk-line); }
.bk-entry-list .bk-entry-link { padding: 6px 2px; min-height: 52px; gap: 10px; }
.bk-entry-list .bk-entry-cover { width: 30px; height: 42px; }
.bk-entry-list .bk-entry-text > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-entry-list .bk-entry-title { font-size: 16px; }
.bk-entry-list .bk-muted, .bk-entry-list .bk-kicker, .bk-entry-list .bk-rec-why { font-size: 13px; }
.bk-entry-list > .bk-entry-row--actions { padding: 8px 2px; }

/* A page head: the title, one main action, and a menu for the rest. */
.bk-pagehead { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
.bk-pagehead .bk-title { flex: 1; margin: 0; min-width: 0; }
.bk-pagehead-sub { font-size: 13px; color: var(--bk-muted); margin: -4px 0 8px; }
.bk-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: var(--bk-radius); border: 1px solid var(--bk-line); background: var(--bk-surface); color: var(--bk-ink); text-decoration: none; cursor: pointer; }
.bk-iconbtn:hover { color: var(--bk-ink); border-color: var(--bk-brass); }
.bk-iconbtn--primary { background: var(--bk-brass); border-color: var(--bk-brass); color: var(--bk-on-brass); }
.bk-iconbtn--primary:hover { color: var(--bk-on-brass); }
details.bk-menu { position: relative; }
details.bk-menu > summary { list-style: none; }
details.bk-menu > summary::-webkit-details-marker { display: none; }
.bk-menu-pop { position: absolute; inset-inline-end: 0; top: 50px; z-index: 40; min-width: 220px; display: grid; background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); box-shadow: 0 10px 24px var(--bk-shadow); padding: 4px 0; }
.bk-menu-pop a, .bk-menu-pop button { display: flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--bk-ink); text-decoration: none; background: none; border: 0; font: inherit; text-align: start; cursor: pointer; }
.bk-menu-pop a:hover, .bk-menu-pop button:hover { background: var(--bk-surface-2); color: var(--bk-ink); }

/* Search and filters behind one slim line; open when something is applied. */
details.bk-filterbox { margin: 0 0 6px; }
details.bk-filterbox > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border: 1px solid var(--bk-line); border-radius: var(--bk-radius); background: var(--bk-surface); cursor: pointer; color: var(--bk-muted); }
details.bk-filterbox > summary::-webkit-details-marker { display: none; }
details.bk-filterbox > summary b { color: var(--bk-ink); font-weight: 500; }
details.bk-filterbox[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.bk-filterbox > form, details.bk-filterbox > .bk-filterbox-body { border: 1px solid var(--bk-line); border-top: 0; border-radius: 0 0 var(--bk-radius) var(--bk-radius); padding: 10px; background: var(--bk-surface); }
details.bk-filterbox .bk-filter { margin-bottom: 0; }

/* On a phone: no explaining sentence under a list's title; a slimmer bar. */
@media (max-width: 699px) {
  .bk-intro { display: none; }
  .bk-title { font-size: 24px; }
  .bk-scanbar { padding: 6px 12px; font-size: 14px; margin-bottom: 8px; min-height: 44px; }
}
/* Two lines a row: the title, then everything else side by side. */
.bk-entry-list .bk-entry-text { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); row-gap: 1px; align-items: baseline; }
.bk-entry-list .bk-entry-text > .bk-entry-title { grid-column: 1 / -1; }
.bk-entry-list .bk-entry-text > :nth-child(3)::before { content: " · "; white-space: pre; }
.bk-entry-list .bk-entry-text > :nth-child(n+4) { grid-column: 1 / -1; }
.bk-entry-list .bk-entry-link { min-height: 48px; padding: 5px 2px; }
.bk-entry-list .bk-entry-cover { width: 28px; height: 38px; }

/* ---- the museum (BK10) -------------------------------------------------------- */
.bk-exhibit-item { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--bk-line); }
.bk-exhibit-photos { display: flex; gap: 8px; overflow-x: auto; }
.bk-exhibit-photos img { height: 180px; width: auto; border-radius: var(--bk-radius); border: 1px solid var(--bk-line); }
.bk-exhibit-text { white-space: pre-wrap; max-width: 680px; }
.bk-exhibit-item h2 a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- plans (BK11) -------------------------------------------------------------- */
.bk-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.bk-plan { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: var(--bk-radius); padding: 14px; display: grid; gap: 8px; align-content: start; }
.bk-plan.is-current { border: 2px solid var(--bk-brass); }
.bk-plan-price { font-family: var(--bk-serif); font-size: 20px; margin: 0; }
.bk-plan .bk-btn[disabled] { opacity: .65; cursor: not-allowed; }

/* ---- my shelf photos ---------------------------------------------------------- */
.bk-scan-list .bk-entry-link { min-height: 64px; }
.bk-scan-thumb { width: 84px; height: 56px; object-fit: cover; border-radius: 4px; flex: none; border: 1px solid var(--bk-line); }

/* ---- reading sessions ------------------------------------------------------------ */
.bk-timer { font-family: var(--bk-serif); font-size: 64px; line-height: 1; text-align: center; margin: 24px 0 8px; font-variant-numeric: tabular-nums; color: var(--bk-brass); }
.bk-input--big { font-size: 22px; text-align: center; }
.bk-reading .bk-title { font-size: 26px; }

/* ---- start reading, on a phone first (Avi, 2026-10-20) ------------------------- */
.bk-read-search { margin: 4px 0 8px; }
.bk-read-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--bk-line); }
.bk-read-row { border-bottom: 1px solid var(--bk-line); }
.bk-read-row details > summary { list-style: none; }
.bk-read-row details > summary::-webkit-details-marker { display: none; }
.bk-read-summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 5px 2px; cursor: pointer; }
.bk-read-summary .bk-entry-cover { width: 28px; height: 38px; }
.bk-read-summary .bk-entry-text { flex: 1; min-width: 0; }
.bk-read-summary .bk-entry-text > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-read-summary .bk-entry-title { font-size: 16px; }
.bk-read-summary .bk-muted { font-size: 13px; }
.bk-read-row details[open] > summary { background: var(--bk-surface); }
.bk-read-go { display: grid; gap: 10px; padding: 10px 2px 14px; }
.bk-btn--big { min-height: 52px; font-size: 18px; }
/* ---- a book with no cover image still looks like a book ------------------------- */
.bk-cover-drawn { display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; padding: 14px 12px; text-align: start; box-shadow: inset 6px 0 0 rgba(0, 0, 0, 0.18), 0 8px 16px var(--bk-shadow); }
.bk-cover-title { font-family: var(--bk-serif); font-weight: 700; font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.bk-cover-by { font-size: 12px; opacity: .9; }
/* ---- a copy's page: folded sections, a real photo button --------------------------- */
.bk-copy-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.bk-copy-form { gap: 8px; margin: 12px 0; }
.bk-copy-form details.bk-filterbox { margin: 0; }
.bk-photo-add { display: grid; gap: 8px; margin: 8px 0 14px; }
.bk-file-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; position: relative; }
.bk-file-button:focus-within { outline: 2px solid var(--bk-brass); outline-offset: 2px; }
/* ---- a book's page: reading state up top, forms folded --------------------------- */
.bk-reading-state { margin: 14px 0 4px; }
.bk-fold { max-width: 520px; margin: 8px 0 12px; }
.bk-progress { display: inline-block; vertical-align: middle; width: 80px; height: 6px; border-radius: 999px; background: var(--bk-line); overflow: hidden; margin-inline-end: 6px; }
.bk-progress > span { display: block; height: 100%; background: var(--bk-brass); }
/* ---- home: a quiet streak line and a tile grid of shortcuts ---------------------- */
.bk-streak-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; color: var(--bk-ink); text-decoration: none; min-height: 44px; align-content: center; }
.bk-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bk-quick-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px 8px; text-align: center;
  border: 1px solid var(--bk-line); border-radius: 12px; background: var(--bk-surface); color: var(--bk-ink); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: transform .15s ease, border-color .15s ease; }
.bk-quick-tile:hover { border-color: var(--bk-brass); transform: translateY(-1px); }
.bk-quick-tile:active { transform: translateY(1px); }
.bk-quick-tile .bk-icon { width: 24px; height: 24px; color: var(--bk-brass); }
.bk-quick-tile--main { grid-column: 1 / -1; flex-direction: row; min-height: 56px; background: var(--bk-brass); border-color: var(--bk-brass); color: var(--bk-on-brass); }
.bk-quick-tile--main .bk-icon { color: inherit; }
@media (prefers-reduced-motion: reduce) { .bk-quick-tile { transition: none; } .bk-quick-tile:hover, .bk-quick-tile:active { transform: none; } }
/* ---- scan: one big camera button first ------------------------------------------- */
.bk-scan-form { margin: 8px 0 14px; }
.bk-camera { position: relative; display: grid; justify-items: center; gap: 4px; padding: 22px 16px; border-radius: 16px; cursor: pointer;
  background: var(--bk-brass); color: var(--bk-on-brass); text-align: center; box-shadow: 0 6px 18px var(--bk-shadow); transition: transform .12s ease; }
.bk-camera:active { transform: scale(.98); }
.bk-camera:focus-within { outline: 3px solid var(--bk-ink); outline-offset: 3px; }
.bk-camera .bk-icon { width: 40px; height: 40px; }
.bk-camera-label { font-size: 19px; font-weight: 800; }
.bk-camera-sub { font-size: 13px; opacity: .85; }
.bk-visually-hidden-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .bk-camera { transition: none; } .bk-camera:active { transform: none; } }
.bk-card-options { border-top: 1px solid var(--bk-line); padding-top: 6px; }
.bk-card-options > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-size: 14px; font-weight: 600; }
.bk-card-options[open] > summary { margin-bottom: 6px; }
.bk-card-options > .bk-field, .bk-card-options > .bk-fieldset { margin-top: 8px; }
/* ---- the streak flame in the header (Avi, 2026-10-21: like Duolingo) -------------- */
.bk-flame { display: inline-flex; align-items: center; gap: 3px; min-height: 44px; padding: 0 6px; text-decoration: none; color: var(--bk-ink); font-size: 14px; white-space: nowrap; }
.bk-flame b { font-size: 16px; }
.bk-flame-min { color: var(--bk-muted); font-size: 12px; }
.bk-flame-icon { width: 22px; height: 22px; flex: none; }
.bk-flame-outer { fill: var(--bk-flame); }
.bk-flame-core { fill: var(--bk-flame-core); }
.bk-flame:not(.is-lit) .bk-flame-icon { filter: grayscale(1); opacity: .35; }
.bk-flame:not(.is-lit) b { color: var(--bk-muted); }
.bk-flame.is-lit .bk-flame-icon { animation: bk-flicker 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes bk-flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.05, .97) rotate(-2deg); } 60% { transform: scale(.97, 1.04) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .bk-flame.is-lit .bk-flame-icon { animation: none; } }
@media (max-width: 480px) { .bk-account-name { display: none; } }

/* ---- the welcome page for visitors ------------------------------------------------ */
.bk-landing { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.bk-landing > * { min-width: 0; }
.bk-hero { text-align: center; padding: 12px 8px 0; }
.bk-hero-title { font-family: var(--bk-serif); font-size: clamp(36px, 9vw, 64px); line-height: 1.05; margin: 4px 0 10px; color: var(--bk-ink); }
.bk-hero-lead { font-size: clamp(17px, 4.4vw, 21px); line-height: 1.5; max-width: 560px; margin: 0 auto 18px; color: var(--bk-ink); }
.bk-hero-cta { font-size: 19px; min-height: 56px; padding: 0 40px; border-radius: 999px; box-shadow: 0 8px 22px var(--bk-shadow); }
.bk-hero--end { padding-bottom: 12px; }
.bk-features { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.bk-feature { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: 16px; padding: 16px; }
.bk-feature .bk-icon, .bk-feature .bk-flame-icon { width: 30px; height: 30px; color: var(--bk-brass); }
.bk-feature h2 { font-family: var(--bk-serif); font-size: 20px; margin: 8px 0 4px; }
.bk-feature p { margin: 0; color: var(--bk-muted); line-height: 1.5; }

/* ---- sign in: Google first, the rest one tap away -------------------------------- */
.bk-login { text-align: center; }
.bk-login .bk-google { min-height: 56px; font-size: 18px; margin-top: 8px; }
.bk-login-note { margin: 8px 0 18px; }
.bk-login-other { text-align: start; }
.bk-login-other > summary { justify-content: center; }
.bk-scan-switch { text-align: center; margin: 0 0 12px; }
/* ---- the page wheel (Avi, 2026-10-21): flick the pages, a leaf turns ------------- */
.bk-flip { display: grid; gap: 6px; outline: none; }
.bk-flip:focus-visible .bk-flip-pad { outline: 2px solid var(--bk-brass); outline-offset: 3px; }
.bk-flip-label { margin: 0; text-align: center; }
.bk-flip-pad { touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; display: grid; justify-items: center; gap: 4px; padding: 6px 0 2px; }
.bk-flip.is-held .bk-flip-pad { cursor: grabbing; }
.bk-flip-book { position: relative; width: 210px; height: 128px; perspective: 700px; display: grid; grid-template-columns: 1fr 1fr; }
.bk-flip-side { background: var(--bk-surface); border: 1px solid var(--bk-line); box-shadow: 0 6px 16px var(--bk-shadow); display: grid; place-items: center; }
html[dir="rtl"] .bk-flip-side--read { order: 2; border-radius: 0 10px 10px 0; background: linear-gradient(to left, var(--bk-surface) 80%, var(--bk-surface-2)); }
html[dir="rtl"] .bk-flip-side--ahead { order: 1; border-radius: 10px 0 0 10px; background: linear-gradient(to right, var(--bk-surface) 80%, var(--bk-surface-2)); }
html[dir="ltr"] .bk-flip-side--read { border-radius: 10px 0 0 10px; background: linear-gradient(to right, var(--bk-surface) 80%, var(--bk-surface-2)); }
html[dir="ltr"] .bk-flip-side--ahead { border-radius: 0 10px 10px 0; background: linear-gradient(to left, var(--bk-surface) 80%, var(--bk-surface-2)); }
.bk-flip-n { font-family: var(--bk-serif); font-size: 44px; font-weight: 700; color: var(--bk-ink); font-variant-numeric: tabular-nums; }
.bk-flip-leaf { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--bk-surface); border: 1px solid var(--bk-line); opacity: 0; pointer-events: none; }
html[dir="rtl"] .bk-flip-leaf { left: 0; transform-origin: right center; border-radius: 10px 0 0 10px; }
html[dir="ltr"] .bk-flip-leaf { right: 0; transform-origin: left center; border-radius: 0 10px 10px 0; }
html[dir="rtl"] .bk-flip-leaf.is-turning { animation: bk-leaf-rtl .32s ease-in forwards; }
html[dir="rtl"] .bk-flip-leaf.is-back { animation: bk-leaf-rtl .32s ease-out reverse forwards; }
html[dir="ltr"] .bk-flip-leaf.is-turning { animation: bk-leaf-ltr .32s ease-in forwards; }
html[dir="ltr"] .bk-flip-leaf.is-back { animation: bk-leaf-ltr .32s ease-out reverse forwards; }
@keyframes bk-leaf-rtl { 0% { opacity: 1; transform: rotateY(0); filter: brightness(1); } 60% { filter: brightness(.82); } 100% { opacity: .2; transform: rotateY(180deg); filter: brightness(1); } }
@keyframes bk-leaf-ltr { 0% { opacity: 1; transform: rotateY(0); filter: brightness(1); } 60% { filter: brightness(.82); } 100% { opacity: .2; transform: rotateY(-180deg); filter: brightness(1); } }
.bk-flip-ruler { position: relative; width: 100%; max-width: 320px; height: 34px; overflow: hidden; -webkit-mask-image: linear-gradient(to right, transparent, black 25%, black 75%, transparent); mask-image: linear-gradient(to right, transparent, black 25%, black 75%, transparent); }
.bk-flip-ruler::after { content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 22px; margin-left: -1px; background: var(--bk-brass); border-radius: 2px; }
.bk-flip-tick { position: absolute; left: 50%; top: 4px; width: 1px; height: 10px; background: var(--bk-muted); will-change: transform; }
.bk-flip-tick.is-five { height: 16px; top: 2px; }
.bk-flip-tick[data-page]:not([data-page=""])::after { content: attr(data-page); position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--bk-muted); }
.bk-flip-hint { margin: 0; font-size: 12px; color: var(--bk-muted); }
.bk-flip-gained { margin: 0; min-height: 22px; text-align: center; font-weight: 700; color: var(--bk-brass); }
.bk-flip-steps .bk-btn { min-width: 48px; }
.bk-flip-steps { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.bk-flip-type { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bk-muted); }
.bk-flip-type .bk-input { width: 84px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .bk-flip-leaf { display: none; } }
.bk-go-on { white-space: normal; line-height: 1.3; }
.bk-link-quiet { display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 14px; color: var(--bk-muted); }
/* ---- my thoughts while reading (Avi, 2026-10-21) --------------------------------- */
dialog.bk-notes { width: 100%; max-width: 560px; max-height: 88vh; margin: auto auto 0; padding: 14px 18px 22px; border: 0; border-radius: 16px 16px 0 0; background: var(--bk-surface); color: var(--bk-ink); box-shadow: 0 -10px 30px var(--bk-shadow-strong); overflow: auto; }
dialog.bk-notes::backdrop { background: var(--bk-scrim); }
dialog.bk-notes[open] { animation: bk-sheet-up .22s ease-out; }
@keyframes bk-sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) { dialog.bk-notes { margin: auto; border-radius: 16px; } }
.bk-notes-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; max-height: 38vh; overflow: auto; }
.bk-notes-list li { position: relative; background: var(--bk-ground); border: 1px solid var(--bk-line); border-radius: 12px; padding: 10px 12px; }
.bk-notes-list p { margin: 0 0 4px; line-height: 1.5; white-space: pre-wrap; }
.bk-notes-meta { font-size: 12px; color: var(--bk-muted); }
.bk-notes-del { position: absolute; inset-inline-end: 6px; bottom: 4px; background: none; border: 0; color: var(--bk-muted); font-size: 12px; text-decoration: underline; min-height: 32px; padding: 0 6px; cursor: pointer; }
.bk-notes-form { gap: 8px; }
@keyframes bk-rec { 50% { opacity: .25; } }
.bk-notes-read { margin: 10px 0; }
.bk-notes-read .bk-notes-list { max-height: none; }
/* ---- the reading dial (Avi chose it, 2026-10-21): the ring is today's reading ------ */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }
.bk-dial-zone { container-type: inline-size; display: grid; gap: 4px; }
.bk-dial-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; justify-items: center; gap: 6px; }
.bk-dial-form { display: contents; }
.bk-dial { --p: var(--goal, 0); position: relative; width: clamp(160px, 56cqi, 230px); aspect-ratio: 1; border: 0; padding: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; text-decoration: none; color: var(--bk-ink); font: inherit;
  background: conic-gradient(var(--bk-brass) calc(var(--p) * 1%), var(--bk-surface-2) 0);
  box-shadow: 0 12px 26px var(--bk-shadow); animation: bk-dial-fill 1.1s cubic-bezier(.3, 1.2, .5, 1) both;
  transition: transform .18s ease, box-shadow .18s ease; }
.bk-dial.is-done { background: conic-gradient(var(--bk-flame) 0 100%, var(--bk-surface-2) 0); }
@keyframes bk-dial-fill { from { --p: 0; } }
.bk-dial::before { content: ""; position: absolute; inset: 7%; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--bk-line) 0 1.2deg, transparent 1.2deg 6deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 88%, black 89%); mask: radial-gradient(circle closest-side, transparent 88%, black 89%); }
.bk-dial:has(.bk-dial-book)::before { display: none; }
.bk-dial-face { position: absolute; inset: 12%; border-radius: 50%; background: var(--bk-surface); box-shadow: inset 0 2px 8px var(--bk-shadow);
  display: grid; place-content: center; text-align: center; gap: 2px; padding: 0 10%; }
.bk-dial:has(.bk-dial-book) .bk-dial-face { inset: 16%; }
.bk-dial-face b { font-family: var(--bk-serif); font-size: clamp(16px, 6.4cqi, 21px); line-height: 1.1; }
.bk-dial-face i { font-style: normal; font-size: 12px; color: var(--bk-muted); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-dial-face small { font-size: 11px; color: var(--bk-brass); font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.bk-dial:hover { box-shadow: 0 16px 30px var(--bk-shadow); }
.bk-dial:active { transform: scale(.97); }
.bk-dial:focus-visible { outline: 3px solid var(--bk-brass); outline-offset: 4px; }
.bk-pebble { width: clamp(60px, 20cqi, 88px); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--bk-line); background: var(--bk-surface-2);
  color: var(--bk-ink); text-decoration: none; display: grid; place-items: center; text-align: center; padding: 8px;
  font-size: 13px; font-weight: 700; line-height: 1.2; margin-bottom: 8px; box-shadow: 0 6px 14px var(--bk-shadow);
  transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.bk-pebble:hover { transform: translateY(-3px); }
.bk-pebble:active { transform: scale(.92); }
@media (prefers-reduced-motion: reduce) { .bk-dial { animation: none; transition: none; } .bk-pebble { transition: none; } }
/* the dial's inner ring: how far into the book (when its length is known) */
@property --b { syntax: "<number>"; inherits: false; initial-value: 0; }
.bk-dial-book { --b: var(--book, 0); position: absolute; inset: 8%; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--bk-ok) calc(var(--b) * 1%), var(--bk-surface-2) 0);
  -webkit-mask: radial-gradient(circle closest-side, transparent 91.5%, black 92.5%); mask: radial-gradient(circle closest-side, transparent 91.5%, black 92.5%);
  animation: bk-dial-book 1.4s .2s cubic-bezier(.3, 1.2, .5, 1) both; }
@keyframes bk-dial-book { from { --b: 0; } }
.bk-dial-face em { font-style: normal; font-size: 11px; color: var(--bk-ok); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .bk-dial-book { animation: none; } }
.bk-total-pages .bk-input { max-width: 160px; }
/* ---- the reading screen, round 3 (Avi, 2026-10-21) ------------------------------- */
.bk-reading.is-paused .bk-timer { opacity: .45; }

/* the microphone: the main way in when there is one */
.bk-mic { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 64px; border-radius: 999px;
  border: 0; background: var(--bk-brass); color: var(--bk-on-brass); font: inherit; font-size: 18px; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 18px var(--bk-shadow); }
.bk-mic:disabled { opacity: .6; }
.bk-mic-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--bk-on-brass); }
.bk-mic.is-on { background: var(--bk-danger); color: var(--bk-on-danger); }
.bk-mic.is-on .bk-mic-dot { background: var(--bk-on-danger); animation: bk-rec 1s ease-in-out infinite; }
form.has-mic textarea[data-voice-text] { min-height: 0; }

/* "I finished the book!": a ribbon of a button, then the celebration */
.bk-finish-open { display: block; width: 100%; margin: 14px 0 6px; min-height: 60px; border: 0; border-radius: 14px; cursor: pointer;
  font: inherit; font-family: var(--bk-serif); font-size: 21px; font-weight: 700; color: var(--bk-on-brass); position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--bk-flame), var(--bk-brass) 55%, var(--bk-flame));
  background-size: 220% 100%; animation: bk-finish-sheen 5s ease-in-out infinite; box-shadow: 0 10px 22px var(--bk-shadow); }
.bk-finish-open::before, .bk-finish-open::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--bk-flame-core); top: 12px; }
.bk-finish-open::before { inset-inline-start: 18px; box-shadow: 14px 22px 0 -2px var(--bk-on-brass), 30px 4px 0 -3px var(--bk-flame-core); }
.bk-finish-open::after { inset-inline-end: 18px; box-shadow: -14px 22px 0 -2px var(--bk-on-brass), -30px 4px 0 -3px var(--bk-flame-core); }
.bk-finish-open:active { transform: scale(.98); }
@keyframes bk-finish-sheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
dialog.bk-finish { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: auto; }
dialog.bk-finish::backdrop { background: var(--bk-scrim); backdrop-filter: blur(2px); }
.bk-finish-sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bk-finish-card { position: relative; max-width: 440px; margin: 12vh auto 24px; padding: 22px 20px 16px; background: var(--bk-surface); color: var(--bk-ink);
  border-radius: 20px; box-shadow: 0 24px 50px var(--bk-shadow-strong); text-align: center; outline: none; animation: bk-finish-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@media (max-width: 480px) { .bk-finish-card { margin: 8vh 16px 24px; } }
@keyframes bk-finish-pop { from { transform: scale(.85) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.bk-finish-title { font-family: var(--bk-serif); font-size: 44px; line-height: 1; margin: 6px 0 4px; color: var(--bk-flame); }
.bk-finish-book { font-family: var(--bk-serif); font-size: 20px; margin: 0 0 14px; }
.bk-finish-ask { margin: 0; color: var(--bk-muted); }
.bk-finish-card .bk-form { text-align: start; gap: 8px; }
.bk-finish-cancel { background: none; border: 0; color: var(--bk-muted); font: inherit; font-size: 13px; text-decoration: underline; min-height: 44px; cursor: pointer; margin-top: 4px; }
.bk-finished-note { margin: 0; }
@media (prefers-reduced-motion: reduce) { .bk-finish-open, .bk-finish-card { animation: none; } }

@media (prefers-reduced-motion: reduce) { dialog.bk-notes[open], .bk-mic.is-on .bk-mic-dot { animation: none; } }
/* ---- the reading candle (Avi chose it, 2026-10-21): it burns down over an hour ---- */
.bk-candle { --h: 1; --wax-max: 112px; position: relative; width: 140px; height: calc(var(--wax-max) + 70px); margin: 10px auto 0;
  display: grid; justify-items: center; align-content: end; }
.bk-candle-wax { position: relative; width: 40px; height: calc(var(--h) * var(--wax-max)); border-radius: 8px 8px 4px 4px;
  background: linear-gradient(90deg, var(--bk-wax-edge), var(--bk-wax) 35%, var(--bk-wax) 70%, var(--bk-wax-edge)); transition: height 1s linear; }
.bk-candle-wax::before { content: ""; position: absolute; top: -3px; left: 0; right: 0; height: 9px; border-radius: 50%; background: var(--bk-wax); box-shadow: inset 0 2px 3px var(--bk-wax-edge); }
.bk-drip { position: absolute; top: 3px; width: 6px; border-radius: 0 0 6px 6px; background: var(--bk-wax); }
.bk-drip--a { left: 5px; height: 20px; } .bk-drip--b { right: 8px; height: 12px; }
.bk-candle-dish { width: 84px; height: 11px; border-radius: 50%; background: var(--bk-wood); box-shadow: 0 6px 10px var(--bk-shadow); }
.bk-candle-wick, .bk-candle-flame, .bk-candle-glow, .bk-candle-smoke { position: absolute; left: 50%; transition: bottom 1s linear; }
.bk-candle-wick { bottom: calc(var(--h) * var(--wax-max) + 18px); width: 2px; height: 9px; margin-left: -1px; background: var(--bk-ink); }
.bk-candle-flame { bottom: calc(var(--h) * var(--wax-max) + 25px); width: 16px; height: 30px; margin-left: -8px;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 75%, var(--bk-on-brass) 0 18%, var(--bk-flame-core) 40%, var(--bk-flame) 75%, transparent 76%);
  transform-origin: 50% 90%; animation: bk-candle-flicker 1.6s ease-in-out infinite; filter: drop-shadow(0 0 10px var(--bk-flame-core)); }
.bk-candle-glow { bottom: calc(var(--h) * var(--wax-max) - 20px); width: 170px; height: 170px; margin-left: -85px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle closest-side, var(--bk-lamp-glow), transparent); }
.bk-candle-smoke { bottom: calc(var(--h) * var(--wax-max) + 26px); width: 20px; height: 50px; margin-left: -10px; opacity: 0; }
.bk-candle-smoke i { position: absolute; bottom: 0; left: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--bk-muted); opacity: 0; }
@keyframes bk-candle-flicker { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.06, .95) rotate(-3deg); } 50% { transform: scale(.95, 1.06) rotate(2deg); } 75% { transform: scale(1.03, .98) rotate(-1deg); } }
/* paused: the candle goes out and a wisp of smoke rises */
.bk-reading.is-paused .bk-candle-flame, .bk-reading.is-paused .bk-candle-glow { opacity: 0; transition: opacity .4s; }
.bk-reading.is-paused .bk-candle-smoke { opacity: 1; }
.bk-reading.is-paused .bk-candle-smoke i { animation: bk-smoke 2.4s ease-out infinite; }
.bk-reading.is-paused .bk-candle-smoke i:nth-child(2) { animation-delay: .8s; } .bk-reading.is-paused .bk-candle-smoke i:nth-child(3) { animation-delay: 1.6s; }
@keyframes bk-smoke { 0% { transform: translate(0, 0) scale(1); opacity: .55; } 100% { transform: translate(6px, -46px) scale(4); opacity: 0; } }
.bk-reading .bk-timer { margin-top: 4px; }

/* ---- what I think: the breathing button (Avi chose it, 2026-10-21) ------------------ */
.bk-think { display: grid; justify-items: center; gap: 6px; margin: 6px 0 16px; }
.bk-orb { position: relative; width: 148px; height: 148px; border-radius: 50%; border: 0; cursor: pointer; background: var(--bk-brass); color: var(--bk-on-brass);
  font: inherit; display: grid; place-content: center; text-align: center; gap: 2px; box-shadow: 0 12px 26px var(--bk-shadow); margin: 10px 0 4px; }
.bk-orb b { font-family: var(--bk-serif); font-size: 21px; }
.bk-orb small { font-size: 12px; opacity: .9; }
.bk-orb::before, .bk-orb::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--bk-brass); opacity: .5; animation: bk-breathe 3.2s ease-out infinite; pointer-events: none; }
.bk-orb::after { animation-delay: 1.6s; }
@keyframes bk-breathe { from { transform: scale(.92); opacity: .6; } to { transform: scale(1.25); opacity: 0; } }
.bk-orb.is-on { background: var(--bk-danger); color: var(--bk-on-danger); }
.bk-orb.is-on::before, .bk-orb.is-on::after { border-color: var(--bk-danger); animation-duration: 1.4s; }
.bk-orb:disabled { opacity: .7; }
.bk-orb-wave { display: flex; gap: 4px; align-items: center; justify-content: center; height: 24px; margin-top: 4px; }
.bk-orb-wave i { width: 4px; height: 6px; border-radius: 2px; background: currentColor; }
.bk-orb.is-on .bk-orb-wave i { animation: bk-wave .9s ease-in-out infinite; }
.bk-orb.is-on .bk-orb-wave i:nth-child(2) { animation-delay: .15s; } .bk-orb.is-on .bk-orb-wave i:nth-child(3) { animation-delay: .3s; }
.bk-orb.is-on .bk-orb-wave i:nth-child(4) { animation-delay: .45s; } .bk-orb.is-on .bk-orb-wave i:nth-child(5) { animation-delay: .6s; }
@keyframes bk-wave { 50% { height: 22px; } }
.bk-think-status { margin: 0; min-height: 18px; text-align: center; }
.bk-think-card { width: 100%; display: grid; gap: 8px; background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: 16px; padding: 12px; animation: bk-sheet-up .2s ease-out; }
.bk-think-card[hidden] { display: none; }
.bk-think-links { display: flex; gap: 14px; justify-content: center; margin: 0; }
.bk-think-links button { background: none; border: 0; font: inherit; font-size: 14px; color: var(--bk-muted); text-decoration: underline; min-height: 44px; padding: 0 6px; cursor: pointer; }
.bk-think-links button[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .bk-candle-flame, .bk-orb::before, .bk-orb::after, .bk-orb.is-on .bk-orb-wave i, .bk-reading.is-paused .bk-candle-smoke i, .bk-think-card { animation: none; } }
/* ---- the streak moment (Avi, 2026-10-21: "like Duolingo") ------------------------- */
.bk-streak-moment { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px 22px;
  background: var(--bk-ground); text-align: center; animation: bk-sm-in .3s ease-out; overflow: hidden; }
.bk-streak-moment.is-leaving { animation: bk-sm-out .26s ease-in forwards; }
@keyframes bk-sm-in { from { opacity: 0; } }
@keyframes bk-sm-out { to { opacity: 0; transform: scale(1.04); } }
.bk-sm-flame { width: 120px; height: 120px; animation: bk-sm-ignite 1.1s cubic-bezier(.3, 1.6, .5, 1) .15s both; filter: drop-shadow(0 0 22px var(--bk-flame-core)); }
@keyframes bk-sm-ignite { 0% { transform: scale(.4); filter: grayscale(1) opacity(.4); } 60% { transform: scale(1.18); } 100% { transform: scale(1); filter: drop-shadow(0 0 22px var(--bk-flame-core)); } }
.bk-sm-burst { position: absolute; left: 50%; top: calc(50% - 120px); width: 0; height: 0; }
.bk-sm-burst i { position: absolute; width: 8px; height: 18px; margin: -9px 0 0 -4px; border-radius: 4px; background: var(--bk-flame-core);
  transform: rotate(calc(var(--i) * 30deg)) translateY(0); opacity: 0; animation: bk-sm-spark .9s ease-out .5s both; }
.bk-sm-burst i:nth-child(even) { background: var(--bk-flame); height: 12px; }
@keyframes bk-sm-spark { 0% { opacity: 1; transform: rotate(calc(var(--i) * 30deg)) translateY(-30px); } 100% { opacity: 0; transform: rotate(calc(var(--i) * 30deg)) translateY(-130px); } }
.bk-sm-count { height: 84px; overflow: hidden; font-family: var(--bk-serif); font-size: 76px; font-weight: 700; line-height: 84px; color: var(--bk-flame); font-variant-numeric: tabular-nums; }
.bk-sm-roll { display: flex; flex-direction: column; animation: bk-sm-roll .7s cubic-bezier(.3, 1.5, .5, 1) .9s both; }
.bk-sm-roll b { display: block; height: 84px; }
@keyframes bk-sm-roll { from { transform: translateY(0); } to { transform: translateY(-84px); } }
.bk-sm-title { font-family: var(--bk-serif); font-size: 30px; margin: 0; animation: bk-sm-rise .5s ease-out 1.2s both; }
.bk-sm-sub { margin: 0; color: var(--bk-muted); animation: bk-sm-rise .5s ease-out 1.35s both; }
@keyframes bk-sm-rise { from { opacity: 0; transform: translateY(12px); } }
.bk-sm-week { list-style: none; margin: 14px 0 6px; padding: 12px 14px; display: flex; gap: 10px; background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: 16px;
  animation: bk-sm-rise .5s ease-out 1.5s both; }
.bk-sm-week li { display: grid; justify-items: center; gap: 4px; }
.bk-sm-week small { font-size: 12px; color: var(--bk-muted); }
.bk-sm-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--bk-surface-2); border: 2px solid var(--bk-line); }
.bk-sm-week li.is-on .bk-sm-dot { background: var(--bk-flame); border-color: var(--bk-flame); }
.bk-sm-week li.is-today .bk-sm-dot { animation: bk-sm-pop .6s cubic-bezier(.3, 1.8, .5, 1) 1.9s both; box-shadow: 0 0 0 4px var(--bk-flame-core); }
.bk-sm-week li.is-today small { color: var(--bk-flame); font-weight: 700; }
@keyframes bk-sm-pop { 0% { transform: scale(.3); background: var(--bk-surface-2); border-color: var(--bk-line); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
.bk-sm-go { max-width: 320px; margin-top: 10px; animation: bk-sm-rise .5s ease-out 2.1s both; }
@media (prefers-reduced-motion: reduce) { .bk-streak-moment *, .bk-streak-moment { animation: none !important; } .bk-sm-roll { transform: translateY(-84px); } .bk-sm-burst { display: none; } }
/* ---- the page never slides sideways on a phone (Avi, 2026-10-21) ------------------ */
html, body { max-width: 100%; overflow-x: clip; }
.bk-header { min-width: 0; }
.bk-account { min-width: 0; flex-wrap: nowrap; }
@media (max-width: 599px) {
  .bk-wide-only { display: none; }
  .bk-header { padding-inline: 16px; }
  .bk-wordmark { font-size: 26px; }
  .bk-main { padding-inline: 16px; }
}
.bk-signout { margin: 0; }

/* iPhone zooms the page into any field under 16px, and then it slides sideways (Avi, 2026-10-21) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.bk-input, .bk-select, .bk-textarea, input, select, textarea { font-size: max(16px, 1em); }
.bk-wordmark { display: inline-flex; align-items: center; min-height: 44px; }
/* the menu's one door to the rest of babook (Avi, 2026-10-21) */
.bk-nav-item--site { white-space: nowrap; }
.bk-side .bk-nav-item--site { margin-top: 14px; border-top: 1px solid var(--bk-line); padding-top: 14px; }
/* ---- beside the shelf: which way the titles read, and search (Avi, 2026-10-22) ---- */
.bk-shelf.is-text-down .bk-spine-title, .bk-shelf.is-text-down .bk-spine-author { transform: rotate(180deg); }
.bk-shelf-hints-end { display: inline-flex; align-items: center; gap: 4px; }
.bk-shelf-tool { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--bk-line);
  background: var(--bk-surface); color: var(--bk-ink); cursor: pointer; padding: 0; text-decoration: none; }
.bk-shelf-tool .bk-icon { width: 20px; height: 20px; }
.bk-shelf-tool[aria-pressed="true"] { border-color: var(--bk-brass); color: var(--bk-brass); }
.bk-shelf-tool[aria-pressed="true"] .bk-icon { transform: scaleY(-1); }
/* ---- "me": facts with a small edit button, not a form (Avi, 2026-10-22) ------------ */
.bk-me { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.bk-me-initial { flex: none; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--bk-brass); color: var(--bk-on-brass);
  font-family: var(--bk-serif); font-size: 28px; font-weight: 700; }
.bk-me-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
.bk-props { display: block; }
.bk-prop-list { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: 14px; overflow: hidden; }
.bk-prop + .bk-prop { border-top: 1px solid var(--bk-line); }
.bk-prop > summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 4px 10px;
  min-height: 56px; padding: 6px 6px 6px 14px; cursor: pointer; }
html[dir="rtl"] .bk-prop > summary { padding: 6px 14px 6px 6px; }
.bk-prop > summary::-webkit-details-marker { display: none; }
.bk-prop-label { color: var(--bk-muted); font-size: 14px; }
.bk-prop-value { font-weight: 600; text-align: end; overflow-wrap: anywhere; }
.bk-prop-value.is-empty { color: var(--bk-muted); font-weight: 400; }
.bk-prop-edit { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--bk-brass); }
.bk-prop-edit .bk-icon { width: 18px; height: 18px; }
.bk-prop[open] > summary .bk-prop-edit { background: var(--bk-surface-2); }
.bk-prop-body { display: grid; gap: 10px; padding: 0 14px 14px; }
.bk-prop-actions { display: flex; gap: 8px; }
/* ---- the first time with a book (Avi, 2026-10-22) ---------------------------------- */
.bk-first-step { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: start; margin: 0 0 16px;
  background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: 16px; padding: 14px; }
.bk-first-back { grid-template-columns: minmax(0, 1fr); }
.bk-first-cover { width: 112px; aspect-ratio: 2 / 3; border-radius: 4px 8px 8px 4px; overflow: hidden; background: var(--bk-surface-2);
  box-shadow: 0 8px 18px var(--bk-shadow); display: grid; place-content: center; text-align: center; padding: 0; }
.bk-first-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bk-first-cover.bk-cover-drawn { padding: 10px 8px; }
.bk-first-cover .bk-cover-title { font-size: 14px; }
.bk-first-go { margin-top: 4px; }
.bk-first { padding-bottom: 8px; }
.bk-first-text { min-width: 0; }
/* ---- the real spine, cut from my shelf photo (Avi, 2026-10-22) --------------------- */
.bk-spine--photo { background-color: var(--spine-bg); background-image: var(--spine-img); background-size: 100% 100%; background-repeat: no-repeat; }
.bk-spine--photo .bk-spine-band, .bk-spine--photo .bk-spine-title, .bk-spine--photo .bk-spine-author { visibility: hidden; }
.bk-spine--photo::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .18), rgba(255, 255, 255, .06) 30%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .22)); }
/* A mouse pans the shelf by dragging (Avi, 2026-10-22). */
@media (hover: hover) and (pointer: fine) {
  .bk-shelf-row { cursor: grab; }
  .bk-shelf-row.is-panning, .bk-shelf-row.is-panning .bk-spine { cursor: grabbing; user-select: none; }
}
.bk-spines-progress { margin: 6px 0 0; text-align: center; }
/* ---- a tapped book floats over the page (Avi, 2026-10-24); the shelf never moves ----------- */
.bk-float { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.bk-float .bk-spine--float {
  position: absolute; left: 0; top: 0; bottom: auto; margin: 0; z-index: 2; pointer-events: auto; cursor: zoom-out;
  transform-origin: 0 0; opacity: 1;
  transition: transform 340ms cubic-bezier(.2, 1.25, .4, 1), box-shadow 300ms ease, filter 300ms ease;
  box-shadow: 0 24px 40px var(--bk-shadow-strong), 0 0 0 1px var(--bk-brass), 0 0 40px var(--bk-lamp-glow);
}
.bk-float.is-closing .bk-spine--float { transition: transform 280ms cubic-bezier(.4, 0, .6, 1), box-shadow 200ms ease; box-shadow: none; }
.bk-float .bk-float-tag {
  position: absolute; margin: 0 !important; pointer-events: auto; z-index: 3; max-height: calc(100vh - 140px); overflow: auto;
  box-shadow: 0 18px 36px var(--bk-shadow-strong); opacity: 0; transform: translateY(6px);
  transition: opacity 220ms ease 120ms, transform 260ms ease 120ms;
}
.bk-float.is-open .bk-float-tag { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .bk-float .bk-spine--float, .bk-float .bk-float-tag { transition: none; }
}
/* drawn spines on a shelf that has photos: the photo steps aside, the text comes back */
.bk-shelf.is-drawn .bk-spine--photo { background-image: none; }
.bk-shelf.is-drawn .bk-spine--photo::after { display: none; }
.bk-shelf.is-drawn .bk-spine--photo .bk-spine-band, .bk-shelf.is-drawn .bk-spine--photo .bk-spine-title,
.bk-shelf.is-drawn .bk-spine--photo .bk-spine-author { visibility: visible; }
.bk-shelf-look { font-size: 12px; color: var(--bk-muted); white-space: nowrap; min-width: 0; }
/* A photographed spine keeps its true width; a thumb still gets 24px or more to tap. */
.bk-spine--photo::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(min(0px, (var(--spine-w, 24px) - 24px) / 2)); right: calc(min(0px, (var(--spine-w, 24px) - 24px) / 2)); }
/* editing a book: its cover beside the button that replaces it */
.bk-edit-cover { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.bk-edit-cover img { width: 72px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px 6px 6px 3px; box-shadow: 0 4px 10px var(--bk-shadow); }
/* ---- friends (Avi, 2026-10-22) ------------------------------------------------------ */
.bk-invite { background: var(--bk-surface); border: 1px solid var(--bk-line); border-radius: 18px; padding: 18px 16px; display: grid; gap: 10px;
  box-shadow: 0 10px 24px var(--bk-shadow); margin-bottom: 18px; }
.bk-invite-title { font-family: var(--bk-serif); font-size: 24px; margin: 0; }
.bk-invite-lead { margin: 0; color: var(--bk-muted); line-height: 1.5; }
.bk-invite-share { min-height: 52px; font-size: 17px; gap: 8px; }
.bk-invite-way { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; border: 1px solid var(--bk-line);
  background: var(--bk-ground); color: var(--bk-ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.bk-invite-way:hover { border-color: var(--bk-brass); color: var(--bk-ink); }
.bk-invite-qr { justify-self: center; text-align: center; background: var(--bk-qr-bg); color: var(--bk-qr-ink); padding: 14px; border-radius: 12px; }
.bk-invite-qr .bk-help { color: var(--bk-qr-ink); }
.bk-invite-qr img { display: block; width: 220px; height: 220px; }
.bk-invite-link { margin: 0; font-size: 12px; color: var(--bk-muted); text-align: center; overflow-wrap: anywhere; }
.bk-friend-search { margin: 0 0 10px; }
.bk-friend-tabs { margin: 6px 0 8px; }
.bk-friend-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.bk-friend { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--bk-line);
  border-radius: 14px; background: var(--bk-surface); }
.bk-friend-who { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--bk-ink); text-decoration: none; min-height: 44px; }
.bk-friend-who small { display: block; color: var(--bk-muted); font-size: 12px; }
.bk-avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bk-brass);
  color: var(--bk-on-brass); font-family: var(--bk-serif); font-weight: 700; font-size: 18px; }
.bk-avatar--big { width: 54px; height: 54px; font-size: 24px; }
.bk-friend-menu .bk-menu-pop p { padding: 0 14px 8px; }
.bk-menu { position: relative; }
.bk-quick-friends { grid-column: 1 / -1; flex-direction: row; min-height: 56px; position: relative; }
.bk-quick-badge { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 999px; background: var(--bk-flame); color: var(--bk-on-brass); display: inline-grid; place-items: center; font-size: 13px; }
.bk-invited { margin: 0 auto 10px; display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--bk-surface);
  border: 1px solid var(--bk-brass); color: var(--bk-ink); font-weight: 700; }
/* the brass plate over someone else's shelf */
.bk-plate { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; width: fit-content; max-width: calc(100% - 32px);
  margin: 6px auto 4px; padding: 8px 18px; border-radius: 6px; color: var(--bk-on-brass);
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .12)), var(--bk-brass);
  box-shadow: 0 6px 14px var(--bk-shadow), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -2px 0 rgba(0, 0, 0, .2);
  font-family: var(--bk-serif); font-size: 20px; font-weight: 700; letter-spacing: .01em; text-align: center; }
.bk-plate-text { min-width: 0; overflow-wrap: anywhere; }
.bk-plate-screw { flex: none; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .7), rgba(0, 0, 0, .35)); }
.bk-plate--closed { margin-top: 30px; }
.bk-friend-room { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.bk-friend-room > * { min-width: 0; }
.bk-friend-back { margin: 0; font-size: 14px; }
.bk-friend-public { text-align: center; margin: 4px 0 0; }
.bk-friend-closed { text-align: center; padding: 30px 16px; border: 1px dashed var(--bk-line); border-radius: 16px; background: var(--bk-surface); }
.bk-friend-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--bk-surface); border: 1px solid var(--bk-line);
  max-width: 560px; width: 100%; margin: 6px auto 0; }
.bk-friend-card-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.bk-friend-card-act { flex: none; }
.bk-nav .bk-nav-item { text-align: center; line-height: 1.15; font-size: 11.5px; padding: 0 2px; }

.bk-nav-item--read { white-space: normal; }
/* a spine's picture fades in over its title once it has arrived */
.bk-spine--loading .bk-spine-title, .bk-spine--loading .bk-spine-author { opacity: .85; }
.bk-spine.is-photo-in { animation: bk-photo-in .35s ease-out; }
@keyframes bk-photo-in { from { filter: brightness(1.6) saturate(.4); } to { filter: none; } }
@media (prefers-reduced-motion: reduce) { .bk-spine.is-photo-in { animation: none; } }
/* ---- the invited person's way in (Avi, 2026-10-22) ---------------------------------- */
.bk-hero--invited { display: grid; justify-items: center; }
.bk-hero-avatar { margin-bottom: 4px; width: 64px; height: 64px; font-size: 30px; box-shadow: 0 8px 18px var(--bk-shadow); }
.bk-teaser-note { text-align: center; margin: 0; }
.bk-invited { display: inline-flex; align-items: center; gap: 10px; }
.bk-invited .bk-avatar { width: 32px; height: 32px; font-size: 15px; }
.bk-joined { background: var(--bk-surface); border: 1px solid var(--bk-brass); border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; justify-items: start;
  box-shadow: 0 8px 20px var(--bk-shadow); }
.bk-joined-title { margin: 0; font-family: var(--bk-serif); font-size: 22px; }
.bk-joined-text { margin: 0; color: var(--bk-muted); }
.bk-joined .bk-btn { margin-top: 4px; gap: 8px; }
/* ---- both covers from the reading screen (Avi, 2026-10-23) --------------------------- */
.bk-read-covers { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; flex-wrap: wrap; }
.bk-read-cover-thumb { flex: none; width: 34px; height: 50px; border-radius: 2px 4px 4px 2px; overflow: hidden; background: var(--bk-surface-2);
  box-shadow: 0 3px 8px var(--bk-shadow); display: grid; place-items: center; }
.bk-read-cover-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bk-read-cover-thumb.bk-cover-drawn .bk-cover-title { font-size: 7px; padding: 2px; line-height: 1.1; }
.bk-read-covers .bk-btn { gap: 6px; }
.bk-read-covers-status { margin: 4px 0 0; min-height: 0; }
.bk-read-covers-status:empty { display: none; }
/* ---- the five minutes that earn the day, on the reading screen (Avi, 2026-10-23) ---------- */
.bk-earned { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bk-bg) 55%, transparent); opacity: 0; transition: opacity .35s ease; }
.bk-earned.is-on { opacity: 1; }
.bk-earned[hidden] { display: none; }
.bk-earned-sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bk-earned-card { position: relative; text-align: center; padding: 22px 26px; border-radius: 18px; background: var(--bk-surface);
  box-shadow: 0 18px 40px var(--bk-shadow); max-width: 320px; transform: scale(.85); transition: transform .45s cubic-bezier(.2, 1.4, .4, 1); }
.bk-earned.is-on .bk-earned-card { transform: scale(1); }
.bk-earned-flame { width: 64px; height: 64px; display: block; margin: 0 auto; animation: bk-earned-flicker 1.2s ease-in-out infinite alternate; }
.bk-earned-flame .bk-flame-outer { fill: var(--bk-flame, #E8590C); }
.bk-earned-flame .bk-flame-core { fill: var(--bk-flame-core, #FFB020); }
.bk-earned-n { font-size: 44px; font-weight: 800; line-height: 1; margin: 4px 0 0; color: var(--bk-flame, #E8590C); font-variant-numeric: tabular-nums; }
.bk-earned-title { font-size: 22px; font-weight: 800; margin: 8px 0 4px; color: var(--bk-ink); }
.bk-earned-sub { margin: 0; color: var(--bk-muted); }
@keyframes bk-earned-flicker { from { transform: scale(1) rotate(-2deg); } to { transform: scale(1.08) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .bk-earned-flame { animation: none; } .bk-earned-card { transition: none; } }

/* ---- still reading? (Avi, 2026-10-23) ---------------------------------------------------- */
.bk-still { margin: 12px 0; padding: 14px; border-radius: 14px; background: var(--bk-surface); border: 1px solid var(--bk-brass);
  box-shadow: 0 8px 20px var(--bk-shadow); display: grid; gap: 8px; }
.bk-still[hidden] { display: none; }
.bk-still-title { margin: 0; font-size: 20px; font-weight: 800; text-align: center; color: var(--bk-ink); }
.bk-still-sub { margin: 0; text-align: center; }
.bk-still [hidden] { display: none; }

/* ---- my history: a timeline of the books I read (Avi, 2026-10-23) -------------------------- */
.bk-history-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 12px 0 18px; }
.bk-history-totals div { background: var(--bk-surface); border-radius: 10px; padding: 8px 4px; text-align: center; min-width: 0; }
.bk-history-totals dt { font-size: 12px; color: var(--bk-muted); }
.bk-history-totals dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; color: var(--bk-ink); font-variant-numeric: tabular-nums; }
.bk-timeline, .bk-timeline-books { list-style: none; margin: 0; padding: 0; }
.bk-timeline { position: relative; padding-inline-start: 22px; }
.bk-timeline::before { content: ""; position: absolute; inset-block: 6px 0; inset-inline-start: 7px; width: 2px; border-radius: 2px;
  background: linear-gradient(var(--bk-brass), color-mix(in srgb, var(--bk-brass) 15%, transparent)); }
.bk-timeline-month { margin: 0 0 14px; }
.bk-timeline-when { position: relative; font-size: 14px; font-weight: 700; letter-spacing: .02em; color: var(--bk-brass); margin: 0 0 8px; }
.bk-timeline-when::before { content: ""; position: absolute; inset-inline-start: -21px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bk-bg); border: 2px solid var(--bk-brass); }
.bk-timeline-book { position: relative; margin: 0 0 8px; }
.bk-timeline-book::before { content: ""; position: absolute; inset-inline-start: -18px; top: 26px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--bk-muted); }
.bk-timeline-book.is-finished::before { background: var(--bk-ok); width: 8px; height: 8px; inset-inline-start: -19px; }
.bk-timeline-book.is-now::before { background: var(--bk-flame, #E8590C); }
.bk-timeline-card { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 12px; background: var(--bk-surface);
  color: inherit; text-decoration: none; min-width: 0; }
.bk-timeline-card:hover, .bk-timeline-card:focus-visible { background: var(--bk-surface-2); }
.bk-timeline-text { display: grid; gap: 2px; min-width: 0; }
.bk-timeline-text > * { overflow-wrap: anywhere; }
.bk-timeline-state { font-size: 13px; font-weight: 600; color: var(--bk-ink); }
.is-finished .bk-timeline-state { color: var(--bk-ok); }
.bk-timeline-facts { font-size: 12.5px; color: var(--bk-muted); }
.bk-sittings { margin-top: 10px; }
.bk-sittings-list { margin: 0; padding-inline-start: 18px; font-size: 14px; color: var(--bk-muted); display: grid; gap: 4px; }
/* ---- the straightened cover's way back (Avi, 2026-10-23) ---------------------------------- */
.bk-cover-undo { display: block; min-height: 44px; background: none; border: 0; padding: 0; font: inherit; text-align: start; color: var(--bk-brass); text-decoration: underline; cursor: pointer; }

/* ---- the friends page: search first, the invite behind a button, only what needs me (Avi, 2026-10-23) ---- */
.bk-friend-search { margin: 4px 0 12px; }
.bk-friend-find { position: relative; display: block; }
.bk-friend-find .bk-icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--bk-muted); pointer-events: none; }
.bk-friend-find .bk-input { width: 100%; min-height: 48px; padding-inline-start: 42px; border-radius: 24px; font-size: 16px; }
.bk-friend-results[hidden], .bk-friend-rest[hidden] { display: none; }
.bk-friend-hint { margin: 4px 4px 12px; }
.bk-friend-sec { font-size: 14px; font-weight: 700; color: var(--bk-brass); margin: 18px 2px 8px; letter-spacing: .01em; }
.bk-invite-open { gap: 8px; margin: 2px 0 6px; }
.bk-friend-empty { margin: 8px 2px 0; }
.bk-friend-quiet { margin: 18px 2px 0; text-align: center; }
.bk-friend-all { margin-top: 10px; }
.bk-avatar--quiet { background: var(--bk-surface-2); color: var(--bk-ink); }
dialog.bk-invite-sheet { width: 100%; max-width: 560px; max-height: 90vh; margin: auto auto 0; padding: 14px 18px 22px; border: 0; border-radius: 16px 16px 0 0;
  background: var(--bk-surface); color: var(--bk-ink); box-shadow: 0 -10px 30px var(--bk-shadow-strong); overflow: auto; }
dialog.bk-invite-sheet::backdrop { background: var(--bk-scrim); }
dialog.bk-invite-sheet[open] { animation: bk-sheet-up .22s ease-out; }
dialog.bk-invite-sheet .bk-invite { margin: 0 0 10px; }
@media (min-width: 700px) { dialog.bk-invite-sheet { margin: auto; border-radius: 16px; } }

/* ---- one tap on a friend's book (Avi, 2026-10-23) ---------------------------------------- */
.bk-label-ask { display: grid; gap: 6px; margin-top: 8px; }
.bk-label-ask[hidden] { display: none; }
.bk-label-ask-lead { font-size: 12.5px; color: var(--bk-muted); }
.bk-label-ask-row, .bk-holder-ask { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-holder { flex-wrap: wrap; }
.bk-holder .bk-holder-ask { flex: 1 1 100%; justify-content: flex-end; }
\n
/* ---- the request as a conversation (Avi, 2026-10-23) --------------------------------------- */
.bk-deal-back { margin: 0 0 6px; }
.bk-deal-head { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 10px; }
.bk-deal-cover { width: 56px; height: 80px; flex: none; border-radius: 3px; box-shadow: 0 6px 14px var(--bk-shadow); }
.bk-deal-head-text { min-width: 0; }
.bk-deal-title { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.bk-deal-kind { margin: 2px 0 0; }
.bk-deal-who { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bk-chat { margin: 14px 0 10px; }
.bk-chat-list { display: grid; gap: 8px; max-height: 52vh; overflow: auto; padding: 4px 2px; }
.bk-bubble { max-width: 85%; margin: 0; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--bk-surface); border: 1px solid var(--bk-line); }
.bk-bubble--mine { margin-inline-start: auto; background: var(--bk-surface-2); border-radius: 14px 14px 4px 14px; }
.bk-bubble-body { display: block; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.bk-bubble-meta { display: block; font-size: 11.5px; color: var(--bk-muted); margin-top: 3px; }
.bk-chat-empty { margin: 0; text-align: center; }
.bk-chat-compose { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; align-items: flex-end; padding: 8px 0; margin-top: 6px; background: var(--bk-bg); }
@media (min-width: 900px) { .bk-chat-compose { bottom: 0; } }
.bk-chat-field { flex: 1 1 auto; resize: none; min-height: 44px; max-height: 140px; font-size: 16px; }
.bk-chat-help { margin: 0; font-size: 12px; }


/* ---- my library's rows: a "show" box and the offer menu (Avi, 2026-10-23) ---------------- */
.bk-copy-row { flex-wrap: wrap; align-items: center; }
.bk-copy-flags { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; margin-inline-start: auto; }
.bk-flag { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--bk-muted); white-space: nowrap; }
.bk-flag input { width: 22px; height: 22px; margin: 0; accent-color: var(--bk-brass); cursor: pointer; }
.bk-flag:has(input:checked) { color: var(--bk-ink); }
.bk-flag-select { min-height: 44px; padding: 4px 8px; font-size: 16px; max-width: 132px; }  /* under 16px an iPhone zooms in (mistake 34) */
.bk-flag-select[hidden] { display: none; }
.bk-copy-flags:has(:disabled) { opacity: .6; }
.bk-copy-flags.is-saved .bk-flag { color: var(--bk-ok); }
.bk-copy-flags.is-failed { outline: 1px solid var(--bk-danger); border-radius: 8px; }
@media (max-width: 420px) {
  .bk-copy-row .bk-entry-link { flex: 1 1 100%; }
  .bk-copy-flags { flex: 1 1 100%; justify-content: flex-end; padding-bottom: 2px; }
}
