/* Web reader UI. Brand colors follow style.css (#6C5DD3 / #11142D). */
:root {
    --rd-brand: #6C5DD3;
    --rd-brand-dark: #5546c2;
    --rd-brand-soft: #F0EEFF;
    --rd-brand-soft-2: #E4E0FD;
    --rd-ink: #11142D;
    --rd-muted: #6B6F86;
    --rd-faint: #9A9DB0;
    --rd-bg: #F4F4F8;
    --rd-surface: #FFFFFF;
    --rd-surface-2: #F7F7FB;
    --rd-border: #E8E8F0;
    --rd-amber: #F59E0B;
    --rd-amber-soft: #FEF3C7;
    --rd-green: #16A34A;
    --rd-green-soft: #DCFCE7;
    --rd-violet-soft: #EDE9FE;
    --rd-danger: #DC2626;
    --rd-shadow: 0 1px 2px rgba(17, 20, 45, .06), 0 4px 16px rgba(17, 20, 45, .06);
    --rd-shadow-lg: 0 12px 40px rgba(17, 20, 45, .18);
    --rd-radius: 12px;
    --rd-top: 67px; /* bar 64 + progress 3 */
}

@media (max-width: 991px) {
    :root {
        --rd-top: 107px; /* two rows on tablets and phones: 56 + 48 + 3 */
    }
}

body {
    background: var(--rd-bg);
    color: var(--rd-ink);
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    overflow: hidden;
}

button {
    font-family: inherit;
}

/* ---------------------------------------------------------------- top bar */

.rd-top {
    position: relative;
    z-index: 35;
    background: var(--rd-surface);
    box-shadow: 0 1px 0 var(--rd-border), 0 2px 12px rgba(17, 20, 45, .04);
}

.rd-top__row {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
}

.rd-back {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--rd-ink);
    background: var(--rd-surface-2);
    text-decoration: none;
    transition: background .15s, color .15s;
}

.rd-back:hover {
    background: var(--rd-brand-soft);
    color: var(--rd-brand);
}

.rd-logo img {
    width: 34px;
    height: 34px;
    display: block;
    border-radius: 8px;
}

.rd-title {
    flex: 1 1 auto;
    min-width: 0;
}

.rd-title h1 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--rd-ink);
}

.rd-title p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--rd-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rd-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* table of contents chip */
.rd-chip {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--rd-border);
    border-radius: 10px;
    background: var(--rd-surface);
    color: var(--rd-ink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.rd-chip:hover,
.rd-panel-open .rd-chip {
    border-color: var(--rd-brand);
    color: var(--rd-brand);
    background: var(--rd-brand-soft);
}

/* page navigator */
.rd-nav {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0 4px;
    background: var(--rd-surface-2);
    border: 1px solid var(--rd-border);
    border-radius: 10px;
}

.rd-nav__page {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 2px;
    font-size: 13px;
    color: var(--rd-muted);
    cursor: text;
}

.rd-nav input {
    width: 48px;
    height: 28px;
    border: 1px solid var(--rd-border);
    border-radius: 6px;
    background: var(--rd-surface);
    color: var(--rd-ink);
    text-align: center;
    font: 600 13px/1 inherit;
    -moz-appearance: textfield;
    outline: none;
}

.rd-nav input:focus {
    border-color: var(--rd-brand);
    box-shadow: 0 0 0 3px rgba(108, 93, 211, .15);
}

.rd-nav input::-webkit-outer-spin-button,
.rd-nav input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rd-nav__total {
    white-space: nowrap;
}

.rd-percent {
    min-width: 42px;
    height: 24px;
    margin-left: 4px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--rd-brand-soft);
    color: var(--rd-brand);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* reading mode segmented control */
.rd-seg {
    height: 40px;
    display: inline-flex;
    padding: 3px;
    background: var(--rd-surface-2);
    border: 1px solid var(--rd-border);
    border-radius: 10px;
}

.rd-seg button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--rd-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}

.rd-seg button:hover {
    color: var(--rd-ink);
}

.rd-seg button.active {
    background: var(--rd-surface);
    color: var(--rd-brand);
    box-shadow: 0 1px 3px rgba(17, 20, 45, .12);
}

/* icon tools */
.rd-tools {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rd-tools__group {
    display: inline-flex;
    gap: 4px;
}

.rd-sep {
    width: 1px;
    height: 24px;
    margin: 0 4px;
    background: var(--rd-border);
}

.rd-ibtn {
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--rd-muted);
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s, transform .1s;
}

.rd-ibtn:hover {
    background: var(--rd-surface-2);
    color: var(--rd-ink);
}

.rd-ibtn:active {
    transform: scale(.94);
}

.rd-ibtn--sm {
    width: 30px;
    height: 30px;
    font-size: 12px;
    border-radius: 8px;
}

.rd-ibtn--amber.on {
    background: var(--rd-amber-soft);
    color: var(--rd-amber);
}

.rd-ibtn--green.on {
    background: var(--rd-green-soft);
    color: var(--rd-green);
}

.rd-ibtn--violet.on {
    background: var(--rd-violet-soft);
    color: var(--rd-brand);
}

/* tooltips */
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, -4px);
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--rd-ink);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s, transform .15s;
    z-index: 70;
}

.rd-back[data-tip] {
    position: relative;
}

@media (hover: hover) {
    [data-tip]:hover::after {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.rd-download {
    height: 40px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--rd-brand);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, box-shadow .15s;
}

.rd-download:hover {
    background: var(--rd-brand-dark);
    color: #fff;
    box-shadow: 0 4px 14px rgba(108, 93, 211, .35);
}

.rd-progress {
    height: 3px;
    background: var(--rd-brand-soft);
}

.rd-progress__bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--rd-brand), #9B8CFF);
    border-radius: 0 3px 3px 0;
    transition: width .35s ease;
}

.rd-mode-flip .rd-scroll-only,
.rd-mode-scroll .rd-flip-only {
    display: none !important;
}

/* tablets and phones: controls go to a second, scrollable row */
@media (max-width: 991px) {
    .rd-top__row {
        height: auto;
        flex-wrap: wrap;
        row-gap: 0;
        padding: 0;
    }

    .rd-back {
        margin-left: 12px;
    }

    .rd-back,
    .rd-logo,
    .rd-title,
    .rd-download {
        margin-top: 8px;
        margin-bottom: 8px;
    }

    .rd-download {
        margin-right: 12px;
    }

    .rd-title {
        flex: 1 1 0;
    }

    .rd-controls {
        order: 10;
        width: 100%;
        height: 48px;
        padding: 0 12px;
        gap: 8px;
        border-top: 1px solid var(--rd-border);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .rd-controls::-webkit-scrollbar {
        display: none;
    }

    .rd-chip,
    .rd-nav,
    .rd-seg {
        height: 36px;
    }

    .rd-ibtn {
        width: 36px;
        height: 36px;
    }

    [data-tip]::after {
        display: none;
    }
}

@media (max-width: 575px) {
    .rd-logo,
    .rd-download__label,
    .rd-chip span:last-child,
    .rd-seg button span:last-child {
        display: none;
    }

    .rd-download {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .rd-chip {
        padding: 0 11px;
    }

    .rd-seg button {
        padding: 0 11px;
    }
}

/* ---------------------------------------------------------------- viewers */

.flip-book-container,
.rd-scroll {
    display: none;
    height: calc(100vh - var(--rd-top));
    height: calc(100dvh - var(--rd-top));
    position: relative;
}

.flip-book-container.active {
    display: block;
}

.rd-scroll.active {
    display: block;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.rd-pages-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 12px 40px;
    min-width: min-content;
}

.rd-page {
    position: relative;
    background: #fff;
    border-radius: 4px;
    box-shadow: var(--rd-shadow);
    flex-shrink: 0;
    overflow: hidden;
}

.rd-page canvas {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
}

.rd-page__num {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D4D4DE;
    font-size: 28px;
    font-weight: 600;
}

.rd-page.ready .rd-page__num {
    display: none;
}

/* pdf.js text layer */
.textLayer {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    opacity: .3;
    line-height: 1;
    z-index: 2;
}

.textLayer > span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0 0;
}

.textLayer ::selection {
    background: #5B4BD6;
}

.rd-hl-layer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.rd-hl {
    position: absolute;
    mix-blend-mode: multiply;
    border-radius: 2px;
}

.rd-hl--yellow { background: rgba(253, 224, 71, .55); }
.rd-hl--green  { background: rgba(134, 239, 172, .6); }
.rd-hl--blue   { background: rgba(147, 197, 253, .6); }
.rd-hl--pink   { background: rgba(249, 168, 212, .6); }

.rd-hl.has-note {
    box-shadow: inset 0 -2px 0 rgba(17, 20, 45, .55);
}

/* ---------------------------------------------------------------- side panel */

.rd-panel {
    position: fixed;
    top: calc(var(--rd-top) + 12px);
    left: 12px;
    bottom: 12px;
    width: 360px;
    max-width: calc(100vw - 24px);
    background: var(--rd-surface);
    color: var(--rd-ink);
    border-radius: 16px;
    box-shadow: var(--rd-shadow-lg);
    z-index: 30;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-16px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.rd-panel.open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.rd-backdrop {
    display: none;
    position: fixed;
    top: var(--rd-top);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 20, 45, .35);
    z-index: 29;
}

@media (max-width: 991px) {
    .rd-backdrop.show {
        display: block;
    }

    .rd-panel {
        top: var(--rd-top);
        left: 0;
        bottom: 0;
        border-radius: 0 16px 16px 0;
        max-width: 88vw;
    }
}

.rd-panel__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 10px 6px 18px;
}

.rd-panel__title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rd-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin: 6px 12px 0;
    padding: 4px;
    background: var(--rd-surface-2);
    border-radius: 12px;
}

.rd-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 2px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--rd-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.rd-tab .fa {
    font-size: 15px;
}

.rd-tab:hover {
    color: var(--rd-ink);
}

.rd-tab.active {
    background: var(--rd-surface);
    color: var(--rd-brand);
    box-shadow: 0 1px 3px rgba(17, 20, 45, .1);
}

.rd-count {
    position: absolute;
    top: 4px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--rd-brand);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.rd-count:empty {
    display: none;
}

.rd-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 16px;
}

.rd-pane {
    display: none;
}

.rd-pane.active {
    display: block;
}

.rd-muted {
    color: var(--rd-muted);
    font-size: 13px;
    padding: 6px 4px;
}

.rd-empty {
    text-align: center;
    padding: 36px 16px;
    color: var(--rd-faint);
}

.rd-empty .fa {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--rd-brand-soft);
    color: var(--rd-brand);
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.rd-empty p {
    margin: 0;
    font-size: 13px;
    color: var(--rd-muted);
}

.rd-hint {
    display: flex;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.45;
    background: var(--rd-brand-soft);
    color: var(--rd-ink);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

.rd-search {
    position: relative;
    margin-bottom: 10px;
}

.rd-search .fa {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rd-faint);
    font-size: 14px;
}

.rd-search input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--rd-border);
    border-radius: 10px;
    padding: 0 12px 0 38px;
    font: inherit;
    font-size: 14px;
    background: var(--rd-surface-2);
    color: var(--rd-ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.rd-search input:focus {
    background: var(--rd-surface);
    border-color: var(--rd-brand);
    box-shadow: 0 0 0 3px rgba(108, 93, 211, .15);
}

.rd-toc,
.rd-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rd-toc ul {
    padding-left: 14px;
    border-left: 1px solid var(--rd-border);
    margin-left: 10px;
}

.rd-toc__link {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 9px 10px;
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--rd-ink);
    cursor: pointer;
    border-radius: 8px;
}

.rd-toc__link:hover {
    background: var(--rd-brand-soft);
    color: var(--rd-brand);
}

/* list items: bookmarks, highlights, search results */
.rd-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    margin-bottom: 8px;
    padding: 4px;
    background: var(--rd-surface);
    border: 1px solid var(--rd-border);
    border-radius: 12px;
    transition: border-color .15s, box-shadow .15s;
}

.rd-item:hover {
    border-color: var(--rd-brand-soft-2);
    box-shadow: var(--rd-shadow);
}

.rd-item--hl {
    border-left-width: 4px;
}

.rd-item--yellow { border-left-color: #FACC15; }
.rd-item--green  { border-left-color: #4ADE80; }
.rd-item--blue   { border-left-color: #60A5FA; }
.rd-item--pink   { border-left-color: #F472B6; }

.rd-item__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
    background: none;
    border: 0;
    padding: 8px 8px;
    cursor: pointer;
    color: var(--rd-ink);
    font-size: 13.5px;
    line-height: 1.45;
}

button.rd-item.rd-item__main {
    padding: 10px 12px;
}

.rd-item__page {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--rd-brand-soft);
    color: var(--rd-brand);
    font-size: 11px;
    font-weight: 700;
}

.rd-item__text,
.rd-item__quote {
    overflow-wrap: anywhere;
}

.rd-item__text {
    color: var(--rd-muted);
    font-size: 12.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rd-item__quote mark {
    background: #FDE68A;
    color: var(--rd-ink);
    border-radius: 3px;
    padding: 0 2px;
}

.rd-item__note {
    display: flex;
    gap: 6px;
    font-size: 12.5px;
    color: var(--rd-muted);
    background: var(--rd-surface-2);
    border-radius: 8px;
    padding: 6px 8px;
}

.rd-item__note::before {
    content: "\f040";
    font-family: FontAwesome;
    color: var(--rd-faint);
}

.rd-item__acts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 2px;
}

.rd-item .rd-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rd-faint);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.rd-item .rd-btn:hover {
    background: var(--rd-surface-2);
    color: var(--rd-ink);
}

.rd-item .rd-btn .fa-trash:hover,
.rd-item .rd-btn:hover .fa-trash {
    color: var(--rd-danger);
}

/* ---------------------------------------------------------------- selection popup */

.rd-popup {
    position: fixed;
    z-index: 40;
    display: none;
    align-items: center;
    gap: 2px;
    background: var(--rd-surface);
    color: var(--rd-ink);
    border: 1px solid var(--rd-border);
    border-radius: 14px;
    padding: 6px;
    box-shadow: var(--rd-shadow-lg);
}

.rd-popup.show {
    display: flex;
    animation: rd-pop .14s ease-out;
}

@keyframes rd-pop {
    from {
        opacity: 0;
        transform: translateY(4px) scale(.98);
    }
}

.rd-popup [data-pop="delete"] {
    display: none;
}

.rd-popup.existing [data-pop="delete"] {
    display: inline-flex;
}

.rd-popup__colors {
    display: flex;
    gap: 6px;
    padding: 0 10px 0 6px;
    margin-right: 2px;
    border-right: 1px solid var(--rd-border);
}

.rd-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(17, 20, 45, .15);
    cursor: pointer;
    padding: 0;
    transition: transform .12s;
}

.rd-color:hover {
    transform: scale(1.15);
}

.rd-color[data-color="yellow"] { background: #FACC15; }
.rd-color[data-color="green"]  { background: #4ADE80; }
.rd-color[data-color="blue"]   { background: #60A5FA; }
.rd-color[data-color="pink"]   { background: #F472B6; }

.rd-pbtn {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--rd-ink);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.rd-pbtn .fa {
    color: var(--rd-muted);
    font-size: 14px;
}

.rd-pbtn:hover {
    background: var(--rd-brand-soft);
    color: var(--rd-brand);
}

.rd-pbtn:hover .fa {
    color: var(--rd-brand);
}

.rd-pbtn [class*="fa-telegram"] {
    color: #229ED9;
}

.rd-pbtn--danger:hover,
.rd-pbtn--danger:hover .fa {
    background: #FEE2E2;
    color: var(--rd-danger);
}

@media (max-width: 575px) {
    .rd-pbtn span:last-child {
        display: none;
    }

    .rd-pbtn {
        padding: 0 9px;
    }
}

/* ---------------------------------------------------------------- buttons, modal */

.rd-b {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}

.rd-b--primary {
    border: 0;
    background: var(--rd-brand);
    color: #fff;
}

.rd-b--primary:hover {
    background: var(--rd-brand-dark);
}

.rd-b--ghost {
    border: 1px solid var(--rd-border);
    background: var(--rd-surface);
    color: var(--rd-ink);
}

.rd-b--ghost:hover {
    border-color: var(--rd-faint);
}

.rd-modal {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 20, 45, .45);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.rd-modal.show {
    display: flex;
}

.rd-modal__box {
    background: var(--rd-surface);
    color: var(--rd-ink);
    border-radius: 18px;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    box-shadow: var(--rd-shadow-lg);
    animation: rd-pop .16s ease-out;
}

.rd-modal__head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
}

.rd-modal__head .fa {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--rd-brand-soft);
    color: var(--rd-brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.rd-modal__quote {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--rd-muted);
    background: var(--rd-surface-2);
    border-left: 3px solid #FACC15;
    border-radius: 0 10px 10px 0;
    padding: 10px 12px;
    margin-bottom: 12px;
    max-height: 120px;
    overflow: auto;
}

.rd-modal textarea {
    width: 100%;
    border: 1px solid var(--rd-border);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    background: var(--rd-surface);
    color: var(--rd-ink);
    resize: vertical;
    outline: none;
}

.rd-modal textarea:focus {
    border-color: var(--rd-brand);
    box-shadow: 0 0 0 3px rgba(108, 93, 211, .15);
}

.rd-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

/* ---------------------------------------------------------------- resume card, toast */

.rd-resume {
    position: fixed;
    top: calc(var(--rd-top) + 16px);
    left: 50%;
    z-index: 45;
    width: min(520px, calc(100vw - 24px));
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 14px 14px 16px;
    background: var(--rd-surface);
    color: var(--rd-ink);
    border: 1px solid var(--rd-border);
    border-radius: 16px;
    box-shadow: var(--rd-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -10px);
    transition: opacity .2s, transform .2s, visibility .2s;
}

.rd-resume.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.rd-resume__icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--rd-brand-soft);
    color: var(--rd-brand);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rd-resume__body {
    flex: 1;
    min-width: 0;
}

.rd-resume__title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.rd-resume__meter {
    height: 6px;
    border-radius: 999px;
    background: var(--rd-brand-soft);
    overflow: hidden;
}

.rd-resume__meter span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--rd-brand), #9B8CFF);
}

.rd-resume__acts {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

@media (max-width: 575px) {
    .rd-resume {
        flex-wrap: wrap;
    }

    .rd-resume__body {
        flex-basis: calc(100% - 60px);
    }

    .rd-resume__acts {
        width: 100%;
    }

    .rd-resume__acts .rd-b {
        flex: 1;
    }
}

.rd-toast {
    position: fixed;
    top: calc(var(--rd-top) + 16px);
    left: 50%;
    transform: translate(-50%, -10px);
    background: var(--rd-ink);
    color: #fff;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: calc(100vw - 32px);
    box-shadow: var(--rd-shadow-lg);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}

.rd-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.rd-toast__btn {
    background: var(--rd-brand);
    border: 0;
    color: #fff;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

/* ---------------------------------------------------------------- night mode */

body.rd-night {
    --rd-ink: #ECECF4;
    --rd-muted: #A3A6BA;
    --rd-faint: #74778C;
    --rd-bg: #0F1020;
    --rd-surface: #1A1B2E;
    --rd-surface-2: #23243A;
    --rd-border: #2E3050;
    --rd-brand-soft: rgba(108, 93, 211, .18);
    --rd-brand-soft-2: rgba(108, 93, 211, .35);
    --rd-amber-soft: rgba(245, 158, 11, .16);
    --rd-green-soft: rgba(22, 163, 74, .18);
    --rd-violet-soft: rgba(108, 93, 211, .22);
    --rd-brand: #9B8CFF;
}

body.rd-night .rd-page {
    background: #1A1B2E;
}

body.rd-night .rd-page canvas {
    filter: invert(.9) hue-rotate(180deg);
}

body.rd-night .rd-hl {
    mix-blend-mode: screen;
    opacity: .55;
}

body.rd-night .rd-download,
body.rd-night .rd-b--primary,
body.rd-night .rd-toast__btn,
body.rd-night .rd-count {
    background: #6C5DD3;
}

body.rd-night .rd-toast {
    background: #2E3050;
}

body.rd-night .flip-book-container {
    background: var(--rd-bg);
}
