:root {
    --ebook-ink: #17202a;
    --ebook-muted: #667085;
    --ebook-line: #e3e9ec;
    --ebook-paper: #f6f8f8;
    --ebook-teal: #0f766e;
    --ebook-teal-dark: #095f59;
    --ebook-mint: #dcf7f2;
    --ebook-orange: #f97316;
}

.ebook-page { color: var(--ebook-ink); background: var(--ebook-paper); }
.ebook-main { min-height: 760px; padding-top: 79px; }
.ebook-page .portal-button { min-height: 44px; font-size: 14px; }
.ebook-page .portal-field label { font-size: 14px; }
.ebook-page .portal-input,.ebook-page .portal-select,.ebook-page .portal-textarea { font-size: 14px; }
.ebook-page .portal-textarea { line-height: 23px; }

.ebook-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 20px 0;
    color: #64748b;
    font-size: 13px;
}
.ebook-breadcrumb a:hover { color: var(--ebook-teal); }
.ebook-breadcrumb i { color: #b7c2ca; font-size: 11px; }

/* Catalogue */
.ebook-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(116deg,#075b59 0%,#0f766e 54%,#138a7f 100%);
}
.ebook-hero::before,.ebook-hero::after {
    position: absolute;
    border-radius: 50%;
    content: "";
    background: rgba(255,255,255,.06);
}
.ebook-hero::before { top: -190px; right: -80px; width: 460px; height: 460px; }
.ebook-hero::after { right: 270px; bottom: -220px; width: 370px; height: 370px; }
.ebook-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 410px;
    grid-template-columns: minmax(0,1fr) 360px;
    align-items: center;
    gap: 70px;
    padding-top: 56px;
    padding-bottom: 56px;
}
.ebook-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: #bff7eb;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
}
.ebook-hero h1 { max-width: 720px; margin: 0 0 16px; font-size: 42px; font-weight: 900; line-height: 1.15; letter-spacing: -1px; }
.ebook-hero-copy > p { max-width: 700px; margin: 0 0 25px; color: #d8f7f1; font-size: 16px; line-height: 26px; }
.ebook-search {
    display: flex;
    max-width: 680px;
    align-items: center;
    gap: 10px;
    padding: 7px 7px 7px 17px;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 15px 35px rgba(0,37,38,.2);
}
.ebook-search > i { color: #84919b; font-size: 18px; }
.ebook-search input { min-width: 0; flex: 1; height: 42px; border: 0; outline: 0; color: #1f2937; font-size: 14px; }
.ebook-search button { height: 42px; padding: 0 22px; border: 0; border-radius: 9px; color: #fff; background: var(--ebook-orange); font-size: 14px; font-weight: 800; }
.ebook-hero-art { position: relative; display: grid; min-height: 290px; place-items: center; }
.ebook-hero-book {
    position: relative;
    z-index: 2;
    width: 205px;
    aspect-ratio: 5/7;
    overflow: hidden;
    border: 6px solid rgba(255,255,255,.18);
    border-radius: 8px 15px 15px 8px;
    box-shadow: -14px 22px 42px rgba(0,33,35,.38);
    transform: rotate(4deg);
}
.ebook-hero-book img { width: 100%; height: 100%; object-fit: cover; }
.ebook-hero-book::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg,rgba(0,0,0,.27),transparent 18%,transparent 82%,rgba(255,255,255,.15)); }
.ebook-float-card { position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.36); border-radius: 12px; color: #17413f; background: rgba(255,255,255,.94); box-shadow: 0 12px 25px rgba(0,0,0,.17); font-size: 13px; font-weight: 800; }
.ebook-float-card i { color: var(--ebook-orange); font-size: 20px; }
.ebook-float-card.one { top: 36px; left: 0; }
.ebook-float-card.two { right: -10px; bottom: 34px; }

.ebook-stats { border-bottom: 1px solid #e5ecee; background: #fff; }
.ebook-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); }
.ebook-stat { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 22px; border-right: 1px solid #edf1f2; }
.ebook-stat:last-child { border-right: 0; }
.ebook-stat i { color: var(--ebook-teal); font-size: 25px; }
.ebook-stat strong { display: block; font-size: 19px; font-weight: 900; }
.ebook-stat span { display: block; margin-top: 2px; color: var(--ebook-muted); font-size: 13px; }

.ebook-section { padding: 58px 0; }
.ebook-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.ebook-section-heading h2 { margin: 0 0 7px; font-size: 28px; font-weight: 900; letter-spacing: -.4px; }
.ebook-section-heading p { margin: 0; color: var(--ebook-muted); font-size: 15px; line-height: 23px; }
.ebook-link { display: inline-flex; align-items: center; gap: 7px; color: var(--ebook-teal); font-size: 14px; font-weight: 800; }
.ebook-feature-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 22px; }
.ebook-card { position: relative; display: flex; min-width: 0; flex-direction: column; overflow: hidden; transition: transform .2s,box-shadow .2s; }
.ebook-card:hover { box-shadow: 0 16px 35px rgba(15,23,42,.1); transform: translateY(-4px); }
.ebook-cover { position: relative; display: block; height: 270px; overflow: hidden; background: #d8e7e5; }
.ebook-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.ebook-card:hover .ebook-cover img { transform: scale(1.035); }
.ebook-cover::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg,transparent 55%,rgba(5,24,31,.45)); }
.ebook-badge { position: absolute; z-index: 2; top: 12px; left: 12px; padding: 6px 9px; border-radius: 7px; color: #fff; background: var(--ebook-teal); font-size: 11px; font-weight: 800; }
.ebook-access { position: absolute; z-index: 2; right: 12px; bottom: 12px; padding: 5px 8px; border-radius: 6px; color: #fff; background: rgba(15,23,42,.82); font-size: 11px; font-weight: 750; }
.ebook-card-body { display: flex; flex: 1; flex-direction: column; padding: 18px; }
.ebook-category { margin-bottom: 7px; color: var(--ebook-teal); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.ebook-card h3 { display: -webkit-box; overflow: hidden; min-height: 48px; margin: 0 0 9px; font-size: 17px; font-weight: 850; line-height: 24px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ebook-card h3 a:hover { color: var(--ebook-teal); }
.ebook-author { margin: 0 0 15px; color: var(--ebook-muted); font-size: 14px; line-height: 21px; }
.ebook-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 13px; border-top: 1px solid #edf1f2; color: #667085; font-size: 13px; }
.ebook-card-foot span { display: inline-flex; align-items: center; gap: 5px; }
.ebook-card-foot strong { color: var(--ebook-orange); font-size: 14px; }

.ebook-catalogue {padding-top: 48px;background: #fff;}
.ebook-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.ebook-toolbar h2 { margin: 0; font-size: 25px; font-weight: 900; }
.ebook-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.ebook-view-button { display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid var(--ebook-line); border-radius: 9px; color: #64748b; background: #fff; }
.ebook-view-button.active { border-color: #a7d8d4; color: var(--ebook-teal); background: #effbf9; }
.ebook-catalogue-layout { display: grid; grid-template-columns: 245px minmax(0,1fr); align-items: start; gap: 30px; }
.ebook-filter { position: sticky; top: 98px; padding: 20px; }
.ebook-filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
.ebook-filter-head h3 { margin: 0; font-size: 17px; font-weight: 850; }
.ebook-filter-reset { border: 0; color: var(--ebook-teal); background: transparent; font-size: 12px; font-weight: 750; }
.ebook-filter-group { padding: 17px 0; border-top: 1px solid #edf1f2; }
.ebook-filter-group:first-of-type { padding-top: 0; border-top: 0; }
.ebook-filter-group strong { display: block; margin-bottom: 11px; font-size: 14px; font-weight: 800; }
.ebook-check { display: flex; align-items: center; gap: 9px; margin: 9px 0; color: #475467; font-size: 14px; cursor: pointer; }
.ebook-check input { width: 16px; height: 16px; accent-color: var(--ebook-teal); }
.ebook-results-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.ebook-results-head p { margin: 0; color: #667085; font-size: 14px; }
.ebook-results-head strong { color: #17202a; }
.ebook-sort { min-width: 180px; height: 43px; padding: 0 12px; border: 1px solid var(--ebook-line); border-radius: 9px; color: #475467; background: #fff; font-size: 14px; }
.ebook-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.ebook-grid.list-view { grid-template-columns: 1fr; }
.ebook-grid.list-view .ebook-card { display: grid; grid-template-columns: 145px minmax(0,1fr); }
.ebook-grid.list-view .ebook-cover { height: 195px; }
.ebook-empty { padding: 55px 20px; text-align: center; }
.ebook-empty i { color: #94a3b8; font-size: 40px; }
.ebook-empty h3 { margin: 12px 0 5px; font-size: 20px; font-weight: 850; }
.ebook-empty p { margin: 0; color: #64748b; font-size: 14px; }
.ebook-pagination { display: flex; justify-content: center; gap: 7px; margin-top: 30px; }
.ebook-pagination button { min-width: 40px; height: 40px; padding: 0 11px; border: 1px solid var(--ebook-line); border-radius: 8px; color: #475467; background: #fff; font-size: 14px; font-weight: 750; }
.ebook-pagination button.active { border-color: var(--ebook-teal); color: #fff; background: var(--ebook-teal); }

/* Detail */
.ebook-detail-hero { padding-bottom: 54px; color: #fff; background: linear-gradient(130deg,#0a5656,#0f766e); }
.ebook-detail-hero .ebook-breadcrumb,.ebook-detail-hero .ebook-breadcrumb a { color: rgba(255,255,255,.78); }
.ebook-detail-hero .ebook-breadcrumb i { color: rgba(255,255,255,.5); }
.ebook-detail-grid { display: grid; grid-template-columns: 280px minmax(0,1fr); align-items: center; gap: 45px; padding-top: 20px; }
.ebook-detail-cover { position: relative; overflow: hidden; aspect-ratio: 5/7; border: 6px solid rgba(255,255,255,.16); border-radius: 10px 18px 18px 10px; box-shadow: 0 25px 50px rgba(0,25,30,.36); }
.ebook-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.ebook-detail-copy .ebook-category { color: #bdf4e8; }
.ebook-detail-copy h1 { max-width: 850px; margin: 5px 0 13px; font-size: 38px; font-weight: 900; line-height: 1.2; letter-spacing: -.7px; }
.ebook-detail-copy > p { max-width: 850px; margin: 0 0 17px; color: #d8f7f1; font-size: 15px; line-height: 25px; }
.ebook-detail-author { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 21px; color: #e5faf7; font-size: 14px; }
.ebook-detail-author strong { color: #fff; }
.ebook-detail-metrics { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 25px; }
.ebook-detail-metrics span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; color: #e8fffb; background: rgba(255,255,255,.08); font-size: 13px; }
.ebook-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ebook-detail-actions .portal-button-primary { background: var(--ebook-orange); box-shadow: none; }
.ebook-detail-actions .portal-button-outline { border-color: rgba(255,255,255,.36); color: #fff; background: rgba(255,255,255,.08); }
.ebook-detail-content { display: grid; grid-template-columns: minmax(0,1fr) 320px; align-items: start; gap: 28px; }
.ebook-tabs { display: flex; border-bottom: 1px solid var(--ebook-line); }
.ebook-tab { position: relative; min-height: 52px; padding: 0 18px; border: 0; color: #667085; background: transparent; font-size: 14px; font-weight: 800; white-space: nowrap; }
.ebook-tab.active { color: var(--ebook-teal); }
.ebook-tab.active::after { position: absolute; right: 14px; bottom: -1px; left: 14px; height: 3px; border-radius: 3px 3px 0 0; content: ""; background: var(--ebook-teal); }
.ebook-pane { display: none; padding: 25px; }
.ebook-pane.active { display: block; }
.ebook-pane h2 { margin: 0 0 13px; font-size: 23px; font-weight: 900; }
.ebook-pane h3 { margin: 24px 0 9px; font-size: 17px; font-weight: 850; }
.ebook-pane p,.ebook-pane li { color: #475467; font-size: 15px; line-height: 26px; }
.ebook-pane li + li { margin-top: 7px; }
.ebook-toc { margin: 0; padding: 0; list-style: none; counter-reset: ebook-toc; }
.ebook-toc li { display: flex; align-items: center; gap: 11px; padding: 13px 0; border-bottom: 1px solid #edf1f2; }
.ebook-toc li::before { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--ebook-teal); content: counter(ebook-toc); counter-increment: ebook-toc; background: var(--ebook-mint); font-size: 12px; font-weight: 850; }
.ebook-review-summary { display: grid; grid-template-columns: 125px 1fr; gap: 24px; align-items: center; margin-bottom: 23px; }
.ebook-score { padding: 20px; border-radius: 12px; text-align: center; background: #f7faf9; }
.ebook-score strong { display: block; font-size: 36px; font-weight: 900; }
.ebook-stars { color: #f59e0b; letter-spacing: 1px; }
.ebook-score span { display: block; margin-top: 5px; color: #667085; font-size: 12px; }
.ebook-review { padding: 18px 0; border-top: 1px solid #edf1f2; }
.ebook-review-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.ebook-review-head strong { font-size: 14px; }
.ebook-review-head time { color: #98a2b3; font-size: 12px; }
.ebook-detail-side { position: sticky; top: 98px; }
.ebook-info-list { margin: 0; padding: 7px 20px; list-style: none; }
.ebook-info-list li { display: flex; justify-content: space-between; gap: 15px; padding: 13px 0; border-bottom: 1px solid #edf1f2; font-size: 13px; }
.ebook-info-list li:last-child { border-bottom: 0; }
.ebook-info-list span { color: #667085; }
.ebook-info-list strong { text-align: right; }
.ebook-side-actions { display: grid; gap: 9px; padding: 14px 20px 21px; }
.ebook-related { padding-top: 0; }

/* Reader */
.ebook-reader-page { background: #263238; }
.ebook-reader-main { height: 100vh; padding-top: 79px; }
.ebook-reader-toolbar { display: flex; height: 58px; align-items: center; gap: 12px; padding: 8px 18px; color: #fff; background: #142126; }
.ebook-reader-toolbar > a,.ebook-reader-tool { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; color: #fff; background: rgba(255,255,255,.05); }
.ebook-reader-toolbar-title { min-width: 0; flex: 1; }
.ebook-reader-toolbar-title h1 { overflow: hidden; margin: 0; font-size: 15px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.ebook-reader-toolbar-title span { color: #9fb0b6; font-size: 12px; }
.ebook-reader-tools { display: flex; align-items: center; gap: 7px; }
.ebook-reader-progress { width: 155px; }
.ebook-reader-progress div { height: 4px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.16); }
.ebook-reader-progress div span { display: block; height: 100%; background: #35c6b9; }
.ebook-reader-progress small { display: block; margin-bottom: 4px; color: #b8c6cb; font-size: 11px; text-align: right; }
.ebook-reader-layout { display: grid; height: calc(100vh - 137px); grid-template-columns: 240px minmax(0,1fr); overflow: hidden; }
.ebook-reader-sidebar { overflow-y: auto; padding: 15px; border-right: 1px solid rgba(255,255,255,.08); background: #1b292e; }
.ebook-reader-sidebar h2 { margin: 2px 0 13px; color: #fff; font-size: 14px; font-weight: 800; }
.ebook-page-thumb { width: 100%; margin-bottom: 13px; padding: 8px; border: 2px solid transparent; border-radius: 8px; color: #acbbc0; background: rgba(255,255,255,.04); font-size: 12px; text-align: center; }
.ebook-page-thumb.active { border-color: #36c6ba; color: #fff; }
.ebook-page-thumb-sheet { display: grid; aspect-ratio: 1/1.35; margin-bottom: 7px; place-items: center; color: #78909c; background: #e9eeee; font-size: 28px; }
.ebook-reader-stage { position: relative; display: grid; overflow: auto; padding: 24px 70px; place-items: start center; background: #34444a; }
.ebook-paper { width: min(760px,100%); min-height: 980px; padding: 70px 75px; color: #29333a; background: #fff; box-shadow: 0 12px 35px rgba(0,0,0,.25); transform-origin: top center; }
.ebook-paper-kicker { color: var(--ebook-teal); font-size: 13px; font-weight: 850; letter-spacing: .8px; text-transform: uppercase; }
.ebook-paper h2 { margin: 14px 0 24px; font-size: 30px; font-weight: 900; line-height: 1.25; }
.ebook-paper h3 { margin: 28px 0 12px; font-size: 19px; font-weight: 850; }
.ebook-paper p,.ebook-paper li { color: #3f4c55; font-size: 16px; line-height: 29px; }
.ebook-paper blockquote { margin: 25px 0; padding: 18px 20px; border-left: 4px solid var(--ebook-teal); color: #385b57; background: #f1faf8; font-size: 16px; line-height: 27px; }
.ebook-paper-footer { margin-top: 50px; padding-top: 15px; border-top: 1px solid #dfe5e8; color: #84919b; font-size: 12px; text-align: center; }
.ebook-reader-nav { position: fixed; z-index: 3; top: 50%; display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(15,23,42,.72); box-shadow: 0 5px 14px rgba(0,0,0,.2); transform: translateY(-50%); }
.ebook-reader-nav.prev { left: 260px; }
.ebook-reader-nav.next { right: 20px; }
.ebook-reader-search { position: absolute; z-index: 5; top: 70px; right: 20px; display: none; width: 300px; padding: 12px; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.ebook-reader-search.show { display: flex; gap: 7px; }

/* Upload and management */
.ebook-dashboard-hero { color: #fff; background: linear-gradient(120deg,#0b5f5b,#0f766e); }
.ebook-dashboard-hero .content-container { padding-top: 45px; padding-bottom: 43px; }
.ebook-dashboard-hero h1 { margin: 8px 0 8px; font-size: 32px; font-weight: 900; }
.ebook-dashboard-hero p { max-width: 720px; margin: 0; color: #d8f7f1; font-size: 15px; line-height: 24px; }
.ebook-workspace { display: grid; grid-template-columns: 220px minmax(0,1fr); align-items: start; gap: 26px; }
.ebook-workspace-nav { overflow: hidden; padding: 8px; }
.ebook-workspace-tab { display: flex; width: 100%; align-items: center; gap: 10px; padding: 13px 12px; border: 0; border-radius: 9px; color: #475467; background: transparent; font-size: 14px; font-weight: 800; text-align: left; }
.ebook-workspace-tab.active { color: var(--ebook-teal); background: #eaf8f5; }
.ebook-workspace-pane { display: none; }
.ebook-workspace-pane.active { display: block; }
.ebook-form-section + .ebook-form-section { margin-top: 20px; }
.ebook-form-title { padding: 19px 22px; border-bottom: 1px solid #edf1f2; }
.ebook-form-title h2 { margin: 0 0 5px; font-size: 19px; font-weight: 850; }
.ebook-form-title p { margin: 0; color: #667085; font-size: 14px; line-height: 21px; }
.ebook-form-body { padding: 22px; }
.ebook-form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 0 18px; }
.ebook-form-grid .wide { grid-column: 1/-1; }
.ebook-counter { display: block; margin-top: 5px; color: #98a2b3; font-size: 12px; text-align: right; }
.ebook-upload-box { display: grid; min-height: 150px; place-items: center; padding: 20px; border: 2px dashed #cbd9dc; border-radius: 12px; color: #667085; background: #f9fbfb; text-align: center; cursor: pointer; }
.ebook-upload-box:hover { border-color: #65c4bb; background: #f1fbf9; }
.ebook-upload-box i { display: block; margin-bottom: 8px; color: var(--ebook-teal); font-size: 30px; }
.ebook-upload-box strong { display: block; margin-bottom: 4px; color: #344054; font-size: 14px; }
.ebook-upload-box span { font-size: 13px; }
.ebook-upload-box input { display: none; }
.ebook-file-name { display: block; margin-top: 8px; color: var(--ebook-teal); font-size: 13px; font-weight: 750; }
.ebook-tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.ebook-tag-picker label { margin: 0; }
.ebook-tag-picker input { position: absolute; opacity: 0; pointer-events: none; }
.ebook-tag-picker span { display: inline-flex; min-height: 36px; align-items: center; padding: 0 12px; border: 1px solid #dfe5e8; border-radius: 999px; color: #475467; background: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.ebook-tag-picker input:checked + span { border-color: #79cfc7; color: var(--ebook-teal); background: #eaf9f6; }
.ebook-author-row { display: grid; grid-template-columns: 1fr 1fr 42px; gap: 9px; margin-bottom: 9px; }
.ebook-author-row button { border: 1px solid #f3d2d2; border-radius: 9px; color: #dc2626; background: #fff7f7; }
.ebook-form-actions { position: sticky; z-index: 3; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid #e8edef; background: rgba(255,255,255,.96); }
.ebook-management-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.ebook-management-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 900; }
.ebook-management-head p { margin: 0; color: #667085; font-size: 14px; }
.ebook-management-tools {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ebook-management-search {
    display: flex;
    width: 260px;
    height: 44px;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid #dfe5e8;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ebook-management-search:focus-within {
    border-color: #79cfc7;
    box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}
.ebook-management-search > i {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 15px;
}
.ebook-management-search:focus-within > i { color: #0f766e; }
.ebook-management-search input {
    min-width: 0;
    flex: 1;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1f2937;
    font-size: 14px;
    -webkit-appearance: none;
    appearance: none;
}
.ebook-management-search input::placeholder { color: #94a3b8; }
.ebook-management-search input::-webkit-search-decoration,
.ebook-management-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ebook-management-tools .portal-select-wrap,
.ebook-management-tools .ebook-management-filter {
    width: 190px;
    flex: 0 0 190px;
    min-width: 0;
}
.ebook-management-tools .portal-select-trigger,
.ebook-management-tools .portal-select {
    height: 44px;
    min-width: 0;
}
.ebook-management-tools .portal-button,
.ebook-management-create {
    flex: 0 0 auto;
    height: 44px;
    min-height: 44px;
    padding: 0 16px;
    white-space: nowrap;
}
.ebook-table-wrap { overflow-x: auto; }
.ebook-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.ebook-table th { padding: 13px 16px; color: #667085; background: #f8fafb; font-size: 12px; font-weight: 800; text-align: left; text-transform: uppercase; }
.ebook-table td { padding: 16px; border-top: 1px solid #edf1f2; color: #475467; font-size: 14px; vertical-align: middle; }
.ebook-table-doc { display: flex; min-width: 285px; align-items: center; gap: 12px; }
.ebook-table-doc img { width: 45px; height: 62px; border-radius: 5px; object-fit: cover; }
.ebook-table-doc strong { display: block; color: #17202a; font-size: 14px; line-height: 20px; }
.ebook-table-doc span { color: #84919b; font-size: 12px; }
.ebook-status { display: inline-flex; padding: 6px 9px; border-radius: 999px; color: #166534; background: #dcfce7; font-size: 11px; font-weight: 800; white-space: nowrap; }
.ebook-status.waiting { color: #92400e; background: #fef3c7; }
.ebook-status.rejected { color: #991b1b; background: #fee2e2; }
.ebook-row-actions { display: flex; gap: 5px; }
.ebook-row-actions button,.ebook-row-actions a { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #e1e8ea; border-radius: 7px; color: #64748b; background: #fff; }

@media(max-width:1199.98px) {
    .ebook-hero-grid { grid-template-columns: minmax(0,1fr) 300px; gap: 35px; }
    .ebook-feature-grid { grid-template-columns: repeat(2,1fr); }
    .ebook-grid { grid-template-columns: repeat(2,1fr); }
    .ebook-detail-content { grid-template-columns: minmax(0,1fr) 285px; }
}

@media(max-width:991.98px) {
    .ebook-main { padding-top: 72px; }
    .ebook-hero-grid { grid-template-columns: 1fr; }
    .ebook-hero-art { display: none; }
    .ebook-stats-grid { grid-template-columns: repeat(2,1fr); }
    .ebook-stat:nth-child(2) { border-right: 0; }
    .ebook-stat:nth-child(-n+2) { border-bottom: 1px solid #edf1f2; }
    .ebook-catalogue-layout,.ebook-detail-content,.ebook-workspace { grid-template-columns: 1fr; }
    .ebook-filter,.ebook-detail-side { position: static; }
    .ebook-filter { display: grid; grid-template-columns: repeat(2,1fr); gap: 0 22px; }
    .ebook-filter-head { grid-column: 1/-1; }
    .ebook-detail-grid { grid-template-columns: 220px minmax(0,1fr); gap: 30px; }
    .ebook-workspace-nav { display: flex; overflow-x: auto; }
    .ebook-workspace-tab { width: auto; min-width: 185px; }
    .ebook-reader-layout { grid-template-columns: 170px minmax(0,1fr); }
    .ebook-reader-nav.prev { left: 185px; }
    .ebook-reader-stage { padding: 20px 54px; }
    .ebook-paper { padding: 52px; }
}

@media(max-width:767.98px) {
    .ebook-hero h1 { font-size: 33px; }
    .ebook-hero-copy > p { font-size: 15px; line-height: 24px; }
    .ebook-search { align-items: stretch; flex-wrap: wrap; padding: 10px; }
    .ebook-search input { width: calc(100% - 30px); }
    .ebook-search button { width: 100%; }
    .ebook-section { padding: 40px 0; }
    .ebook-section-heading,.ebook-toolbar,.ebook-results-head,.ebook-management-head { align-items: flex-start; flex-direction: column; }
    .ebook-section-heading h2 { font-size: 24px; }
    .ebook-feature-grid,.ebook-grid { grid-template-columns: 1fr; }
    .ebook-cover { height: 330px; }
    .ebook-filter { grid-template-columns: 1fr; }
    .ebook-filter-head { grid-column: auto; }
    .ebook-toolbar-actions,.ebook-management-tools { width: 100%; }
    .ebook-management-tools {
        flex-wrap: nowrap;
    }
    .ebook-management-search {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
    }
    .ebook-management-tools .portal-select-wrap,
    .ebook-management-tools .ebook-management-filter {
        width: 160px;
        flex: 0 0 160px;
    }
    .ebook-management-tools .portal-button,
    .ebook-management-create {
        flex: 0 0 auto;
    }
    .ebook-detail-grid { grid-template-columns: 1fr; }
    .ebook-detail-cover { width: 210px; }
    .ebook-detail-copy h1 { font-size: 30px; }
    .ebook-review-summary { grid-template-columns: 1fr; }
    .ebook-form-grid { grid-template-columns: 1fr; }
    .ebook-form-grid .wide { grid-column: auto; }
    .ebook-author-row { grid-template-columns: 1fr 42px; }
    .ebook-author-row input:nth-child(2) { grid-column: 1/-1; grid-row: 2; }
    .ebook-reader-toolbar { gap: 7px; padding: 8px 10px; }
    .ebook-reader-toolbar-title span,.ebook-reader-progress,.ebook-reader-tools .optional { display: none; }
    .ebook-reader-layout { grid-template-columns: 1fr; }
    .ebook-reader-sidebar { display: none; }
    .ebook-reader-stage { padding: 14px 30px; }
    .ebook-paper { min-height: 820px; padding: 35px 28px; }
    .ebook-paper h2 { font-size: 25px; }
    .ebook-paper p,.ebook-paper li { font-size: 15px; line-height: 27px; }
    .ebook-reader-nav.prev { left: 5px; }
    .ebook-reader-nav.next { right: 5px; }
}

@media(max-width:479.98px) {
    .ebook-stats-grid { grid-template-columns: 1fr; }
    .ebook-stat { justify-content: flex-start; border-right: 0; border-bottom: 1px solid #edf1f2; }
    .ebook-feature-grid .ebook-cover,.ebook-cover { height: 290px; }
    .ebook-detail-actions .portal-button { width: 100%; }
}

/* Blazor MainLayout: header sticky — không chừa 79px như mockup fixed-top */
.ebook-page .ebook-main,
.ebook-main {
    padding-top: 0;
    min-height: 0;
}

.ebook-detail-cover-fallback {
    display: grid;
    place-items: center;
    height: 100%;
    min-height: 280px;
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.7);
    font-size: 3rem;
}

.ebook-richtext { line-height: 1.7; }
.ebook-richtext p { margin-bottom: .85rem; }

.ebook-bookmark-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 12px 0 16px;
}

.ebook-bookmark-form .portal-input {
    width: auto;
    min-width: 80px;
}

.ebook-bookmark-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ebook-bookmark-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #edf1f2;
    font-size: 14px;
}

.ebook-review-form-stars { padding: 0; border: 0; }
.ebook-review-form-stars legend { margin-bottom: 10px; font-size: 14px; font-weight: 800; }
.ebook-review-form-stars > div { display: flex; flex-wrap: wrap; gap: 8px; }
.ebook-review-form-stars label { position: relative; display: flex; min-width: 64px; flex-direction: column; align-items: center; padding: 8px; border: 1px solid var(--ebook-line); border-radius: 9px; cursor: pointer; }
.ebook-review-form-stars input { position: absolute; opacity: 0; pointer-events: none; }
.ebook-review-form-stars span { color: #cbd5e1; font-size: 25px; line-height: 25px; }
.ebook-review-form-stars small { margin-top: 3px; color: #64748b; font-size: 10px; }
.ebook-review-form-stars label:has(input:checked) { border-color: #f59e0b; background: #fffbeb; }
.ebook-review-form-stars label:has(input:checked) span { color: #f59e0b; }
