/* ==========================================================================
   Book card - single source of truth.

   This replaces every book-card rule previously scattered across style.css
   (6+ layered historical redesigns of .book-card/.grid/.book-cover-wrap,
   never cleaned up), postgres-ui.css, card-refresh.css, ui-polish.css and
   ui-polish-2.css. Rebuilt 2026-07-22 from the actual live computed styles
   (Chrome DevTools Protocol getComputedStyle on a real rendered card), not
   from re-reading the old cascade, so this reproduces exactly what was
   really on screen - including several fixes made the same night:
     - align-self:flex-start (an old unscoped ".book-card{align-self:stretch}"
       rule was silently winning and stretching every card to match its row)
     - the cover image centered via position:absolute + transform, not the
       percentage-height-on-a-static-element approach that didn't reliably
       resolve pre-paint
     - cover margin (15px 15px 0) matches the body's own padding so the
       cover and the text block sit the same distance from the card border
     - explicit width/height attributes on <img> (see _book_card.html) so
       the browser reserves the right box before the image loads, avoiding
       a layout-settle glitch for lazy-loaded images inside a horizontally
       scrolling row

   Markup (app/templates/_book_card.html):
     <article class="unified-book-card [compact-book-card] format-paper|format-electronic">
       <a class="unified-card-cover">
         <img class="book-cover">                (or .book-cover-placeholder)
         <span class="card-discount-tag">        (optional)
         <span class="card-rating-hero">         (optional)
       </a>
       <div class="card-quick-actions">
         <button/a class="heart-button">
       </div>
       <div class="book-card-body">
         <div class="card-chip-row"><span class="card-chip ...">
         <div class="book-card-copy">
           <h3 class="book-title"><div class="book-author">
         <div class="card-footer">
           <div class="edition-card-price">
             <div><span class="card-price-row"><strong><s class="card-old-price">
             <button class="card-cart-button">
           <div class="card-compare-line">
   ========================================================================== */

/* --- Card container ---
   2026-07-22: adopted the denser proportions the "related/similar books"
   compact card had (smaller padding, taller 3/4 cover) as the main design
   for every context - it read as cleaner than the original, more padded
   version. Scaled up somewhat from the compact card's own numbers (which
   were tuned for a 6-per-row context), and kept the chip row + compare
   line visible here (the compact variant hid both to save space, but the
   main grid/scroll-row has the room and the info is useful). */
.unified-book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  padding: 12px 12px 14px;
  border: 1px solid var(--line, #e3d9c9);
  border-radius: 16px;
  background: var(--card, #fffaf3);
  box-shadow: 0 8px 22px rgba(52, 36, 21, 0.06);
  box-sizing: border-box;
  overflow: visible;
  cursor: pointer;
  align-self: flex-start;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.unified-book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(52, 36, 21, 0.1);
}
.unified-book-card:focus-visible {
  outline: 3px solid rgba(167, 68, 52, 0.35);
  outline-offset: 4px;
}

/* --- Cover frame: no background box (removed the green-tinted gradient),
   aspect-ratio-driven so it scales with the card's own width, margin
   matches the body's own side/top padding so cover and text line up. --- */
.unified-book-card .unified-card-cover {
  /* Must stay ".unified-book-card .unified-card-cover" (2 classes), not a
     bare ".unified-card-cover" - style.css has an old, still-present
     ".book-card .book-cover-wrap{aspect-ratio:2/3}" (2 classes too) that a
     1-class selector here would lose to regardless of file order. */
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  aspect-ratio: 3 / 4;
  background: transparent;
  border-radius: 13px;
  overflow: hidden;
  box-sizing: border-box;
}

/* --- Cover image: absolute + transform-centered (not percentage-height on
   a static element - see file header) - fills the frame right up to its
   edge, object-fit:contain so it's never cropped at any aspect ratio. --- */
.unified-book-card .book-cover,
.unified-book-card:hover .book-cover,
.book-card:hover .book-cover {
  /* All three selectors matter, not just the plain one: style.css has an
     old ".book-card .book-cover, .book-card:hover .book-cover
     {transform:none!important;...}" rule. The :hover-qualified half is
     (0,0,3,0) specificity (:hover counts like a class) - HIGHER than a
     plain 2-class selector - so on hover specifically it would win outright
     regardless of !important or file order unless matched here too.
     !important throughout because the competing rule also uses it - without
     it, importance alone (checked before specificity) would let style.css's
     version win even at equal/lower specificity. */
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(45, 31, 22, 0.18);
}

/* --- Discount tag / Goodreads rating, overlaid on the cover corners --- */
.unified-book-card .card-discount-tag {
  position: absolute;
  z-index: 7;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--red, #a74434);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(55, 39, 26, 0.2);
}
.unified-book-card .card-rating-stack {
  position: absolute;
  z-index: 6;
  bottom: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.unified-book-card .card-rating-hero {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.94);
  color: #6b4b1f;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(55, 39, 26, 0.14);
}
.unified-book-card .card-rating-goodreads img {
  width: 12px;
  height: 12px;
}

/* .heart-button is also used bare (no .unified-book-card ancestor) on the
   wishlist page's own card layout (app/templates/user/wishlist.html) - not
   scoped to the catalog card component, deliberately - stays the original
   38px size there; the card context sizes both buttons down below. */
.heart-button,
.card-cart-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(91, 69, 50, 0.17);
  border-radius: 12px;
  background: rgba(255, 250, 243, 0.94);
  color: #4c3b30;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(55, 39, 26, 0.14);
  cursor: pointer;
}
.unified-book-card .heart-button,
.unified-book-card .card-cart-button {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 1.15rem;
  flex: 0 0 auto;
}
.unified-book-card .heart-button .icon,
.unified-book-card .card-cart-button .icon {
  width: 18px;
  height: 18px;
}
.heart-button:hover,
.heart-button:focus-visible {
  color: var(--red, #a74434);
}
.card-cart-button:hover,
.card-cart-button:focus-visible {
  color: #176d4f;
}
.heart-button .icon {
  transition: fill 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.heart-button:active .icon {
  transform: scale(0.88);
}
/* Filled red when the book is already saved. There were briefly two
   competing versions of this rule (postgres-ui.css: green, unused since
   ui-polish-2.css's red version loaded later with matching !important and
   actually won) - this is the one that was really on screen. */
.heart-button.is-saved {
  color: #c73b2f;
  background: #fdeceb;
  border-color: rgba(199, 59, 47, 0.3);
}
.heart-button.is-saved .icon {
  fill: currentColor;
}
/* Green check when the book is already in the cart - same treatment as
   the wishlist heart's is-saved state above, distinct color so the two
   states never read as the same thing at a glance. */
.card-cart-button.is-in-cart {
  color: #176d4f;
  background: #e9f4ee;
  border-color: rgba(23, 109, 79, 0.3);
}

/* --- Body: chip row, title/author, footer (price + compare line) --- */
.unified-book-card .book-card-body {
  /* Side padding matches the cover's own extra margin (10px) so text and
     cover line up at the same inset from the card border - same reasoning
     as the original "unify the padding" fix, just re-tuned to the smaller
     numbers here. */
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  gap: 6px;
  padding: 8px 0 8px;
  box-sizing: border-box;
}

.unified-book-card .card-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 20px;
}
.unified-book-card .card-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}
.unified-book-card .card-chip-paper {
  background: #e6f0e4;
  color: #2e6b40;
}
.unified-book-card .card-chip-ebook {
  background: #e4effd;
  color: #2c63ae;
}
.unified-book-card .card-chip-unavailable {
  background: #eee9e3;
  color: var(--muted, #7b7067);
}

.unified-book-card .book-card-copy {
  /* min-height (not per-line-clamped-element height) so a short one-line
     title still sits tight against the author line - any reserved space
     for a hypothetical second title line shows up below the author line
     instead of between title and author, keeping the footer/price row at
     the same vertical position across every card in a row regardless of
     title length. */
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  height: auto;
  min-height: 3.9em;
  overflow: visible;
}
.unified-book-card .book-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  padding: 0;
  font-family: Bitter, Georgia, serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
}
.unified-book-card .book-title a {
  color: inherit;
  text-decoration: none;
}
.unified-book-card .book-author {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  margin-top: 4px;
  color: #75685d;
  font-size: 0.76rem;
  line-height: 1.3;
  white-space: normal;
  text-overflow: ellipsis;
}

.unified-book-card .card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}
.unified-book-card .edition-card-price {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  flex: 0 0 auto;
  height: auto;
  min-height: 54px;
  gap: 10px;
  padding-top: 7px;
  border-top: 1px solid rgba(92, 67, 44, 0.16);
  box-sizing: border-box;
}
.unified-book-card .edition-card-price > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  text-align: center;
}
.unified-book-card .card-price-details {
  min-height: 45px;
  justify-content: center;
}
.unified-book-card .card-price-details.regular-prices {
  justify-content: center;
}
.unified-book-card .card-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 6px;
  min-width: 0;
  /* Reserves 2-line height on every card, not just the ones that actually
     wrap - without this, a discounted card whose old price wraps onto its
     own line (measured 29.1px) ends up 11px taller than a neighboring
     card whose price fits on one line (16.2px), breaking row alignment in
     both .book-grid and .book-row-scroll (cards use height:auto by
     design, see the .unified-book-card comment above, so nothing else
     equalizes them). Confirmed live via CDP on /collection/discount. */
  min-height: 30px;
}
.unified-book-card .card-price-details.has-discount .card-price-row {
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.unified-book-card .card-price-details.regular-prices .card-price-row {
  min-height: 0;
}
.unified-book-card .card-price-row strong,
.unified-book-card .edition-card-price small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* Black by default (both paper and eBook-only cards), red only when
   discounted - a later, higher-specificity rule than the green/blue
   format-coded colors below had actually already replaced them; this
   reproduces the real winning behavior, not the superseded one. */
.unified-book-card .card-price-row strong {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  font-family: Unbounded, Onest, sans-serif;
  font-size: clamp(0.92rem, 1.05vw, 1.15rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #211a14;
  word-break: normal;
}
.unified-book-card .card-price-row strong.price-discounted {
  color: var(--red, #a74434);
}
.unified-book-card .edition-price-format {
  white-space: nowrap;
}
.unified-book-card .card-old-price {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--muted, #8a7d70);
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: line-through;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.unified-book-card .ebook-price-tone {
  margin-top: 5px;
  color: #315f9d;
  font: 600 0.66rem Onest, sans-serif;
}
.unified-book-card .regular-prices .ebook-price-tone {
  margin-top: 2px;
}
.unified-book-card .edition-card-price .card-cart-button {
  justify-self: end;
}
.unified-book-card .edition-card-price .card-heart-form,
.unified-book-card .edition-card-price > .heart-button {
  justify-self: start;
}

.unified-book-card .card-compare-line {
  padding-top: 8px;
  border-top: 1px solid var(--line, #e8ded2);
  color: var(--muted, #8a7d70);
  font-size: 0.7rem;
  text-align: center;
}

/* --- Filter/results toolbars near the offer badges reuse .badge (see
   base site styles) - no card-specific override needed. --- */

/* --- Grid (search/collection results) and horizontal scroll row (home
   page curated collections) - two different layout containers for the
   same card component. --- */
.book-grid,
.collection-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
@media (max-width: 1100px) {
  .book-grid,
  .collection-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .book-grid,
  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .book-grid,
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 370px) {
  .book-grid,
  .collection-grid {
    grid-template-columns: 1fr;
  }
}

.scroll-row-wrap {
  position: relative;
  width: 100%;
}
.book-row-scroll {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  width: 100%;
  gap: 12px;
  padding: 4px 4px 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-left: 4px;
  scrollbar-width: none;
}
.book-row-scroll::-webkit-scrollbar {
  display: none;
}
.book-row-scroll > * {
  flex: 0 0 210px;
  width: 210px;
  max-width: 210px;
  scroll-snap-align: start;
}
@media (max-width: 700px) {
  .book-row-scroll > * {
    flex-basis: 190px;
    width: 190px;
    max-width: 190px;
  }
}

.scroll-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
  place-items: center;
  border: 1px solid var(--line, #e8ded2);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 20px rgba(52, 36, 21, 0.22);
  color: #352a20;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
}
button.scroll-arrow:hover {
  transform: translateY(-50%) scale(1.08);
  border-color: #c9a173;
  box-shadow: 0 10px 24px rgba(52, 36, 21, 0.3);
}
button.scroll-arrow:active {
  transform: translateY(-50%) scale(0.96);
}
.scroll-arrow-left {
  left: -8px;
}
.scroll-arrow-right {
  right: -8px;
}
.scroll-arrow[hidden] {
  display: none;
}
@media (max-width: 700px) {
  .scroll-arrow {
    display: none;
  }
}

/* --- Placeholder cover (no image_url, or the image failed to load - see
   onerror on <img class="book-cover"> in _book_card.html). Only used by
   the card component (the book detail page's own hero cover placeholder
   is .book-summary-placeholder, a separate rule in card-refresh.css). --- */
.unified-book-card .book-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 14px;
  border-radius: 12px;
  color: #8d765e;
  font-size: 0.78rem;
  text-align: center;
}
.placeholder-icon {
  width: 34%;
  max-width: 46px;
  height: auto;
  opacity: 0.5;
}
.unified-book-card .book-cover-placeholder small {
  font-weight: 700;
  line-height: 1.3;
}
/* Author-stylesheet `display` rules always beat the browser's own
   [hidden]{display:none} (origin outranks specificity) - the onerror
   fallback only actually hides this once we say so explicitly, or a
   successfully-loaded cover and the placeholder both render at once. */
.unified-book-card .book-cover-placeholder[hidden] {
  display: none !important;
}

/* --- Compact variant (related/similar books on the book detail page,
   e.g. "Інші книжки автора" / "Схожі книги") - same markup/macro as the
   full card, every dimension shrinks together (cover, text, price)
   instead of only cropping the cover. --- */
.compact-book-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) {
  .compact-book-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .compact-book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .compact-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The "related/similar books" rows now use the exact same card design as
   the main grid/scroll-row (see the top of this file) - previously a
   separate, denser .compact-book-card override, folded away 2026-07-22
   once the main design adopted its proportions instead. Only the
   content-visibility opt-out still needs to be card-specific. */
.compact-book-card.unified-book-card {
  /* Long catalog grids use content-visibility:auto as a rendering-
     virtualization hint (see .unified-book-card above is NOT given this -
     it turned out to interfere with how far a grid track can shrink the
     card on narrow viewports, confirmed live: full-size card despite every
     layout property being correct, on mobile specifically). These compact
     rows only ever hold ~10 items - no virtualization benefit worth that
     risk, so it's opted out explicitly rather than left ambiguous. */
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

/* Same opt-out for horizontally-scrolling home page collection rows
   (see style.css's .book-card{content-visibility:auto}). content-visibility
   skips layout for cards not yet scrolled into view and substitutes the
   contain-intrinsic-size placeholder box, which doesn't match this card's
   real (redesigned, smaller) size - so off-screen cards report a taller
   height than they actually render at until the user scrolls past them.
   Since a flex row's own height is driven by its tallest child, on- or
   off-screen, that wrong placeholder height was inflating the whole row -
   showing up as a big empty gap before the next home page section. These
   rows cap out around 30 items, so there's no real virtualization win
   worth that bug. */
.book-row-scroll .book-card {
  content-visibility: visible;
  contain-intrinsic-size: auto;
}

/* --- Loading skeleton: shown in place of #search-results while an AJAX
   search/filter/sort/page fetch is in flight (see storefront.js's
   loadResults) - a shimmering placeholder shaped like the real card so the
   grid doesn't visibly collapse/flash blank while the request is running.
   Built fresh against the current card proportions (12px padding, 3/4
   cover) rather than reusing style.css's older, now-unused .skeleton-card
   (which was sized for a since-replaced card design and never wired up to
   anything). */
.book-card-skeleton {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 12px 12px 14px;
  border: 1px solid var(--line, #e3d9c9);
  border-radius: 16px;
  background: var(--card, #fffaf3);
  box-shadow: 0 8px 22px rgba(52, 36, 21, 0.06);
  box-sizing: border-box;
  pointer-events: none;
}
.skeleton-shimmer {
  display: block;
  background: linear-gradient(100deg, #eee5da 20%, #faf5ee 38%, #eee5da 56%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.25s ease-in-out infinite;
}
.book-card-skeleton .skeleton-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 13px;
}
.book-card-skeleton .skeleton-line {
  height: 12px;
  margin-top: 10px;
  border-radius: 6px;
}
.book-card-skeleton .skeleton-line.title {
  width: 90%;
  height: 15px;
}
.book-card-skeleton .skeleton-line.author {
  width: 55%;
}
.book-card-skeleton .skeleton-line.price {
  width: 40%;
  height: 20px;
  margin-top: 14px;
}
@keyframes skeleton-shimmer {
  to {
    background-position-x: -220%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-shimmer {
    animation: none;
  }
}

/* --- Header search vs. nav-icons on narrow phones ---
   .nav-links (shop/cart/wishlist/notifications/admin-gear/profile - up to
   6 icons for a logged-in admin) is flex:0 0 auto, never shrinks; .brand
   collapses its text at 920px but the mark stays. That leaves .site-search
   as the only flexible child, so at ~375px width with a full icon set it
   was measured shrinking to a 24px-wide unusable sliver (confirmed live via
   CDP on /me/cart). Two-row layout below a breakpoint fits everything
   without crushing anything: brand+icons stay on row one (they fit
   comfortably on their own), search wraps to its own full-width row two.
   Matches ui-polish.css's ".nav .site-search input" selector specificity
   so this reliably wins regardless of source order. */
@media (max-width: 480px) {
  .nav {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .nav .site-search {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* --- Login/register slide-over (base.html's [data-auth-panel],
   storefront.js's openAuthPanel/loadAuthPanel) --- */
.auth-panel[hidden] {
  display: none;
}
.auth-panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(37, 28, 21, 0.35);
  backdrop-filter: blur(3px);
  animation: auth-fade-in 0.18s ease;
}
.auth-panel-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 201;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  padding: 28px 26px;
  background: var(--card, #fffaf3);
  box-shadow: -18px 0 50px rgba(40, 25, 15, 0.22);
  overflow-y: auto;
  animation: auth-slide-in 0.22s ease;
}
@keyframes auth-fade-in {
  from { opacity: 0; }
}
@keyframes auth-slide-in {
  from { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-panel-backdrop,
  .auth-panel-drawer {
    animation: none;
  }
}
.auth-panel-close {
  align-self: flex-end;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted, #8a7d70);
  font-size: 1.4rem;
  cursor: pointer;
}
.auth-panel-close:hover {
  background: #f3ede4;
}
.auth-panel-body {
  margin-top: 4px;
}
.auth-panel-body h2 {
  margin: 0 0 20px;
  font: 700 1.6rem Literata, Georgia, serif;
}
.auth-panel-body form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-panel-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted, #8a7d70);
  font-size: 0.85rem;
  font-weight: 650;
}
.auth-panel-body input:not([type="checkbox"]) {
  padding: 12px 14px;
  border: 1px solid var(--line, #e3d9c9);
  border-radius: 11px;
  background: #fff;
  font: inherit;
}
.auth-panel-body input:focus-visible {
  outline: 2px solid var(--accent, #a74434);
  outline-offset: 1px;
}
.auth-panel-check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}
.auth-panel-check input {
  width: auto;
}
.auth-panel-body button[type="submit"] {
  margin-top: 4px;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--red, #a74434);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}
.auth-panel-body button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: default;
}
.auth-panel-switch {
  margin-top: 18px;
  color: var(--muted, #8a7d70);
  font-size: 0.85rem;
}
.auth-panel-switch a {
  color: var(--accent, #a74434);
  font-weight: 700;
}
.reader-rating {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #e3d9c9);
  color: var(--muted, #8a7d70);
  font-size: .82rem;
}
.reader-rating strong { color: var(--ink, #302720); }
.reader-rating form { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.star-rating-label { min-width: 116px; font-size: .76rem; text-align: right; }
.star-rating-stars { display: inline-flex; gap: 1px; }
.star-rating-star { width: 28px; padding: 0; border: 0; background: linear-gradient(90deg, var(--star-fill, #d29b28) var(--star-fill-width, 0%), #e9dfd1 var(--star-fill-width, 0%)); background-clip: text; -webkit-background-clip: text; color: transparent; font-size: 1.65rem; line-height: 1; cursor: pointer; }
.star-rating-star:focus-visible { outline: 2px solid var(--accent, #a74434); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 480px) {
  .auth-panel-drawer {
    width: 100vw;
    padding: 20px 18px;
  }
  .reader-rating { align-items: flex-start; }
  .reader-rating form { width: 100%; margin-left: 0; }
  .reader-rating form { width: 100%; margin-left: 0; justify-content: space-between; }
  .star-rating-label { text-align: left; }
  .book-summary { grid-template-columns: 1fr !important; gap: 18px; padding: 18px; }
  .book-summary-cover-wrap { width: min(180px, 55vw); margin: 0 auto; }
  .book-summary-copy h1 { font-size: clamp(1.55rem, 7vw, 2.1rem); line-height: 1.08; }
}
