:root {
    color-scheme: light;
    --ink: #17202a;
    --muted: #5b677a;
    --line: #d8e1e8;
    --paper: #f7fafc;
    --teal: #0f766e;
    --aqua: #33b6c8;
    --blue: #2e6fd8;
    --coral: #e85d75;
    --gold: #f4b400;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: #061526;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    overscroll-behavior: none;
    overflow: hidden;
}

a {
    color: inherit;
}

.topbar {
    align-items: center;
    background-image:
        linear-gradient(90deg, rgba(3, 15, 35, 0.96), rgba(8, 44, 62, 0.9)),
        url("../images/dentcyclopedia-menu-bg.jpg");
    background-position: center;
    background-size: cover;
    border-bottom: 1px solid rgba(86, 215, 243, 0.2);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    min-height: 72px;
    padding: 10px 14px;
    pointer-events: auto;
    position: relative;
    width: 100%;
    z-index: 20;
}

.brand {
    align-items: center;
    background: rgba(15, 32, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: var(--white);
    display: inline-flex;
    gap: 12px;
    min-width: 0;
    padding: 8px 10px;
    pointer-events: auto;
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: var(--teal);
    border-radius: 8px;
    color: var(--white);
    display: inline-flex;
    flex: 0 0 44px;
    font-size: 16px;
    font-weight: 800;
    height: 44px;
    justify-content: center;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 17px;
    line-height: 1.1;
}

.brand small {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    margin-top: 3px;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    pointer-events: auto;
}

.top-actions a,
.top-actions button {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    min-height: 38px;
    padding: 0 14px;
    text-decoration: none;
    white-space: nowrap;
}

.top-actions button,
.top-actions a:first-of-type {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--white);
}

.top-actions button.is-active {
    background: #56d7f3;
    border-color: #56d7f3;
    color: #07182d;
}

.top-actions .preview-toggle {
    display: none;
}

body.has-preview-fallback .top-actions .preview-toggle {
    display: inline-flex;
}

@media (hover: none) and (pointer: coarse), (max-width: 740px), (max-height: 560px) and (orientation: landscape) {
    .top-actions .preview-toggle {
        display: inline-flex;
    }
}

.top-actions a:last-child {
    background: rgba(15, 32, 42, 0.82);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--white);
}

.page-mode-toggle,
.resolution-toggle {
    align-items: stretch;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    display: inline-flex;
    overflow: hidden;
}

.resolution-toggle__label {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    padding: 0 11px;
    white-space: nowrap;
}

.resolution-toggle select {
    appearance: none;
    background:
        linear-gradient(45deg, transparent 50%, #ffffff 50%) calc(100% - 17px) 50% / 6px 6px no-repeat,
        linear-gradient(135deg, #ffffff 50%, transparent 50%) calc(100% - 12px) 50% / 6px 6px no-repeat,
        rgba(15, 32, 42, 0.82);
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0;
    color: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    min-height: 38px;
    min-width: 92px;
    padding: 0 34px 0 12px;
}

.resolution-toggle select:focus-visible {
    outline: 2px solid #56d7f3;
    outline-offset: -2px;
}

.resolution-toggle select option {
    background: #07182d;
    color: var(--white);
}

.top-actions .page-mode-toggle button {
    background: rgba(15, 32, 42, 0.82);
    border: 0;
    border-radius: 0;
    color: var(--white);
    padding: 0 12px;
}

.top-actions .page-mode-toggle button {
    min-width: 72px;
}

.top-actions .page-mode-toggle button + button {
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.top-actions .page-mode-toggle button.is-active {
    background: #56d7f3;
    border-color: #56d7f3;
    color: #07182d;
}

.password-modal[hidden] {
    display: none;
}

.password-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 10000;
}

.password-modal__backdrop {
    background: rgba(1, 9, 21, 0.78);
    inset: 0;
    position: absolute;
}

.password-modal__panel {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(235, 252, 255, 0.98));
    border: 1px solid rgba(86, 215, 243, 0.42);
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
    color: #07182d;
    max-width: 430px;
    padding: 24px;
    position: relative;
    width: min(430px, 100%);
}

.password-modal__close {
    align-items: center;
    background: #07182d;
    border: 0;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 22px;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 34px;
}

.password-modal__eyebrow {
    color: var(--teal);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    margin: 0 44px 8px 0;
    text-transform: uppercase;
}

.password-modal h2 {
    font-size: 26px;
    line-height: 1.1;
    margin: 0 44px 8px 0;
}

.password-modal__copy {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 18px;
}

.password-form {
    display: grid;
    gap: 13px;
}

.password-form label {
    display: grid;
    gap: 7px;
}

.password-form label[hidden] {
    display: none;
}

.password-form label span {
    color: #223044;
    font-size: 12px;
    font-weight: 900;
}

.password-form input {
    background: var(--white);
    border: 1px solid rgba(91, 103, 122, 0.28);
    border-radius: 8px;
    color: #07182d;
    font-family: inherit;
    font-size: 16px;
    min-height: 44px;
    padding: 0 12px;
    width: 100%;
}

.password-form input:focus {
    border-color: #33b6c8;
    box-shadow: 0 0 0 3px rgba(51, 182, 200, 0.18);
    outline: 0;
}

.password-form__status {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0;
    min-height: 18px;
}

.password-form__status.is-error {
    color: #bc2345;
}

.password-form__status.is-success {
    color: var(--teal);
}

.password-form__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 2px;
}

.password-form__actions button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    min-height: 40px;
    padding: 0 16px;
}

.password-form__cancel {
    background: rgba(7, 24, 45, 0.08);
    color: #07182d;
}

.password-form__submit {
    background: #07182d;
    color: var(--white);
}

.password-form__submit:disabled {
    cursor: wait;
    opacity: 0.72;
}

.password-page-body {
    background:
        linear-gradient(90deg, rgba(3, 15, 35, 0.96), rgba(8, 44, 62, 0.88)),
        url("../images/dentcyclopedia-menu-bg.jpg");
    background-position: center;
    background-size: cover;
    min-height: 100vh;
    overflow: auto;
}

.password-page {
    align-items: center;
    display: flex;
    min-height: calc(100vh - 72px);
    padding: clamp(24px, 5vw, 64px);
}

.password-page__panel {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(235, 252, 255, 0.98));
    border: 1px solid rgba(86, 215, 243, 0.42);
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
    color: #07182d;
    margin: 0 auto;
    max-width: 520px;
    padding: clamp(22px, 4vw, 34px);
    width: min(520px, 100%);
}

.password-page__eyebrow {
    color: var(--teal);
    font-size: 12px;
    font-weight: 900;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.password-page h1 {
    font-size: clamp(32px, 5vw, 46px);
    line-height: 1;
    margin: 0 0 10px;
}

.password-page__copy {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 20px;
}

.password-page__notice {
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
    margin: 0 0 16px;
    padding: 12px 14px;
}

.password-page__notice--success {
    background: rgba(15, 118, 110, 0.12);
    color: var(--teal);
}

.password-page__notice--error {
    background: rgba(188, 35, 69, 0.1);
    color: #bc2345;
}

.password-page__notice ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.password-page__form {
    display: grid;
    gap: 14px;
}

.password-page__form label {
    display: grid;
    gap: 7px;
}

.password-page__form label span {
    color: #223044;
    font-size: 12px;
    font-weight: 900;
}

.password-page__form input {
    background: var(--white);
    border: 1px solid rgba(91, 103, 122, 0.28);
    border-radius: 8px;
    color: #07182d;
    font-family: inherit;
    font-size: 16px;
    min-height: 46px;
    padding: 0 12px;
    width: 100%;
}

.password-page__form input:focus {
    border-color: #33b6c8;
    box-shadow: 0 0 0 3px rgba(51, 182, 200, 0.18);
    outline: 0;
}

.password-page__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

.password-page__actions a,
.password-page__actions button {
    align-items: center;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    justify-content: center;
    min-height: 42px;
    padding: 0 17px;
    text-decoration: none;
}

.password-page__actions a {
    background: rgba(7, 24, 45, 0.08);
    color: #07182d;
}

.password-page__actions button {
    background: #07182d;
    color: var(--white);
}

.workspace {
    background-image:
        radial-gradient(circle at 76% 36%, rgba(86, 215, 243, 0.24), transparent 28%),
        radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.1), transparent 20%),
        linear-gradient(90deg, rgba(3, 15, 35, 0.93), rgba(8, 45, 65, 0.78) 48%, rgba(3, 15, 35, 0.94)),
        url("../images/dentcyclopedia-menu-bg.jpg");
    background-position: center;
    background-size: cover;
    height: var(--viewer-height, calc(100vh - 72px));
    isolation: isolate;
    overflow: hidden;
    padding: 0;
    position: relative;
    width: 100vw;
}

.workspace-actions {
    display: inline-flex;
    gap: 10px;
    position: absolute;
    right: 18px;
    top: 14px;
    z-index: 32;
}

.workspace-button,
.home-button {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(86, 215, 243, 0.42);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    color: #07182d;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    justify-content: center;
    min-height: 38px;
    padding: 0 18px;
    text-decoration: none;
    white-space: nowrap;
}

.workspace-button:hover,
.workspace-button:focus-visible,
.home-button:hover,
.home-button:focus-visible {
    background: #56d7f3;
    outline: 0;
}

.workspace-button--first {
    background: #ffad08;
    border: 3px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 2px 0 rgba(129, 139, 153, 0.48), 0 8px 16px rgba(0, 0, 0, 0.22);
    color: #ffffff;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px 0 4px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.workspace-button--first:hover,
.workspace-button--first:focus-visible {
    background: #f6a000;
    outline: 0;
}

.workspace-button__icon {
    background: #ffffff;
    border: 2px solid #ffad08;
    border-radius: 50%;
    display: inline-flex;
    flex: 0 0 26px;
    height: 26px;
    position: relative;
    width: 26px;
}

.workspace-button__icon::before,
.workspace-button__icon::after {
    border-bottom: 2px solid #ffad08;
    border-left: 2px solid #ffad08;
    content: "";
    height: 8px;
    position: absolute;
    top: 7px;
    transform: rotate(45deg);
    width: 8px;
}

.workspace-button__icon::before {
    left: 8px;
}

.workspace-button__icon::after {
    left: 13px;
}

.preview-actions {
    display: none;
    gap: 10px;
    position: absolute;
    right: 16px;
    top: 14px;
    z-index: 9999;
}

.home-button--preview {
    position: static;
}

.workspace-button--preview-exit {
    display: none;
}

#dental_book.df-fullscreen .preview-actions,
.df-fullscreen .preview-actions {
    display: inline-flex;
}

html.is-custom-preview-root,
body.is-custom-preview {
    height: 100%;
    overflow: hidden;
}

body.is-custom-preview .workspace {
    height: var(--custom-preview-height, 100dvh);
    inset: 0;
    position: fixed;
    width: 100vw;
    z-index: 9990;
}

body.is-custom-preview .workspace-actions {
    display: none;
}

body.is-custom-preview .book-band,
body.is-custom-preview .book-frame {
    height: 100%;
    width: 100%;
}

body.is-custom-preview #dental_book.df-container {
    height: var(--custom-preview-height, 100dvh) !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
}

body.is-custom-preview #dental_book .df-3dcanvas {
    bottom: auto !important;
    height: calc(100% - 78px - env(safe-area-inset-bottom, 0px)) !important;
    top: 0 !important;
}

body.is-custom-preview #dental_book .df-book-stage {
    padding: calc(58px + env(safe-area-inset-top, 0px)) 12px calc(88px + env(safe-area-inset-bottom, 0px)) !important;
}

body.is-custom-preview .preview-actions {
    display: inline-flex;
    gap: 8px;
    position: fixed;
    right: calc(12px + env(safe-area-inset-right, 0px));
    top: calc(10px + env(safe-area-inset-top, 0px));
    z-index: 10020;
}

body.is-custom-preview .workspace-button--preview-exit {
    display: inline-flex;
}

body.is-custom-preview #dental_book .df-ui-wrapper.df-ui-controls {
    -webkit-overflow-scrolling: touch;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    gap: 0 !important;
    left: 50% !important;
    max-width: calc(100vw - 14px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
    opacity: 1 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    position: fixed !important;
    right: auto !important;
    top: auto !important;
    transform: translateX(-50%) !important;
    transform-origin: bottom center !important;
    visibility: visible !important;
    white-space: nowrap !important;
    width: max-content !important;
    z-index: 10010 !important;
}

body.is-custom-preview #dental_book .df-ui-wrapper.df-ui-controls::-webkit-scrollbar {
    display: none;
}

body.is-custom-preview #dental_book .df-ui-wrapper.df-ui-controls {
    scrollbar-width: none;
}

body.is-custom-preview #dental_book .df-ui-wrapper.df-ui-controls .df-ui-btn {
    flex: 0 0 auto !important;
}

.mobile-more-menu[hidden] {
    display: none;
}

.mobile-more-menu {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(86, 215, 243, 0.48);
    border-radius: 8px;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.36);
    display: grid;
    gap: 4px;
    padding: 7px;
    position: fixed;
    right: calc(10px + env(safe-area-inset-right, 0px));
    width: min(230px, calc(100vw - 20px));
    z-index: 10040;
}

.mobile-more-menu button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #07182d;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: 13px;
    font-weight: 850;
    justify-content: flex-start;
    min-height: 38px;
    padding: 0 11px;
    text-align: left;
}

.mobile-more-menu button:hover,
.mobile-more-menu button:focus-visible,
.mobile-more-menu button:active {
    background: rgba(86, 215, 243, 0.18);
    outline: 0;
}

body:not(.has-mobile-more-menu) .mobile-more-menu {
    display: none !important;
}

body.has-mobile-more-menu #dental_book .df-ui-more {
    touch-action: manipulation;
}

@media (hover: none) and (pointer: coarse), (max-width: 740px), (max-height: 560px) and (orientation: landscape) {
    #dental_book .df-ui-more .more-container {
        display: none !important;
    }
}

body.is-custom-preview .mobile-more-menu {
    bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    z-index: 10050;
}

.workspace::before {
    background-image:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 30px),
        radial-gradient(circle at center, transparent 0 54%, rgba(2, 10, 24, 0.5) 100%);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: -1;
}

.chapter-menu {
    align-items: center;
    background-image:
        linear-gradient(90deg, rgba(3, 15, 35, 0.92) 0%, rgba(9, 31, 68, 0.8) 44%, rgba(3, 15, 35, 0.36) 100%),
        var(--menu-background);
    background-position: center;
    background-size: cover;
    display: flex;
    inset: 0;
    opacity: 0;
    overflow: hidden;
    padding: clamp(10px, 1.6vw, 22px);
    pointer-events: none;
    position: absolute;
    transition: opacity 180ms ease, visibility 180ms ease;
    visibility: hidden;
    z-index: 12;
}

body.is-menu-open .chapter-menu {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.chapter-menu__content {
    color: var(--white);
    max-width: 960px;
    width: min(960px, 100%);
}

.chapter-menu__eyebrow {
    color: #56d7f3;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.chapter-menu h1 {
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1;
    margin: 0 0 10px;
}

.chapter-menu__grid {
    display: grid;
    gap: 5px 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chapter-card {
    align-items: stretch;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.66);
    border-radius: 7px 22px 22px 7px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
    color: #1d2a39;
    cursor: pointer;
    display: grid;
    font-family: inherit;
    grid-template-columns: 76px 1fr 20px;
    min-height: 52px;
    overflow: hidden;
    padding: 0;
    position: relative;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.chapter-card::after {
    background: var(--accent);
    content: "";
    grid-column: 3;
    grid-row: 1;
}

.chapter-card:hover,
.chapter-card:focus-visible {
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
    outline: 0;
    transform: translateX(5px);
}

.chapter-card.is-active {
    box-shadow: 0 0 0 2px rgba(86, 215, 243, 0.95), 0 14px 30px rgba(0, 0, 0, 0.34);
}

.chapter-card__number {
    align-items: center;
    border-right: 1px solid rgba(91, 103, 122, 0.28);
    color: #5e6876;
    display: inline-flex;
    font-size: 28px;
    font-weight: 800;
    justify-content: center;
    line-height: 1;
}

.chapter-card__body {
    align-items: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 8px 12px;
}

.chapter-card__body strong {
    display: block;
    font-size: 15px;
    line-height: 1.16;
}

.chapter-card__body small {
    color: #647084;
    display: block;
    font-size: 11px;
    line-height: 1.1;
    margin-top: 3px;
}

body.is-menu-open .book-band {
    opacity: 0;
    pointer-events: none;
}

.book-band {
    display: grid;
    gap: 0;
    height: 100%;
    margin: 0 auto;
    max-width: 100vw;
    position: relative;
    width: 100vw;
    z-index: 1;
}

.book-copy {
    display: none;
}

.book-copy p {
    color: var(--teal);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 7px;
    text-transform: uppercase;
}

.book-copy h1 {
    font-size: clamp(25px, 3.2vw, 46px);
    line-height: 1.02;
    margin: 0;
    max-width: 780px;
}

.book-frame {
    background: transparent;
    border: 0;
    border-radius: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    position: relative;
    width: 100%;
}

.portfolio-cover-shell {
    align-items: center;
    background:
        linear-gradient(90deg, rgba(3, 15, 35, 0.84), rgba(8, 44, 62, 0.58), rgba(3, 15, 35, 0.86)),
        url("../images/dentcyclopedia-menu-bg.jpg");
    background-position: center;
    background-size: cover;
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 1;
    padding: clamp(18px, 4vw, 44px);
    pointer-events: none;
    position: absolute;
    transition: opacity 260ms ease, visibility 260ms ease;
    visibility: visible;
    z-index: 8;
}

.portfolio-cover-shell.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.portfolio-cover-shell img {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
    display: block;
    height: auto;
    max-height: calc(100% - 84px);
    max-width: min(82vw, 980px);
    object-fit: contain;
    width: auto;
}

.portfolio-loader[hidden] {
    display: none;
}

.portfolio-loader {
    align-items: center;
    background:
        radial-gradient(circle at 50% 16%, rgba(86, 215, 243, 0.16), transparent 32%),
        linear-gradient(145deg, rgba(3, 15, 35, 0.58), rgba(8, 44, 62, 0.42));
    color: var(--white);
    display: flex;
    flex-direction: column;
    gap: 12px;
    inset: 0;
    justify-content: center;
    padding: 28px;
    pointer-events: none;
    position: absolute;
    text-align: center;
    transition: opacity 280ms ease, visibility 280ms ease;
    z-index: 80;
}

.portfolio-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.portfolio-loader__mark {
    align-items: center;
    background: var(--teal);
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    display: inline-flex;
    font-size: 18px;
    font-weight: 900;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.portfolio-loader__spinner {
    animation: loader-spin 900ms linear infinite;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: #56d7f3;
    border-radius: 50%;
    height: 42px;
    width: 42px;
}

.portfolio-loader strong {
    display: block;
    font-size: clamp(21px, 3.4vw, 34px);
    line-height: 1.1;
    min-height: 1.2em;
    transition: opacity 180ms ease, transform 180ms ease;
}

.portfolio-loader strong.is-changing {
    opacity: 0;
    transform: translateY(5px);
}

.portfolio-loader small {
    color: rgba(255, 255, 255, 0.68);
    font-size: 13px;
    font-weight: 800;
}

.swipe-coach[hidden] {
    display: none;
}

.swipe-coach {
    background: transparent;
    backdrop-filter: none;
    border: 1px solid rgba(86, 215, 243, 0.64);
    border-radius: 999px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
    color: #ffffff;
    display: block;
    height: clamp(70px, 6.4vw, 82px);
    left: 50%;
    min-width: 0;
    pointer-events: none;
    position: absolute;
    top: 30%;
    transform: translate(-50%, -50%);
    transition: opacity 240ms ease, transform 240ms ease;
    width: clamp(320px, 29vw, 400px);
    z-index: 38;
}

.swipe-coach.is-hiding {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(10px);
}

.swipe-coach__text {
    color: #ffffff;
    display: block;
    font-size: clamp(14px, 1.2vw, 16px);
    font-weight: 900;
    left: 50%;
    line-height: 1;
    position: absolute;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    z-index: 4;
}

.swipe-coach__track {
    background: linear-gradient(90deg, transparent, rgba(86, 215, 243, 0.96) 18%, rgba(86, 215, 243, 0.96) 82%, transparent);
    border-radius: 999px;
    display: block;
    height: 3px;
    left: 64px;
    opacity: 0.86;
    position: absolute;
    right: 64px;
    top: 21px;
}

.swipe-coach__arrow {
    border-bottom: 3px solid rgba(255, 255, 255, 0.92);
    border-left: 3px solid rgba(255, 255, 255, 0.92);
    height: 18px;
    opacity: 0.74;
    position: absolute;
    top: 29px;
    width: 18px;
}

.swipe-coach__arrow--left {
    left: 34px;
    transform: rotate(45deg);
}

.swipe-coach__arrow--right {
    right: 34px;
    transform: rotate(-135deg);
}

.swipe-coach__hand {
    animation: swipe-hand 1.9s ease-in-out infinite;
    background:
        radial-gradient(circle at 50% 28%, #ffffff 0 30%, rgba(255, 255, 255, 0) 31%),
        linear-gradient(#ffffff, #ffffff);
    background-position: center top, center bottom;
    background-repeat: no-repeat;
    background-size: 31px 31px, 10px 34px;
    border-radius: 999px;
    display: block;
    height: 62px;
    left: calc(50% - 21px);
    position: absolute;
    top: 17px;
    width: 42px;
    z-index: 3;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes swipe-hand {
    0%,
    100% {
        opacity: 0.55;
        transform: translateX(-76px) scale(0.92);
    }

    50% {
        opacity: 1;
        transform: translateX(76px) scale(1);
    }
}

#dental_book {
    height: 100%;
    min-height: 0;
    width: 100%;
}

.df-ui-wrapper,
.df-container {
    border-radius: 0;
}

#dental_book.df-container {
    background-color: transparent !important;
    background-image:
        linear-gradient(90deg, rgba(3, 15, 35, 0.88), rgba(9, 44, 64, 0.68), rgba(3, 15, 35, 0.9)),
        url("../images/dentcyclopedia-menu-bg.jpg") !important;
    background-position: center !important;
    background-size: cover !important;
    height: var(--viewer-height, calc(100vh - 72px)) !important;
    touch-action: pan-y pinch-zoom;
}

#dental_book .df-3dcanvas,
#dental_book canvas {
    max-width: 100% !important;
}

#dental_book .df-3dcanvas {
    bottom: auto !important;
    top: 0 !important;
}

#dental_book.df-fullscreen,
#dental_book .df-fullscreen {
    background-color: #07182d !important;
}

#dental_book .df-ui-alt,
#dental_book .df-book-side-buttons,
#dental_book > .df-ui-prev,
#dental_book > .df-ui-next {
    display: none !important;
}

#dental_book .df-ui-controls .df-ui-prev,
#dental_book .df-ui-controls .df-ui-next {
    display: block !important;
}

#dental_book .loading-info {
    display: none !important;
}

#dental_book.df-loading::before,
#dental_book.df-loading::after,
#dental_book.df-container.df-loading::before,
#dental_book.df-container.df-loading::after {
    display: none !important;
}

@media (hover: none) and (pointer: coarse), (max-width: 740px), (max-height: 560px) and (orientation: landscape) {
    .workspace {
        height: var(--viewer-height, calc(100dvh - 72px));
        min-height: 0;
        overflow: hidden;
    }

    .book-frame {
        align-items: center;
        display: grid;
        justify-items: center;
        overflow: visible;
    }

    #dental_book.df-container {
        height: var(--viewer-height, calc(100dvh - 72px)) !important;
        min-height: 240px !important;
        overflow: visible !important;
        padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
        touch-action: pan-y pinch-zoom;
        width: 100vw !important;
    }

    #dental_book .df-3dcanvas {
        bottom: auto !important;
        height: calc(100% - 56px - env(safe-area-inset-bottom, 0px)) !important;
        left: 50% !important;
        right: auto !important;
        top: 0 !important;
        transform: translateX(-50%) !important;
    }

    #dental_book .df-book-stage {
        padding: 0 4px calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    }

    #dental_book .df-ui-wrapper.df-ui-controls {
        -webkit-overflow-scrolling: touch;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        display: flex !important;
        gap: 0 !important;
        left: 50% !important;
        max-width: calc(100vw - 14px) !important;
        opacity: 1 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        position: absolute !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        transform-origin: bottom center !important;
        visibility: visible !important;
        white-space: nowrap !important;
        width: max-content !important;
        z-index: 140 !important;
    }

    #dental_book .df-ui-wrapper.df-ui-controls::-webkit-scrollbar {
        display: none;
    }

    #dental_book .df-ui-wrapper.df-ui-controls {
        scrollbar-width: none;
    }

    #dental_book .df-ui-wrapper.df-ui-controls .df-ui-btn {
        flex: 0 0 auto !important;
    }

    #dental_book .df-ui-wrapper.df-ui-controls .df-ui-page {
        flex: 0 0 auto !important;
        min-width: 64px !important;
    }
}

.fallback {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    margin: 14px 0 0;
    padding: 14px;
}

.site-footer {
    display: none;
}

@media (max-width: 740px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        min-height: 0;
        padding: 8px;
    }

    .top-actions {
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .top-actions::-webkit-scrollbar {
        display: none;
    }

    .top-actions a {
        flex: 0 0 auto;
        justify-content: center;
    }

    .top-actions button {
        flex: 0 0 auto;
        justify-content: center;
    }

    .top-actions a,
    .top-actions button,
    .resolution-toggle select {
        font-size: 12px;
        min-height: 36px;
        padding-inline: 11px;
    }

    .resolution-toggle__label {
        font-size: 11px;
        padding-inline: 9px;
    }

    .brand {
        gap: 9px;
        padding: 7px 8px;
    }

    .brand-mark {
        flex-basis: 38px;
        height: 38px;
    }

    .brand strong {
        font-size: 16px;
    }

    .page-mode-toggle {
        flex: 0 0 auto;
    }

    .resolution-toggle {
        flex: 0 0 auto;
    }

    .top-actions .page-mode-toggle button {
        flex: 1 1 50%;
        min-width: 0;
    }

    .resolution-toggle select {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
    }

    .password-modal {
        align-items: flex-start;
        overflow: auto;
        padding: 16px;
    }

    .password-modal__panel {
        margin-top: 18px;
        padding: 20px;
    }

    .password-form__actions {
        flex-direction: column-reverse;
    }

    .password-form__actions button {
        width: 100%;
    }

    .password-page {
        align-items: flex-start;
        min-height: calc(100svh - 72px);
        padding: 16px;
    }

    .password-page__actions {
        flex-direction: column-reverse;
    }

    .password-page__actions a,
    .password-page__actions button {
        width: 100%;
    }

    .workspace {
        padding: 0;
    }

    .workspace-actions {
        gap: 8px;
        right: 10px;
        top: 8px;
    }

    .workspace-button,
    .home-button {
        font-size: 12px;
        min-height: 34px;
        padding-inline: 13px;
    }

    .workspace-button--first {
        min-height: 34px;
        padding: 0 10px 0 3px;
    }

    .workspace-button__icon {
        flex-basis: 24px;
        height: 24px;
        width: 24px;
    }

    .chapter-menu {
        align-items: start;
        overflow: auto;
        padding: 62px 12px 18px;
    }

    .chapter-menu__content {
        width: 100%;
    }

    .chapter-menu h1 {
        font-size: 30px;
    }

    .chapter-menu__grid {
        gap: 8px;
        grid-template-columns: 1fr;
    }

    .chapter-card {
        grid-template-columns: 68px 1fr 18px;
        min-height: 58px;
    }

    .chapter-card__body strong {
        font-size: 15px;
    }

    .chapter-card__body small {
        font-size: 12px;
    }

    .book-copy {
        align-items: start;
        flex-direction: column;
    }

    .book-frame {
        min-height: 0;
        overflow: visible;
        padding: 0;
    }

    .portfolio-cover-shell {
        padding: 12px 12px 76px;
    }

    .portfolio-cover-shell img {
        max-height: calc(100% - 26px);
        max-width: calc(100vw - 26px);
    }

    #dental_book.df-container {
        height: var(--viewer-height, calc(100svh - 72px)) !important;
        min-height: 360px !important;
        overflow: visible !important;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }

    #dental_book .df-3dcanvas {
        height: calc(100% - 72px - env(safe-area-inset-bottom, 0px)) !important;
    }

    #dental_book .df-ui-wrapper.df-ui-controls {
        bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        display: flex !important;
        left: 50% !important;
        max-width: calc(100vw - 14px) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        position: absolute !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        transform-origin: bottom center !important;
        white-space: nowrap !important;
        z-index: 140 !important;
    }

    #dental_book .df-ui-wrapper.df-ui-controls::-webkit-scrollbar {
        display: none;
    }

    #dental_book .df-ui-wrapper.df-ui-controls {
        scrollbar-width: none;
    }

    #dental_book .df-ui-wrapper.df-ui-controls .df-ui-btn {
        flex: 0 0 auto !important;
        height: 44px !important;
        min-width: 39px !important;
        padding-block: 13px !important;
    }

    #dental_book .df-ui-wrapper.df-ui-controls .df-ui-page {
        min-width: 64px !important;
    }

    #dental_book .df-book-stage {
        padding: 18px 10px calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .swipe-coach {
        height: 64px;
        top: 39%;
        width: min(340px, calc(100vw - 42px));
    }

    .swipe-coach__text {
        font-size: 12px;
    }

    .swipe-coach__track {
        left: 54px;
        right: 54px;
        top: 18px;
    }

    .swipe-coach__arrow {
        height: 15px;
        top: 25px;
        width: 15px;
    }

    .swipe-coach__arrow--left {
        left: 28px;
    }

    .swipe-coach__arrow--right {
        right: 28px;
    }

    .swipe-coach__hand {
        background-size: 28px 28px, 9px 31px;
        height: 56px;
        left: calc(50% - 19px);
        top: 15px;
        width: 38px;
    }

    .portfolio-loader {
        padding: 22px;
    }

}

@media (max-width: 940px) and (max-height: 520px) and (orientation: landscape) {
    .topbar {
        align-items: center;
        flex-direction: row;
        gap: 8px;
        min-height: 0;
        padding: 6px 8px;
    }

    .brand {
        flex: 0 0 auto;
        gap: 8px;
        padding: 6px 7px;
    }

    .brand-mark {
        flex-basis: 34px;
        font-size: 13px;
        height: 34px;
        width: 34px;
    }

    .brand strong {
        font-size: 14px;
    }

    .top-actions {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        gap: 6px;
        justify-content: flex-start;
        min-width: 0;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .top-actions::-webkit-scrollbar {
        display: none;
    }

    .top-actions a,
    .top-actions button,
    .resolution-toggle select {
        flex: 0 0 auto;
        font-size: 11px;
        min-height: 34px;
        padding-inline: 10px;
    }

    .top-actions .page-mode-toggle button {
        min-width: 58px;
        padding-inline: 9px;
    }

    .resolution-toggle__label {
        display: none;
    }

    .resolution-toggle select {
        min-width: 76px;
        padding-right: 30px;
    }

    .workspace {
        height: var(--viewer-height, calc(100dvh - 56px));
        min-height: 0;
    }

    .workspace-actions {
        gap: 7px;
        right: 8px;
        top: 7px;
    }

    .workspace-button,
    .home-button {
        font-size: 11px;
        min-height: 31px;
        padding-inline: 11px;
    }

    .workspace-button--first {
        border-width: 2px;
        min-height: 31px;
        padding: 0 9px 0 3px;
    }

    .workspace-button__icon {
        flex-basis: 22px;
        height: 22px;
        width: 22px;
    }

    .workspace-button__icon::before,
    .workspace-button__icon::after {
        height: 7px;
        top: 6px;
        width: 7px;
    }

    .workspace-button__icon::before {
        left: 7px;
    }

    .workspace-button__icon::after {
        left: 11px;
    }

    .book-frame {
        align-items: center;
        display: grid;
        justify-items: center;
        overflow: visible;
    }

    .portfolio-cover-shell {
        padding: 4px 6px 48px;
    }

    .portfolio-cover-shell img {
        max-height: calc(100% - 4px);
        max-width: min(92vw, 780px);
    }

    #dental_book.df-container {
        height: var(--viewer-height, calc(100dvh - 56px)) !important;
        min-height: 0 !important;
        overflow: visible !important;
        padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)) !important;
        width: 100vw !important;
    }

    #dental_book .df-3dcanvas {
        bottom: auto !important;
        height: calc(100% - 38px - env(safe-area-inset-bottom, 0px)) !important;
        left: 50% !important;
        right: auto !important;
        top: 0 !important;
        transform: translateX(-50%) !important;
    }

    #dental_book .df-book-stage {
        padding: 0 2px calc(40px + env(safe-area-inset-bottom, 0px)) !important;
    }

    #dental_book .df-ui-wrapper.df-ui-controls {
        bottom: calc(4px + env(safe-area-inset-bottom, 0px)) !important;
        display: flex !important;
        left: 50% !important;
        max-width: calc(100vw - 12px) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        position: absolute !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) scale(0.86) !important;
        transform-origin: bottom center !important;
        white-space: nowrap !important;
        z-index: 145 !important;
    }

    #dental_book .df-ui-wrapper.df-ui-controls::-webkit-scrollbar {
        display: none;
    }

    #dental_book .df-ui-wrapper.df-ui-controls {
        scrollbar-width: none;
    }

    #dental_book .df-ui-wrapper.df-ui-controls .df-ui-btn {
        flex: 0 0 auto !important;
        height: 38px !important;
        min-width: 36px !important;
        padding-block: 10px !important;
    }

    #dental_book .df-ui-wrapper.df-ui-controls .df-ui-page {
        min-width: 58px !important;
    }

    body.is-custom-preview #dental_book.df-container {
        padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.is-custom-preview #dental_book .df-3dcanvas {
        height: calc(100% - 38px - env(safe-area-inset-bottom, 0px)) !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    body.is-custom-preview #dental_book .df-book-stage {
        padding: calc(38px + env(safe-area-inset-top, 0px)) 2px calc(40px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.is-custom-preview #dental_book .df-ui-wrapper.df-ui-controls {
        bottom: calc(4px + env(safe-area-inset-bottom, 0px)) !important;
        transform: translateX(-50%) scale(0.86) !important;
    }

    .chapter-menu {
        align-items: flex-start;
        overflow: auto;
        padding: 10px 12px;
    }

    .chapter-menu__content {
        max-width: none;
    }

    .chapter-menu__eyebrow {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .chapter-menu h1 {
        font-size: 22px;
        margin-bottom: 7px;
    }

    .chapter-menu__grid {
        gap: 6px 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chapter-card {
        grid-template-columns: 46px 1fr 12px;
        min-height: 42px;
    }

    .chapter-card__number {
        font-size: 20px;
    }

    .chapter-card__body {
        padding: 6px 8px;
    }

    .chapter-card__body strong {
        font-size: 12px;
        line-height: 1.12;
    }

    .chapter-card__body small {
        display: none;
    }

    .portfolio-loader {
        gap: 8px;
        padding: 14px;
    }

    .portfolio-loader__mark {
        border-radius: 9px;
        font-size: 14px;
        height: 40px;
        width: 40px;
    }

    .portfolio-loader__spinner {
        height: 32px;
        width: 32px;
    }

    .portfolio-loader strong {
        font-size: 21px;
    }

    .portfolio-loader small {
        font-size: 11px;
    }

    .swipe-coach {
        height: 54px;
        top: 38%;
        width: min(300px, calc(100vw - 38px));
    }

    .swipe-coach__text {
        font-size: 12px;
    }

    .swipe-coach__track {
        left: 48px;
        right: 48px;
        top: 16px;
    }

    .swipe-coach__arrow {
        height: 13px;
        top: 22px;
        width: 13px;
    }

    .swipe-coach__arrow--left {
        left: 24px;
    }

    .swipe-coach__arrow--right {
        right: 24px;
    }

    .swipe-coach__hand {
        background-size: 24px 24px, 8px 28px;
        height: 48px;
        left: calc(50% - 17px);
        top: 13px;
        width: 34px;
    }

}

@media (prefers-reduced-motion: reduce) {
    .portfolio-loader__spinner,
    .swipe-coach__hand {
        animation: none;
    }
}
