.ebook-library { min-width: 0; scroll-margin-top: 140px; }
.ebook-library-intro { margin-bottom: 28px; }
.ebook-library-intro h2 { margin: 0 0 10px; color: #1a1a1a; font-size: clamp(30px, 3.4vw, 42px); font-weight: 600; line-height: 1.15; }
.ebook-library-intro p { max-width: 640px; margin: 0; color: #71675d; font-size: 14px; line-height: 1.7; }
.ebook-category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ebook-category-card { display: flex; flex-direction: column; min-width: 0; min-height: 224px; padding: 26px; border: 1px solid #dfd4c6; border-radius: 16px; background: #fffdfa; color: #7a1f1f; text-decoration: none; transition: border-color .18s, background .18s, transform .18s; }
.ebook-category-card:hover { transform: translateY(-3px); border-color: #b38a55; background: #f9f0e3; }
.ebook-category-card:focus-visible { outline: 3px solid #c89b5c; outline-offset: 4px; }
.ebook-category-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ebook-category-top svg { width: 36px; height: 36px; color: #b78c50; }
.ebook-category-index { color: #ab9b8a; font-size: 11px; font-weight: 500; letter-spacing: .18em; }
.ebook-category-card h3 { flex: 1; margin: 24px 0 22px; font-size: clamp(23px, 2.1vw, 30px); font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.ebook-category-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding-top: 16px; border-top: 1px solid #e8dfd4; color: #8a7c6d; font-size: 11px; line-height: 1.5; }
.ebook-category-open { color: #7a1f1f; font-weight: 600; }
.ebook-selection-header { margin-bottom: 28px; }
.ebook-library-back { display: inline-flex; align-items: center; min-height: 44px; margin: -8px 0 16px; padding: 6px 0; color: #7a1f1f; font-size: 13px; font-weight: 600; text-decoration: none; }
.ebook-library-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.ebook-selection-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ebook-selection-title h2 { min-width: 0; margin: 0; color: #1a1a1a; font-size: clamp(32px, 4vw, 48px); font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; scroll-margin-top: 140px; }
.ebook-selection-count { flex-shrink: 0; margin-top: 9px; padding: 6px 10px; border: 1px solid #dfd4c6; border-radius: 30px; color: #786959; font-size: 11px; white-space: nowrap; }
.ebook-selection-note { margin: 12px 0 0; color: #71675d; font-size: 13px; line-height: 1.7; }
.ebook-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 24px; }
.ebook-library-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #e3d8ca; border-radius: 16px; background: #fffdfa; scroll-margin-top: 140px; }
.ebook-library-cover { position: relative; flex-shrink: 0; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 1px solid #e8dfd4; background: #e9dfd2; }
.ebook-library-stage { width: 100%; height: 100%; }
.ebook-library-stage > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ebook-library-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; width: 100%; height: 100%; padding: 24px; background: linear-gradient(145deg, #f1e7d9, #e3d1bb); color: #7a1f1f; text-align: center; }
.ebook-library-placeholder svg { flex-shrink: 0; width: 44px; height: 44px; color: #aa814a; }
.ebook-library-placeholder span { display: -webkit-box; max-width: 18ch; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-size: 24px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.ebook-library-copy { display: flex; flex: 1; flex-direction: column; align-items: flex-start; min-width: 0; padding: 23px; }
.ebook-library-module { margin: 0 0 9px; color: #a17a49; font-size: 10px; font-weight: 600; line-height: 1.5; letter-spacing: .14em; text-transform: uppercase; overflow-wrap: anywhere; }
.ebook-library-title { margin: 0; color: #1a1a1a; font-size: 25px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.ebook-library-summary { display: -webkit-box; width: 100%; margin: 12px 0 0; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; color: #71675d; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.ebook-library-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 14px; margin: 18px 0 0; color: #91816f; font-size: 11px; line-height: 1.5; }
.ebook-library-price { color: #7a1f1f; font-size: 14px; font-weight: 600; }
.ebook-library-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 9px; width: 100%; margin-top: auto; padding-top: 22px; }
.ebook-library-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 44px; padding: 10px 13px; border: 1px solid #d8c6b4; border-radius: 8px; background: #fffdfa; color: #7a1f1f; font-size: 12px; font-weight: 600; line-height: 1.4; text-align: center; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; touch-action: manipulation; }
.ebook-library-button:hover { border-color: #7a1f1f; background: #faf4ed; }
.ebook-library-canva { border-color: #7a1f1f; background: #7a1f1f; color: #fff; }
.ebook-library-canva:hover { background: #5f1717; color: #fff; }
.ebook-library-canva > span:last-child { flex-shrink: 0; font-size: 17px; line-height: 1; }
.ebook-library-empty { grid-column: 1 / -1; margin: 0; padding: 32px; border: 1px dashed #d8c6b4; border-radius: 14px; background: #fffdfa; color: #71675d; font-size: 14px; line-height: 1.7; }
.ebook-details { width: min(720px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 0; overflow: hidden; border: 1px solid #e8dfd0; border-radius: 16px; background: #fffdfa; color: #1a1a1a; }
.ebook-details[open] { display: flex; flex-direction: column; }
.ebook-details::backdrop { background: #17100ee0; backdrop-filter: blur(4px); }
.ebook-details-header { display: flex; flex-shrink: 0; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px; border-bottom: 1px solid #e8dfd0; }
.ebook-details-header h2 { min-width: 0; margin: 0; padding-top: 6px; font-size: 27px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.ebook-details-close { display: grid; flex-shrink: 0; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #dfd4c8; border-radius: 50%; background: #fff; color: #7a1f1f; font: 28px/1 sans-serif; touch-action: manipulation; }
.ebook-details-close:hover { background: #7a1f1f; color: #fff; }
.ebook-details-body { min-height: 0; padding: 24px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ebook-details-body:focus-visible { outline-offset: -5px; }
.ebook-details-description { margin: 0; color: #554e47; font-size: 15px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (min-width: 640px) and (max-width: 1023px) {
  .ebook-category-grid, .ebook-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  [data-sid="277tghw"] [data-sid="c8q7lls"] { font-size: clamp(2rem, 8vw, 3rem) !important; overflow-wrap: anywhere; }
  .ebook-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ebook-category-card { min-height: 204px; padding: 18px 15px; border-radius: 12px; }
  .ebook-category-top svg { width: 29px; height: 29px; }
  .ebook-category-index { font-size: 9px; }
  .ebook-category-card h3 { margin: 22px 0 18px; font-size: clamp(21px, 5.8vw, 25px); }
  .ebook-category-footer { align-items: flex-start; flex-direction: column; gap: 7px; padding-top: 12px; font-size: 10px; }
  .ebook-library-intro { margin-bottom: 24px; }
  .ebook-library-intro p { font-size: 13px; }
  .ebook-library-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .ebook-library-copy { padding: 21px; }
  .ebook-selection-title { flex-wrap: wrap; gap: 8px 12px; }
  .ebook-selection-title h2 { font-size: 32px; }
  .ebook-selection-count { margin-top: 3px; }
  .ebook-library-empty { padding: 24px; }
  .ebook-details-header { gap: 14px; padding: 20px 18px; }
  .ebook-details-header h2 { font-size: 24px; }
  .ebook-details-body { padding: 20px 18px; }
}
@media (max-width: 359px) {
  .ebook-category-grid { grid-template-columns: minmax(0, 1fr); }
  .ebook-category-card { min-height: 190px; padding: 22px; }
  .ebook-category-card h3 { margin: 18px 0; font-size: 26px; }
  .ebook-category-footer { flex-direction: row; }
}
@media (prefers-reduced-motion: reduce) {
  .ebook-category-card { transition: none; }
  .ebook-category-card:hover { transform: none; }
}
