  #hb-catalogue.hbc {
    --hb-bg: #fbfaf7;
    --hb-card: #ffffff;
    --hb-soft: #eef5ff;
    --hb-ink: #12335b;
    --hb-muted: #60728a;
    --hb-line: #dce7f2;
    --hb-line-strong: #b7cbe2;
    --hb-accent: #155fc3;
    --hb-accent-2: #ec5a2c;
    --hb-gold: #a76134;
    --hb-danger: #155fc3;
    --hb-radius: 20px;
    --hb-shadow: 0 18px 48px rgba(18,51,91,.10);
    --page-gutter: clamp(16px, 3.6vw, 72px);

    position: relative;
    display: block;
    width: 100vw;
    max-width: none;
    min-height: calc(100vh - 96px);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    margin-bottom: 0;
    padding: 0 var(--page-gutter) 34px;
    overflow-x: clip;
    background:
      radial-gradient(circle at 14% 12%, rgba(21,95,195,.10), transparent 30%),
      radial-gradient(circle at 86% 48%, rgba(236,90,44,.08), transparent 26%),
      linear-gradient(180deg, #fff, var(--hb-bg) 55%, #fff);
    color: var(--hb-ink);
    font-family: "Sora", "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    box-sizing: border-box;
  }

  #hb-catalogue *,
  #hb-catalogue *::before,
  #hb-catalogue *::after { box-sizing: border-box; letter-spacing: 0; }
  #hb-catalogue svg { width: 16px; height: 16px; display: block; }
  #hb-catalogue h1,
  #hb-catalogue h2,
  #hb-catalogue h3,
  #hb-catalogue p { margin-top: 0; }

  #hb-catalogue .hbc-hero,
  #hb-catalogue .hbc-controls,
  #hb-catalogue .hbc-card-like {
    border: 1px solid var(--hb-line);
    border-radius: var(--hb-radius);
    background: var(--hb-card);
    box-shadow: 0 10px 28px rgba(18,51,91,.06);
  }

  #hb-catalogue .hbc-hero {
    display: grid;
    grid-template-columns: minmax(520px, 1.15fr) minmax(400px, .85fr);
    gap: 0;
    align-items: stretch;
    min-height: 360px;
    margin-bottom: 18px;
    overflow: hidden;
    background: #fff;
  }

  #hb-catalogue .hbc-kicker {
    display: block;
    margin: 0 0 6px;
    color: var(--hb-accent);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
  }

  #hb-catalogue .hbc-hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: center;
    padding: clamp(28px, 3vw, 40px);
  }

  #hb-catalogue h1 {
    max-width: 760px;
    margin-bottom: 18px;
    color: var(--hb-ink);
    font-size: clamp(40px, 3.6vw, 54px);
    line-height: 1.02;
    font-weight: 950;
  }

  #hb-catalogue h1 span { color: var(--hb-accent); }

  #hb-catalogue .hbc-sub {
    max-width: 560px;
    margin-bottom: 24px;
    color: var(--hb-muted);
    font-family: "DM Sans", sans-serif;
    font-size: 17px;
    line-height: 1.55;
  }

  #hb-catalogue .hbc-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-start;
    align-items: center;
  }

  #hb-catalogue .hbc-hero-media {
    position: relative;
    min-height: 320px;
    overflow: hidden;
  }

  #hb-catalogue .hbc-hero-media::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 1;
    width: 34%;
    background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,.82) 38%, rgba(255,255,255,0) 100%);
  }

  #hb-catalogue .hbc-hero-media img {
    width: 100%;
    height: 100%;
    min-height: 340px;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  #hb-catalogue .hbc-controls {
    padding: 18px;
    margin-bottom: 22px;
  }

  #hb-catalogue .hbc-control-main {
    display: grid;
    grid-template-columns: minmax(280px, 1.3fr) minmax(210px, .9fr) minmax(160px, .7fr) 170px;
    gap: 12px;
    align-items: center;
  }

  #hb-catalogue .hbc-search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
  }

  #hb-catalogue .hbc-search svg {
    position: absolute;
    left: 18px;
    color: var(--hb-muted);
    pointer-events: none;
  }

  #hb-catalogue .hbc-search input {
    padding-left: 50px;
  }

  #hb-catalogue .hbc-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, .7fr) minmax(260px, auto) auto;
    gap: 14px;
    margin-top: 14px;
    align-items: end;
  }

  #hb-catalogue label {
    display: grid;
    gap: 6px;
    color: var(--hb-muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  #hb-catalogue input[type="search"],
  #hb-catalogue input[type="text"],
  #hb-catalogue select {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--hb-line);
    border-radius: 12px;
    background: #fff;
    color: var(--hb-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    outline: 0;
    padding: 12px 15px;
    transition: border-color .16s ease, box-shadow .16s ease;
  }

  #hb-catalogue input:focus,
  #hb-catalogue select:focus {
    border-color: var(--hb-accent);
    box-shadow: 0 0 0 4px rgba(75,53,255,.11);
  }

  #hb-catalogue .hbc-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--hb-line);
  }

  #hb-catalogue .hbc-chips,
  #hb-catalogue .hbc-toggles,
  #hb-catalogue .hbc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  #hb-catalogue .hbc-chip,
  #hb-catalogue .hbc-toggles label,
  #hb-catalogue .hbc-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid var(--hb-line);
    border-radius: 999px;
    background: var(--hb-soft);
    color: var(--hb-muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: none;
  }

  #hb-catalogue .hbc-chip b { color: var(--hb-ink); }
  #hb-catalogue .hbc-toggles input { accent-color: var(--hb-accent); }
  #hb-catalogue .hbc-toggles label { text-transform: none; }

  #hb-catalogue .hbc-tags {
    min-height: 28px;
    align-content: flex-start;
  }

  #hb-catalogue .hbc-tag {
    height: 28px;
    max-width: 170px;
    overflow: hidden;
    border-color: #d6e5f6;
    color: #2a5e9f;
    font-size: 11px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #hb-catalogue .hbc-section-head,
  #hb-catalogue .hbc-results-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 12px;
  }

  #hb-catalogue .hbc-section-head h2,
  #hb-catalogue .hbc-results-head h2,
  #hb-catalogue .hbc-how h2,
  #hb-catalogue .hbc-cta h2 {
    margin: 0;
    color: var(--hb-ink);
    font-size: clamp(22px, 2.4vw, 34px);
    line-height: 1.1;
    font-weight: 950;
  }

  #hb-catalogue .hbc-suggestions {
    margin: 28px 0 22px;
  }

  #hb-catalogue .hbc-suggestion-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }

  #hb-catalogue .hbc-suggestion {
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 210px;
    padding: 16px;
    border: 1px solid var(--hb-line);
    border-radius: var(--hb-radius);
    background: #fff;
    box-shadow: 0 10px 28px rgba(18,51,91,.06);
  }

  #hb-catalogue .hbc-suggestion h3 {
    margin: 0 0 8px;
    color: var(--hb-ink);
    font-size: 18px;
    line-height: 1.15;
    font-weight: 950;
  }

  #hb-catalogue .hbc-suggestion p {
    margin: 0 0 10px;
    color: var(--hb-muted);
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    line-height: 1.45;
  }

  #hb-catalogue .hbc-suggestion span {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--hb-soft);
    color: var(--hb-accent);
    font-size: 12px;
    font-weight: 900;
  }

  #hb-catalogue .hbc-suggestion-cover {
    width: 124px;
    height: 170px;
    display: grid;
    place-items: center;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--hb-line);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 10px 20px rgba(18,51,91,.10);
    overflow: hidden;
  }

  #hb-catalogue .hbc-suggestion-cover span {
    margin: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-align: center;
    font-size: 18px;
    line-height: 1.08;
    font-weight: 950;
    text-transform: uppercase;
  }

  #hb-catalogue .hbc-suggestion-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
  }

  #hb-catalogue .hbc-book-cover-wrap > .hbc-language-badge,
  #hb-catalogue .hbc-suggestion-cover > .hbc-language-badge,
  .hbc-modal .hbc-book-cover-wrap > .hbc-language-badge,
  .hbc-detail-cover-wrap > .hbc-language-badge {
    position: absolute;
    right: auto;
    bottom: 10px;
    left: 10px;
    z-index: 3;
    display: inline-flex;
    max-width: calc(100% - 20px);
    min-height: 28px;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 999px;
    background: rgba(18,51,91,.92);
    box-shadow: 0 6px 18px rgba(18,51,91,.22);
    color: #fff;
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
  }

  #hb-catalogue .hbc-language-badge b,
  .hbc-modal .hbc-language-badge b {
    font-size: 10px;
    letter-spacing: .05em;
  }

  #hb-catalogue .hbc-suggestion-cover > .hbc-language-badge > span {
    display: inline;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
  }

  #hb-catalogue .hbc-language-badge [lang="ar"],
  .hbc-modal .hbc-language-badge [lang="ar"] {
    font-family: "Noto Sans Arabic", Tahoma, sans-serif;
    font-size: 11px;
  }

  #hb-catalogue .hbc-suggestion .hbc-suggestion-tag {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--hb-soft);
    color: var(--hb-accent);
    font-size: 12px;
    font-weight: 900;
  }

  #hb-catalogue .hbc-how {
    margin: 20px 0 24px;
    text-align: center;
  }

  #hb-catalogue .hbc-how-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
    margin-top: 12px;
    padding: 18px;
    border: 1px solid var(--hb-line);
    border-radius: var(--hb-radius);
    background: rgba(238,245,255,.72);
  }

  #hb-catalogue .hbc-how-grid article {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 4px 14px;
    align-items: center;
    text-align: left;
  }

  #hb-catalogue .hbc-how-icon {
    width: 64px;
    height: 64px;
    display: grid;
    grid-row: 1 / span 2;
    place-items: center;
    border-radius: 999px;
    background: #e7f0ff;
    color: var(--hb-accent);
    font-size: 30px;
  }

  #hb-catalogue .hbc-how-grid strong {
    display: block;
    grid-column: 2;
    color: var(--hb-ink);
    font-size: 16px;
    font-weight: 950;
  }

  #hb-catalogue .hbc-how-grid p {
    grid-column: 2;
    margin: 4px 0 0;
    color: var(--hb-muted);
    font-family: "DM Sans", sans-serif;
    line-height: 1.45;
  }

  #hb-catalogue .hbc-results-head {
    margin-top: 22px;
  }

  #hb-catalogue .hbc-cta {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-top: 26px;
    padding: 18px 28px;
    border: 1px solid var(--hb-line);
    border-radius: var(--hb-radius);
    background:
      radial-gradient(circle at 3% 50%, rgba(21,95,195,.24), transparent 18%),
      linear-gradient(90deg, #eef5ff, #fffaf7);
  }

  #hb-catalogue .hbc-cta img {
    width: 220px;
    max-width: 100%;
    display: block;
  }

  #hb-catalogue .hbc-btn,
  .hbc-modal .hbc-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 50px;
    padding: 12px 22px;
    border: 1px solid #155fc3;
    border-radius: 12px;
    background: #fff;
    color: #155fc3;
    font: inherit;
    font-size: 15px;
    font-weight: 950;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
  }

  #hb-catalogue .hbc-btn:hover:not(:disabled),
  .hbc-modal .hbc-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: #155fc3;
    background: #eef5ff;
    color: #155fc3;
    box-shadow: 0 8px 18px rgba(21,95,195,.12);
  }

  #hb-catalogue .hbc-btn:disabled,
  .hbc-modal .hbc-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
  #hb-catalogue .hbc-btn:focus-visible,
  .hbc-modal .hbc-btn:focus-visible,
  #hb-catalogue .hbc-fav-btn:focus-visible,
  .hbc-modal-close:focus-visible { outline: 3px solid rgba(21,95,195,.24); outline-offset: 2px; }
  #hb-catalogue .hbc-btn-primary,
  .hbc-modal .hbc-btn-primary { border: 0; background: #ec5a2c; color: #fff; box-shadow: 0 12px 26px rgba(236,90,44,.24); }
  #hb-catalogue .hbc-btn-primary:hover:not(:disabled),
  .hbc-modal .hbc-btn-primary:hover:not(:disabled) { border-color: transparent; background: #d84f27; color: #fff; }
  #hb-catalogue .hbc-btn-secondary,
  #hb-catalogue .hbc-btn-danger,
  .hbc-modal .hbc-btn-secondary,
  .hbc-modal .hbc-btn-danger { border-color: #155fc3; background: #fff; color: #155fc3; box-shadow: none; }

  #hb-catalogue .hbc-loading {
    height: 3px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: transparent;
  }

  #hb-catalogue .hbc-loading.active { background: var(--hb-line); }
  #hb-catalogue .hbc-loading i {
    display: block;
    width: 35%;
    height: 100%;
    border-radius: 999px;
    background: var(--hb-accent);
    transform: translateX(-120%);
    opacity: 0;
  }

  #hb-catalogue .hbc-loading.active i {
    opacity: 1;
    animation: hbcLoad 1s ease-in-out infinite;
  }

  @keyframes hbcLoad {
    from { transform: translateX(-120%); }
    to { transform: translateX(380%); }
  }

  #hb-catalogue .hbc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
  }

  #hb-catalogue .hbc-grid-mini { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  #hb-catalogue .hbc-book {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    height: 100%;
    min-height: 470px;
    padding: 12px;
    border: 1px solid var(--hb-line);
    border-radius: var(--hb-radius);
    background: #fff;
    cursor: default;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  }

  #hb-catalogue .hbc-book:hover {
    transform: translateY(-2px);
    border-color: var(--hb-line-strong);
    box-shadow: 0 16px 34px rgba(18,51,91,.12);
  }

  #hb-catalogue .hbc-cover {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    border-radius: inherit;
    background: var(--hb-soft);
    object-fit: contain;
  }

  /* The shared experience layer is loaded later and still targets this legacy
     surface with object-fit: cover !important. Keep the compatibility card
     specific enough to preserve complete book jackets. */
  #hb-catalogue.hbc .hbc-book-cover-wrap > .hbc-cover {
    object-fit: contain !important;
  }

  #hb-catalogue .hbc-book-cover-wrap {
    position: relative;
    width: min(100%, 150px);
    aspect-ratio: 3 / 4;
    display: grid;
    align-self: center;
    place-items: center;
    overflow: hidden;
    padding: 8px;
    border-radius: 14px;
    background: var(--hb-soft);
    box-shadow: 0 12px 24px rgba(18,51,91,.12);
    isolation: isolate;
  }

  #hb-catalogue .hbc-book-body {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 12px 4px 2px;
  }

  #hb-catalogue .hbc-book-head { min-height: 28px; }
  #hb-catalogue .hbc-badges { display: flex; gap: 6px; flex-wrap: wrap; }
  #hb-catalogue .hbc-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid var(--hb-line);
    border-radius: 999px;
    background: #f1f6fc;
    color: var(--hb-accent);
    font-size: 11px;
    font-weight: 900;
  }

  #hb-catalogue .hbc-badge-rating { color: var(--hb-gold); background: #fff8e9; border-color: #ead6a6; }
  #hb-catalogue .hbc-book h3 {
    overflow: hidden;
    min-height: 46px;
    margin: 0;
    color: var(--hb-ink);
    font-size: 19px;
    line-height: 1.28;
    font-weight: 950;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #hb-catalogue .hbc-author,
  #hb-catalogue .hbc-desc {
    overflow: hidden;
    margin: 0;
    color: var(--hb-muted);
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #hb-catalogue .hbc-author { min-height: 21px; }

  #hb-catalogue .hbc-desc {
    display: -webkit-box;
    min-height: 44px;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  #hb-catalogue .hbc-book-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: center; margin-top: auto; padding-top: 4px; }
  #hb-catalogue .hbc-book-actions .hbc-btn { width: 100%; min-height: 42px; padding: 8px 10px; font-size: 12px; }

  #hb-catalogue .hbc-fav-btn {
    appearance: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--hb-accent);
    border-radius: 999px;
    background: #fff;
    color: var(--hb-accent);
    font-size: 18px;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, transform .16s ease;
  }

  #hb-catalogue .hbc-fav-btn.active {
    border-color: transparent;
    background: var(--hb-accent-2);
    color: #fff;
  }

  #hb-catalogue .hbc-fav-btn:hover { transform: translateY(-1px); background: var(--hb-soft); }
  #hb-catalogue .hbc-fav-btn.active:hover { background: #d84f27; }

  .hbc-detail .hbc-fav-btn {
    appearance: none;
    position: static;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid #155fc3;
    border-radius: 999px;
    background: #fff;
    color: #155fc3;
    font-size: 18px;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, transform .16s ease;
  }

  .hbc-detail .hbc-fav-btn.active { border-color: transparent; background: #ec5a2c; color: #fff; }
  .hbc-detail .hbc-fav-btn:hover { transform: translateY(-1px); background: #eef5ff; }
  .hbc-detail .hbc-fav-btn.active:hover { background: #d84f27; }

  #hb-catalogue .hbc-empty,
  #hb-catalogue .hbc-skeleton {
    min-height: 128px;
    border: 1px dashed var(--hb-line-strong);
    border-radius: var(--hb-radius);
    background: #fff;
    color: var(--hb-muted);
    padding: 18px;
  }

  #hb-catalogue .hbc-empty {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    text-align: center;
  }

  #hb-catalogue .hbc-skeleton {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #hb-catalogue .hbc-skeleton-cover { height: 200px; }
  #hb-catalogue .hbc-skeleton-body { display: grid; gap: 10px; align-content: start; }

  #hb-catalogue .hbc-shimmer {
    border-radius: var(--hb-radius);
    background: linear-gradient(90deg, var(--hb-soft), var(--hb-line), var(--hb-soft));
    background-size: 250% 100%;
    animation: hbcShimmer 1.4s linear infinite;
  }

  @keyframes hbcShimmer {
    from { background-position: 250% 0; }
    to { background-position: -50% 0; }
  }

  #hb-catalogue .hbc-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
  }

  #hb-catalogue .hbc-pager span {
    min-width: 130px;
    text-align: center;
    color: var(--hb-muted);
    font-weight: 800;
  }

  #hb-catalogue .hbc-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100001;
    max-width: min(360px, calc(100vw - 40px));
    border-radius: var(--hb-radius);
    background: var(--hb-ink);
    color: #fff;
    padding: 12px 14px;
    font-weight: 750;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }

  #hb-catalogue .hbc-toast.on { opacity: 1; transform: translateY(0); }

  .hbc-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    padding: 18px;
    overflow: auto;
    color: #12335b;
    font-family: "Sora", "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  .hbc-modal.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }

  .hbc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16,32,51,.46);
  }

  .hbc-modal-card {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    border: 1px solid #dce7f2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(18,51,91,.24);
  }

  .hbc-modal-wide { width: min(1180px, 100%); }
  .hbc-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 1px solid #155fc3;
    border-radius: 999px;
    background: #fff;
    color: #155fc3;
    font-size: 20px;
    cursor: pointer;
  }

  .hbc-modal-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 58px 18px 18px;
    border-bottom: 1px solid #dce7f2;
    background: #f4f8fe;
  }

  .hbc-modal-head { align-items: center; }
  .hbc-modal .hbc-kicker { margin: 0 0 6px; color: #155fc3; font-size: 11px; font-weight: 900; text-transform: uppercase; }
  .hbc-modal-head h2 { margin: 0; font-size: 24px; }
  .hbc-modal-head p { margin: 4px 0 0; color: #60728a; }
  .hbc-modal-head .hbc-btn { flex: 0 0 auto; min-width: 84px; min-height: 44px; height: 44px; padding: 10px 16px; }

  #hbc-favs-grid,
  #hbc-favs-grid * { box-sizing: border-box; }

  #hbc-favs-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    padding: 22px;
  }

  #hbc-favs-grid .hbc-book {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 438px;
    flex-direction: column;
    padding: 12px;
    border: 1px solid #dce7f2;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(18,51,91,.08);
  }

  #hbc-favs-grid .hbc-book-cover-wrap {
    position: relative;
    width: min(100%, 132px);
    aspect-ratio: 3 / 4;
    display: grid;
    align-self: center;
    place-items: center;
    overflow: hidden;
    padding: 8px;
    border-radius: 12px;
    background: #eef5ff;
    isolation: isolate;
  }

  #hbc-favs-grid .hbc-cover {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: inherit;
    object-fit: contain;
  }

  #hbc-favs-grid .hbc-book-body {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 12px 2px 0;
  }

  #hbc-favs-grid .hbc-book-head { min-height: 26px; }
  #hbc-favs-grid .hbc-badges { display: flex; flex-wrap: wrap; gap: 5px; }
  #hbc-favs-grid .hbc-badge {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 7px;
    border: 1px solid #dce7f2;
    border-radius: 999px;
    background: #f1f6fc;
    color: #155fc3;
    font-size: 10px;
    font-weight: 800;
  }

  #hbc-favs-grid .hbc-badge-rating { color: #a76134; background: #fff8e9; border-color: #ead6a6; }
  #hbc-favs-grid .hbc-book h3 {
    display: -webkit-box;
    min-height: 42px;
    overflow: hidden;
    margin: 0;
    color: #12335b;
    font-size: 16px;
    line-height: 1.28;
    font-weight: 900;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #hbc-favs-grid .hbc-author,
  #hbc-favs-grid .hbc-desc {
    overflow: hidden;
    margin: 0;
    color: #60728a;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #hbc-favs-grid .hbc-author { min-height: 19px; }
  #hbc-favs-grid .hbc-desc {
    display: -webkit-box;
    min-height: 40px;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #hbc-favs-grid .hbc-tags { display: flex; min-height: 26px; flex-wrap: wrap; gap: 5px; }
  #hbc-favs-grid .hbc-tag {
    display: inline-flex;
    height: 26px;
    max-width: 132px;
    align-items: center;
    overflow: hidden;
    padding: 4px 8px;
    border: 1px solid #d6e5f6 !important;
    border-radius: 999px;
    background: #eef5ff !important;
    color: #2a5e9f !important;
    font-size: 10px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #hbc-favs-grid .hbc-book-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: auto; padding-top: 4px; }
  #hbc-favs-grid .hbc-book-actions .hbc-btn { width: 100%; min-height: 40px; padding: 8px 8px; font-size: 11px; }
  #hbc-favs-grid .hbc-fav-btn {
    appearance: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #155fc3;
    border-radius: 999px;
    background: #fff;
    color: #155fc3;
    font-size: 15px;
    cursor: pointer;
  }

  #hbc-favs-grid .hbc-fav-btn.active { border-color: transparent; background: #ec5a2c; color: #fff; }
  #hbc-favs-grid .hbc-empty { grid-column: 1 / -1; min-height: 150px; display: grid; place-items: center; padding: 22px; border: 1px dashed #b7cbe2; border-radius: 18px; color: #60728a; text-align: center; }

  .hbc-detail {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
  }

  .hbc-detail-cover-wrap {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 2 / 3;
    display: grid;
    align-self: start;
    justify-self: center;
    place-items: center;
    overflow: hidden;
    padding: 12px;
    border: 1px solid #dce7f2;
    border-radius: 12px;
    background: #f4f8fe;
    isolation: isolate;
  }

  .hbc-modal .hbc-detail-cover {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    object-fit: contain;
  }

  .hbc-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding-right: 58px;
  }

  .hbc-detail h2 {
    margin: 0;
    color: #12335b;
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.08;
  }

  .hbc-detail-author,
  .hbc-detail-meta,
  .hbc-detail-desc {
    color: #60728a;
    font-family: "DM Sans", sans-serif;
  }

  .hbc-detail-desc {
    margin-top: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
  }

  .hbc-detail-actions,
  .hbc-detail-section {
    margin-top: 16px;
  }

  .hbc-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hbc-detail-section h3 {
    margin: 0 0 8px;
    color: #60728a;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .hbc-detail .hbc-tags { display: flex; flex-wrap: wrap; gap: 8px; }
  .hbc-detail .hbc-tag {
    display: inline-flex;
    height: 30px;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid #d6e5f6 !important;
    border-radius: 999px;
    background: #eef5ff !important;
    color: #2a5e9f !important;
    font-size: 12px;
    line-height: 1;
  }

  @media (max-width: 980px) {
    #hb-catalogue .hbc-hero,
    #hb-catalogue .hbc-control-main,
    #hb-catalogue .hbc-filters,
    #hb-catalogue .hbc-suggestion-grid,
    #hb-catalogue .hbc-how-grid,
    #hb-catalogue .hbc-cta,
    .hbc-detail {
      grid-template-columns: 1fr;
    }
    #hb-catalogue .hbc-hero-actions { justify-content: flex-start; }
    #hb-catalogue .hbc-hero-media { order: -1; min-height: 260px; }
    #hb-catalogue .hbc-hero-media::before { display: none; }
    #hb-catalogue .hbc-grid,
    #hb-catalogue .hbc-grid-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #hb-catalogue .hbc-suggestion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #hbc-favs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #hb-catalogue .hbc-cta { text-align: center; justify-items: center; }
  }

  @media (max-width: 700px) {
    #hb-catalogue.hbc { padding: 0 12px 22px; }
    #hb-catalogue .hbc-hero { padding: 18px; }
    #hb-catalogue .hbc-hero-copy { padding: 0; }
    #hb-catalogue h1 { font-size: 36px; }
    #hb-catalogue .hbc-sub { font-size: 16px; }
    #hb-catalogue .hbc-meta-row { align-items: flex-start; flex-direction: column; }
    #hb-catalogue .hbc-grid { grid-template-columns: 1fr; }
    #hbc-favs-grid { grid-template-columns: 1fr; padding: 14px; }
    #hb-catalogue .hbc-suggestion-grid { grid-template-columns: 1fr; }
    #hb-catalogue .hbc-suggestion { grid-template-columns: 104px minmax(0, 1fr); }
    #hb-catalogue .hbc-suggestion-cover { width: 104px; height: 150px; }
    #hb-catalogue .hbc-how-grid article { grid-template-columns: 1fr; text-align: center; justify-items: center; }
    #hb-catalogue .hbc-how-icon,
    #hb-catalogue .hbc-how-grid strong,
    #hb-catalogue .hbc-how-grid p { grid-column: auto; grid-row: auto; }
    #hb-catalogue .hbc-book { min-height: 0; padding: 10px; }
    #hb-catalogue .hbc-cover { width: 100%; height: 100%; }
    #hb-catalogue .hbc-book h3 { white-space: normal; }
    #hb-catalogue .hbc-grid-mini { grid-template-columns: 1fr; }
    .hbc-modal { padding: 10px; }
    .hbc-detail { padding: 16px; }
  }
