@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: Georgia, 'Times New Roman', serif;
    background-color: #f5f5f5;
}

/* Boxed content container */
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* White Paper CMS Styles */

/* Button Group Spacing */
.btn-group .btn {
    margin-left: 0.25rem;
}

.btn-group .btn:first-child {
    margin-left: 0;
}

/* Section Styles */
.section-item {
    background-color: #fff;
    transition: all 0.2s ease;
    margin-bottom: 0;
    padding: 0;
    border: none !important;
}

.section-header {
    background-color: transparent;
    border: none !important;
    padding: 1rem 0 0.5rem 0;
}

.section-content {
    padding: 1rem;
    line-height: 1.7;
}

.section-content p {
    margin-bottom: 1rem;
}

.child-sections {
    border-left: 3px solid #dee2e6;
    padding-left: 1rem;
}

.inline-editing-section {
    border: 1px solid #d6dee6 !important;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    padding: 0 1rem 1rem;
}

.inline-section-editor {
    border-top: 1px solid #e5e9ef;
    padding-top: 1rem;
}

.section-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}

.inline-section-visible {
    align-self: end;
    padding-left: 1.75rem;
}

.markdown-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}

.markdown-editor-topbar {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.markdown-toolbar {
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
}

.markdown-toolbar.btn-group .btn {
    border-radius: 0.25rem !important;
    margin-left: 0;
    min-height: 2rem;
    min-width: 2.1rem;
}

textarea.form-control.markdown-editor-textarea {
    height: clamp(560px, 68vh, 780px);
    min-height: 520px;
    width: 100%;
    font-family: Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95rem;
    line-height: 1.55;
    resize: vertical;
}

.markdown-preview {
    height: clamp(560px, 68vh, 780px);
    min-height: 520px;
    overflow: auto;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.75rem 1rem;
    background-color: #fff;
}

.markdown-preview > :last-child {
    margin-bottom: 0;
}

.section-main-content img {
    border-radius: 0.25rem;
    cursor: zoom-in;
    display: block;
    height: auto;
    margin: 1rem auto;
    max-height: min(70vh, 760px);
    max-width: 100%;
    object-fit: contain;
}

.markdown-image-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1.5rem;
    position: fixed;
    z-index: 2050;
}

.markdown-image-modal[hidden] {
    display: none;
}

.markdown-image-modal-backdrop {
    background-color: rgba(12, 18, 28, 0.86);
    inset: 0;
    position: absolute;
}

.markdown-image-modal-content {
    max-height: 94vh;
    max-width: 96vw;
    position: relative;
    z-index: 1;
}

.markdown-image-modal-image {
    background-color: #fff;
    border-radius: 0.25rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.45);
    display: block;
    max-height: 90vh;
    max-width: 96vw;
    object-fit: contain;
}

.markdown-image-modal-close {
    align-items: center;
    background-color: #fff;
    border: 0;
    border-radius: 50%;
    color: #212529;
    display: flex;
    font-size: 1.5rem;
    height: 2.25rem;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: -0.75rem;
    top: -0.75rem;
    width: 2.25rem;
    z-index: 2;
}

.markdown-image-modal-caption {
    color: #fff;
    font-size: 0.95rem;
    margin-top: 0.75rem;
    text-align: center;
}

body.markdown-image-modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .section-settings-grid {
        grid-template-columns: 1fr;
    }

    .markdown-editor {
        grid-template-columns: 1fr;
    }

    .markdown-editor-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .markdown-toolbar {
        justify-content: flex-start;
    }

    textarea.form-control.markdown-editor-textarea,
    .markdown-preview {
        height: clamp(420px, 58vh, 620px);
        min-height: 420px;
    }

    .markdown-image-modal {
        padding: 0.75rem;
    }

    .markdown-image-modal-close {
        right: 0.25rem;
        top: 0.25rem;
    }
}

/* Styled Block Classes */
.notice {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin: 1rem 0;
}

.doctrine {
    background-color: #d1ecf1;
    border-left: 4px solid #0c5460;
    padding: 1rem;
    margin: 1rem 0;
}

.definition {
    background-color: #d4edda;
    border-left: 4px solid #155724;
    padding: 1rem;
    margin: 1rem 0;
}

.example {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 1rem;
    margin: 1rem 0;
}

.important {
    background-color: #f8d7da;
    border-left: 4px solid #721c24;
    padding: 1rem;
    margin: 1rem 0;
    font-weight: bold;
}

.quote {
    border-left: 4px solid #6c757d;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
}

.code {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    padding: 1rem;
    margin: 1rem 0;
    font-family: monospace;
}

.highlight {
    background-color: #fff9e6;
    padding: 0.2rem 0.4rem;
}

.footnote {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.caption {
    text-align: center;
    font-style: italic;
    color: #6c757d;
    margin-top: 0.5rem;
}

.section-intro {
    font-size: 1.1rem;
    color: #495057;
    margin-bottom: 1.5rem;
}

.callout {
    background-color: #e7f3ff;
    border: 2px solid #007bff;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0.25rem;
}

/* Wireframe and Equation Styles */
.wireframe-container {
    margin: 1.5rem 0;
}

.wireframe-image {
    margin-bottom: 1rem;
}

.equation-container {
    margin: 1.5rem 0;
    text-align: center;
}

.equation {
    display: inline-block;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
}

/* Table of Contents Styles */
.table-of-contents {
    gap: 0.125rem;
}

.toc-item {
    align-items: center;
    display: flex;
    min-height: 2rem;
    position: relative;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.toc-link {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    padding-left: calc(var(--toc-indent, 0px) + 0.5rem) !important;
}

.toc-edit-mode .toc-link {
    padding-left: calc(var(--toc-indent, 0px) + 0.25rem) !important;
}

.toc-drag-handle {
    color: #6c757d;
    cursor: grab;
    flex: 0 0 1.5rem;
    opacity: 0.7;
    text-align: center;
}

.toc-drag-handle:active {
    cursor: grabbing;
}

.draggable-toc-item {
    border-radius: 0.25rem;
    cursor: default;
}

.draggable-toc-item:hover {
    background-color: #f8f9fa;
}

.draggable-toc-item.dragging {
    opacity: 0.45;
}

.toc-drop-before::before,
.toc-drop-after::after {
    background-color: #0d6efd;
    border-radius: 999px;
    content: "";
    height: 3px;
    left: 0;
    position: absolute;
    right: 0;
    z-index: 2;
}

.toc-drop-before::before {
    top: -2px;
}

.toc-drop-after::after {
    bottom: -2px;
}

.toc-item-hidden .toc-link {
    opacity: 0.55;
    text-decoration: line-through;
}

.nav-link {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
}

.nav-link:hover {
    background-color: #f8f9fa;
}

.document-title {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.books-page,
.setup-page,
.notifications-page {
    font-family: Arial, Helvetica, sans-serif;
}

.books-page {
    background: #fff7e8;
    color: #27223a;
    min-height: 100vh;
}

.books-hero {
    align-items: center;
    background: #28a4ff;
    border-bottom: 0.45rem solid #ef476f;
    color: #27223a;
    display: flex;
    justify-content: center;
    min-height: 22rem;
    overflow: hidden;
    padding: 4rem 2rem 3.5rem;
    text-align: center;
}

.books-hero-copy {
    max-width: 52rem;
    width: 100%;
}

.books-logo {
    display: block;
    height: auto;
    margin: 0 auto 1rem;
    max-width: 100%;
    width: min(34rem, 100%);
}

.books-section-label {
    color: #b4482f;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

.books-hero-text {
    color: #25324a;
    font-size: 1.15rem;
    line-height: 1.65;
    margin: 0 auto;
    max-width: 38rem;
}

.books-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: -0.25rem 0 1.25rem;
}

.books-page-actions form {
    display: inline-flex;
    margin: 0;
}

.books-page-actions .btn {
    align-items: center;
    border-radius: 0.5rem;
    border-width: 2px;
    box-shadow: 0.18rem 0.18rem 0 #27223a;
    display: inline-flex;
    gap: 0.45rem;
    min-height: 2.5rem;
}

.books-page-actions .btn:hover,
.books-page-actions .btn:focus {
    box-shadow: 0.1rem 0.1rem 0 #27223a;
    transform: translate(1px, 1px);
}

.books-collection {
    margin: 0 auto;
    max-width: 1180px;
    padding: 2rem 1rem 4rem;
}

.books-collection-header {
    align-items: flex-end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.books-collection-header h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
}

.books-count {
    background: #ffffff;
    border: 2px solid #ffd166;
    border-radius: 0.35rem;
    color: #7a3f00;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.35rem 0.6rem;
}

.books-loading {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 12rem;
}

.books-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.book-card {
    background: #fff;
    border: 2px solid #27223a;
    border-radius: 0.5rem;
    box-shadow: 0.35rem 0.35rem 0 rgba(39, 34, 58, 0.12);
    color: #27223a;
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    min-height: 11rem;
    overflow: hidden;
    text-decoration: none;
    transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.book-card:hover,
.book-card:focus {
    box-shadow: 0.55rem 0.55rem 0 rgba(39, 34, 58, 0.16);
    color: #27223a;
    transform: translateY(-3px) rotate(-0.35deg);
}

.book-card-cover {
    color: #fff;
    min-height: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: inset -0.8rem 0 rgba(0, 0, 0, 0.12);
}

.book-card-cover::before {
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.58);
    border-radius: 50%;
    content: "";
    height: 1.75rem;
    left: 1rem;
    position: absolute;
    top: 1rem;
    width: 1.75rem;
}

.book-card-cover::after {
    border-bottom: 2px solid rgba(255, 255, 255, 0.46);
    border-top: 2px solid rgba(255, 255, 255, 0.46);
    bottom: 1rem;
    content: "";
    height: 0.55rem;
    left: 1rem;
    position: absolute;
    right: 1rem;
}

.book-card-tone-1 .book-card-cover {
    background: #ef476f;
    border-left: 0.35rem solid #ffd166;
}

.book-card-tone-2 .book-card-cover {
    background: #06a77d;
    border-left: 0.35rem solid #b8f2e6;
}

.book-card-tone-3 .book-card-cover {
    background: #3d5aef;
    border-left: 0.35rem solid #f7d6e0;
}

.book-card-tone-4 .book-card-cover {
    background: #ff8c42;
    border-left: 0.35rem solid #27223a;
}

.book-card-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1rem;
}

.book-card-heading {
    align-items: flex-start;
    display: flex;
    gap: 0.65rem;
    justify-content: space-between;
}

.book-card h3 {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
    overflow-wrap: anywhere;
}

.book-card p {
    color: #5d5870;
    line-height: 1.55;
    margin: 0.55rem 0 1rem;
}

.book-status {
    border-radius: 0.35rem;
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.48rem;
    white-space: nowrap;
}

.book-status-public {
    background: #d9f99d;
    color: #315d0a;
}

.book-status-private {
    background: #ffe8a3;
    color: #704400;
}

.book-card-link {
    align-items: center;
    color: #b4482f;
    display: inline-flex;
    font-weight: 800;
    gap: 0.35rem;
    margin-top: auto;
}

.setup-heading-row {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.setup-exit-link {
    font-size: 0.95rem;
}

.setup-tabs {
    margin-bottom: 0;
}

.setup-section {
    border: 1px solid #dee2e6;
    border-top: 0;
    background: #fff;
    padding: 1.25rem;
}

.setup-section h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.provider-instructions {
    color: #495057;
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.provider-private-key {
    font-family: Consolas, "Liberation Mono", "Courier New", monospace;
    min-height: 9rem;
}

.section-comments {
    border-top: 1px solid #e5e9ef;
    margin: 0.75rem 0 1.25rem;
    padding-top: 0.75rem;
}

.comments-panel {
    background: #fafbfc;
    border: 1px solid #dbe2ea;
    border-radius: 0.25rem;
    padding: 0.75rem;
}

.comment-item {
    background: #fff;
    border-left: 3px solid #6c8fb3;
    margin-bottom: 0.65rem;
    padding: 0.6rem 0.75rem;
}

.comment-meta {
    color: #6c757d;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
}

.comment-body {
    font-family: Arial, Helvetica, sans-serif;
    white-space: pre-wrap;
}

.comment-actions {
    margin-top: 0.25rem;
}

.notification-item {
    border-left: 4px solid transparent;
    text-align: left;
}

.notification-unread {
    border-left-color: #1b6ec2;
    background: #f4f8fc;
}

.document-action-bar {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 2px solid rgba(255, 88, 78, 0.28);
    border-radius: 0.5rem;
    box-shadow: 0 0.35rem 1rem rgba(0, 103, 206, 0.16);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0.4rem;
    position: fixed;
    right: 1rem;
    top: 0.75rem;
    z-index: 1040;
}

.document-action-bar .btn {
    border-radius: 0.45rem;
    border-width: 2px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    white-space: nowrap;
}

.mobile-document-actions .btn {
    border-radius: 0.45rem;
    border-width: 2px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
}

.document-action-bar .btn:hover,
.document-action-bar .btn:focus,
.mobile-document-actions .btn:hover,
.mobile-document-actions .btn:focus {
    transform: translateY(-1px);
}

.document-action-bar .reader-home-button,
.mobile-document-actions .reader-home-button,
.document-action-bar-mobile .document-action-icon,
.mobile-toc-header .document-action-icon {
    background: #ff5a52;
    border-color: #ff5a52;
    color: #fff;
}

.document-action-bar .reader-home-button:hover,
.document-action-bar .reader-home-button:focus,
.mobile-document-actions .reader-home-button:hover,
.mobile-document-actions .reader-home-button:focus,
.document-action-bar-mobile .document-action-icon:hover,
.document-action-bar-mobile .document-action-icon:focus,
.mobile-toc-header .document-action-icon:hover,
.mobile-toc-header .document-action-icon:focus {
    background: #e9403c;
    border-color: #e9403c;
    color: #fff;
}

.document-action-bar .btn-outline-primary,
.mobile-document-actions .btn-outline-primary {
    background: #eef7ff;
    border-color: #0077d9;
    color: #0057b8;
}

.document-action-bar .btn-outline-primary:hover,
.document-action-bar .btn-outline-primary:focus,
.mobile-document-actions .btn-outline-primary:hover,
.mobile-document-actions .btn-outline-primary:focus {
    background: #0077d9;
    color: #fff;
}

.document-action-bar .btn-outline-secondary:not(.reader-home-button),
.mobile-document-actions .btn-outline-secondary:not(.reader-home-button) {
    background: #fff;
    border-color: #0077d9;
    color: #0057b8;
}

.document-action-bar .btn-outline-secondary:not(.reader-home-button):hover,
.document-action-bar .btn-outline-secondary:not(.reader-home-button):focus,
.mobile-document-actions .btn-outline-secondary:not(.reader-home-button):hover,
.mobile-document-actions .btn-outline-secondary:not(.reader-home-button):focus {
    background: #0057b8;
    border-color: #0057b8;
    color: #fff;
}

.document-action-bar .btn-primary,
.mobile-document-actions .btn-primary {
    background: #0057b8;
    border-color: #0057b8;
    color: #fff;
}

.document-action-bar .btn-primary:hover,
.document-action-bar .btn-primary:focus,
.mobile-document-actions .btn-primary:hover,
.mobile-document-actions .btn-primary:focus {
    background: #00458f;
    border-color: #00458f;
    color: #fff;
}

.document-action-bar .btn-secondary,
.document-action-bar .btn-success,
.mobile-document-actions .btn-secondary,
.mobile-document-actions .btn-success {
    background: #86df4f;
    border-color: #58b72b;
    color: #15360b;
}

.document-action-bar .btn-secondary:hover,
.document-action-bar .btn-secondary:focus,
.document-action-bar .btn-success:hover,
.document-action-bar .btn-success:focus,
.mobile-document-actions .btn-secondary:hover,
.mobile-document-actions .btn-secondary:focus,
.mobile-document-actions .btn-success:hover,
.mobile-document-actions .btn-success:focus {
    background: #6ecb38;
    border-color: #4b9f25;
    color: #102b08;
}

.document-action-bar .btn-warning,
.mobile-document-actions .btn-warning {
    background: #ffd166;
    border-color: #ffb703;
    color: #3b2800;
}

.document-action-bar.document-action-bar-mobile .document-action-icon,
.mobile-toc-header .document-action-icon {
    background: #ff5a52;
    border-color: #ff5a52;
    color: #fff;
}

.document-action-bar-mobile {
    border-radius: 0.5rem;
    padding: 0.35rem;
}

.document-action-icon {
    align-items: center;
    display: inline-flex;
    height: 2.5rem;
    justify-content: center;
    min-width: 2.5rem;
}

@supports (backdrop-filter: blur(6px)) {
    .document-action-bar {
        backdrop-filter: blur(6px);
    }
}

.mobile-toc-backdrop {
    background: rgba(15, 23, 42, 0.42);
    inset: 0;
    position: fixed;
    z-index: 1045;
}

.mobile-toc-panel {
    background: #fff;
    bottom: 0;
    box-shadow: 0.75rem 0 2rem rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    left: 0;
    max-width: 88vw;
    position: fixed;
    top: 0;
    width: 20rem;
    z-index: 1050;
}

.mobile-toc-header {
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.mobile-toc-title {
    font-size: 1rem;
    line-height: 1.25;
    margin: 0;
}

.mobile-toc-body {
    overflow-y: auto;
    padding: 0.75rem;
}

.mobile-document-actions {
    border-bottom: 1px solid #e1e7ea;
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
}

.mobile-document-actions .btn {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    width: 100%;
}

@media (max-width: 991.98px) {
    .document-title {
        padding-right: 3.75rem;
    }

    .books-hero {
        min-height: 0;
        padding: 2.75rem 1rem 2rem;
    }

    .books-collection {
        padding-top: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .books-hero-text {
        font-size: 1rem;
    }

    .books-page-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .books-page-actions .btn,
    .books-page-actions form {
        justify-content: center;
        width: 100%;
    }

    .books-page-actions form .btn {
        width: 100%;
    }

    .books-collection-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-card {
        grid-template-columns: 5.25rem minmax(0, 1fr);
        min-height: 10rem;
    }

    .book-card-body {
        padding: 0.85rem;
    }

    .book-card-heading {
        flex-direction: column;
    }

    .book-status {
        align-self: flex-start;
    }

    .document-action-bar {
        right: 0.75rem;
        top: 0.75rem;
    }

    .document-action-bar-mobile {
        left: auto;
    }

    .document-action-bar-mobile .document-action-icon {
        height: 2.75rem;
        min-width: 2.75rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    button,
    .btn {
        display: none !important;
    }

    html,
    body {
        background-color: white;
    }

    body {
        font-size: 11pt;
        line-height: 1.45;
        orphans: 3;
        widows: 3;
    }

    .section-item {
        background: transparent;
        break-after: auto;
        break-before: auto;
        break-inside: auto;
        box-shadow: none !important;
        margin: 0;
        page-break-after: auto;
        page-break-before: auto;
        page-break-inside: auto;
        padding: 0;
    }

    .section-header {
        break-after: avoid;
        page-break-after: avoid;
        padding: 0.35rem 0 0.1rem;
    }

    .section-header h1,
    .section-header h2,
    .section-header h3,
    .section-header h4,
    .section-header h5,
    .section-header h6 {
        break-after: avoid;
        margin: 0 0 0.25rem;
        page-break-after: avoid;
    }

    .section-content {
        padding: 0;
    }

    .section-content p {
        margin: 0 0 0.75rem;
    }

    .child-sections {
        border-left: 0;
        margin-left: 0;
        padding-left: 0;
    }

    .section-main-content img {
        break-inside: avoid;
        max-height: 8in;
        page-break-inside: avoid;
    }

    .container-fluid {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .row {
        display: block;
    }

    .col-lg-9 {
        max-width: 100%;
        width: 100%;
    }

    .document-title {
        font-size: 24pt;
        margin-bottom: 0.35in;
    }
}
