/* no IE11, no safari 9 or less, yes chrome 50+, yes firefox 50+, yes opera 40+, yes android 4.4+ */

* {
    box-sizing: border-box;
    font-family: "Roboto", sans-serif;
}

.app {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
}

.button {
    display: inline-block;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: 5px;
    outline: 0;
    text-align: inherit;
    margin: 0;
    padding: 0;
    line-height: 1;
    font-weight: inherit;
    text-decoration: none;
    vertical-align: middle;
}

.button::-moz-focus-inner {
    border: 0;
    padding: 0;
}

.button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.button:active {
    background: rgba(0, 0, 0, 0.1);
}

.app .bar {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    height: 44px;
    line-height: 44px;
    padding: 0 10px;
    transition: opacity 0.3s ease;
}

.app .bar>div {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
}

.app .bar .title {
    display: flex;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0px;
    flex: 1;
    text-align: center;
}

.app .book {
    -webkit-flex: 1;
    flex: 1;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: stretch;
    justify-content: stretch;
}

.app .book>div {
    -webkit-flex: 1;
    flex: 1;
    height: 100%;
    width: 100%;
}

.app .book .empty-wrapper {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: flex-start;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.app .book .empty-wrapper .empty {
    display: block;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    text-align: center;
    padding-top: 60px;
}

.app .book .empty-wrapper .empty .app-name {
    display: block;
    font-size: 40px;
    font-weight: 300;
    margin-bottom: 20px;
}

.app .book .empty-wrapper .empty .big-button,
.app .book .empty-wrapper .empty .big-button:link,
.app .book .empty-wrapper .empty .big-button:visited {
    display: inline-block;
    width: 150px;
    max-width: 100%;
    font-size: 20px;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    margin: auto;
    color: inherit;
    text-decoration: none;
    margin: 20px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.app .book .empty-wrapper .empty .big-button:hover,
.app .book .empty-wrapper .empty .big-button:active {
    background: rgba(0, 0, 0, 0.1);
}

.app .book .empty-wrapper .empty .big-button:active {
    border: 1px solid rgba(0, 0, 0, 0.2);
}


.app .book .empty-wrapper .empty .message {
    display: block;
    max-width: 400px;
    margin: 0 auto;
}

.app .dictionary-wrapper {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: center;
    justify-content: center;
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 200px;
    max-height: 50%;
    min-height: 150px;
    z-index: 500;
}

.app .dictionary-wrapper .dictionary {
    flex: 0 0 auto;
}

.app .dictionary {
    background: #fff;
    color: #000;
    box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, .15);
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    max-width: 450px;
    overflow-y: auto;
    overflow-x: hidden;
}

.app .dictionary .definition {
    display: block;
    padding: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.app .dictionary .definition:last-child {
    border-bottom: none;
}

.app .dictionary .definition .word {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
}

.app .dictionary .definition .info {
    display: block;
    margin-bottom: 8px;
    font-style: italic;
}

.app .dictionary .definition .meanings {
    display: block;
}

.app .dictionary .definition .meaning {
    display: block;
    margin-bottom: 8px;
    text-indent: 10px;
}

.app .dictionary .definition .meaning:first-line {
    margin-left: -10px;
}

.app .dictionary .definition .meaning .text {
    display: block;
    margin-bottom: 2px;
}

.app .dictionary .definition .meaning .example {
    display: block;
    font-style: italic;
}

.app .dictionary .definition .note {
    display: block;
    font-style: italic;
}

.app .dictionary .definition .credit {
    display: block;
    margin-top: 4px;
    font-style: italic;
    font-size: 12px;
}

.app .sidebar {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 90%;
    max-width: 300px;
    background: #fff;
    color: #000;
    z-index: 1001;
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .2);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.app .sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /*background: rgba(0, 0, 0, 0.54);*/
    z-index: 1000;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    will-change: background-color;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.app .sidebar-wrapper .sidebar {
    cursor: default;
}

.app .sidebar-wrapper,
.app .sidebar-wrapper .sidebar {
    will-change: transform, box-shadow;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.app .sidebar-wrapper.out {
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
}

.app .sidebar-wrapper.out .sidebar {
    -webkit-transform: translateX(100%);
    transform: translateX(100%);
    box-shadow: none;
}

.app .sidebar .tab-list {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    -webkit-align-items: flex-end;
    align-items: flex-end;
    border-bottom: 1px solid #ddd;
    background: #fff;
    box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, .15);
    z-index: 1000;
}

.app .sidebar .tab-list .item,
.app .sidebar .tab-list .item:link,
.app .sidebar .tab-list .item:visited {
    -webkit-flex: 1;
    font-size: 20px;
    flex: 1;
    display: block;
    color: inherit;
    text-align: center;
    text-decoration: none;
    outline: 0;
    line-height: 50px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    transition: background .1s cubic-bezier(0.23, 1, 0.32, 1), color .15s cubic-bezier(0.23, 1, 0.32, 1), border .15s cubic-bezier(0.23, 1, 0.32, 1);
}

.app .sidebar .tab-list .item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.app .sidebar .tab-list .item:active {
    background: rgba(0, 0, 0, 0.1);
}

.app .sidebar .tab-list .item.active {
    color: #8a4d4d;
    border-bottom: 2px solid #8a4d4d;

}

.app .sidebar .tab-list .item .icon {
    display: inline-block;
    vertical-align: middle;
}

.app .sidebar .tab-container {
    -webkit-flex: 1;
    flex: 1;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    background: #ffffff;
}

.app .sidebar .toc-list {
    display: block;
    padding-top: 10px;
}

.app .sidebar .toc-list .item,
.app .sidebar .toc-list .item:link,
.app .sidebar .toc-list .item:visited {
    display: block;
    text-decoration: none;
    color: inherit;
    outline: 0;

    font-size: 17px;
    line-height: 32px;
    padding: 0 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.app .sidebar .toc-list .item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.app .sidebar .toc-list .item.active {
    color: #807979;
    background: #80797936;
}

.app .sidebar .search-bar {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-align-items: stretch;
    align-items: center;
    -webkit-justify-content: flex-start;
    justify-content: center;
    background: #fff;
    margin: 8px;
    height: 40px;
    border-radius: 20px;
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .15);
    border: 1px solid #ddd;
}

.app .sidebar .search-bar .search-box {
    -webkit-flex: 1;
    flex: 1;
    margin: 0;
    color: inherit;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: inherit;
    min-width: 50px;
    padding-left: 18px;
    border-top-left-radius: inherit;
    border-bottom-left-radius: inherit;
    outline: 0;
}

.app .sidebar .search-bar .search-button {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    font-size: inherit;
    padding: 4px;
    border-top-right-radius: inherit;
    border-bottom-right-radius: inherit;
    outline: 0;
    border-left: 1px solid #ddd;
    width: 32px;
    text-align: center;
    cursor: pointer;
    background-color: transparent;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}

.app .sidebar .search-bar .search-button:hover {
    background-color: transparent;
}

.app .sidebar .search-bar .search-button .icon {
    vertical-align: middle;
}

.app .sidebar .search-results {
    display: block;
}

.app .sidebar .search-results .item,
.app .sidebar .search-results .item:link,
.app .sidebar .search-results .item:visited {
    display: block;
    text-decoration: none;
    color: inherit;
    outline: 0;
    line-height: 1.3;
    background: #fff;
    margin: 8px;
    border-radius: 4px;
    border: 1px solid #4f3f3f3d;
    font-size: 14px;
    box-shadow: 0px 0px 14px 0px #8a4d4d1f;
}

.app .sidebar .search-results .item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.app .sidebar .search-results .item .text {
    display: block;
    padding: 4px;
}

.app .sidebar .search-results .item .pbar {
    background: #ddd;
}

.app .sidebar .search-results .item .pbar .pbar-inner {
    height: 1px;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

.app .sidebar .info {
    display: block;
}

.app .sidebar .info .cover-wrapper {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    margin: 24px auto;
    width: 80%;
    border-radius: 4px;
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, .15);
}

.app .sidebar .info .cover-wrapper .cover {
    flex: 0 0 auto;
    -webkit-flex: 0 0 auto;
    display: block;
    width: 100%;
    border-radius: inherit;
}

.app .sidebar .info .title {
    display: block;
    text-align: center;
    font-size: 18px;
    margin-top: 8px;
    font-weight: bold;
}

.app .sidebar .info .series-info {
    display: block;
    text-align: center;
    font-size: 16px;
    margin-top: 4px;
}

.app .sidebar .info .author {
    display: block;
    text-align: center;
    font-size: 14px;
    margin-top: 4px;
}

.app .sidebar .info .description {
    display: block;
    text-align: justify;
    margin: 12px auto;
    padding-top: 12px;
    border-top: 1px solid #ccc;
    max-width: 80%;
    width: 100%;
    line-height: 1.6;
}

.app .sidebar .setting {
    display: block;
    padding: 8px 12px;
    background-color: #ffffff;
    border-bottom: 1px solid #bc8f8f5c;
}

.app .sidebar .setting .setting-label {
    display: block;
    font-size: 1.5em;
    /*font-weight: bold;*/
    margin-bottom: 10px;
}

.app .sidebar .settings .setting-content {
    display: block;
}

.app .sidebar .settings .chips {
    display: block;
}

.app .sidebar .settings .chips .chip {
    display: inline-block;
    vertical-align: middle;
    border-radius: 7px;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.15);
    text-align: center;
    margin: 4px;
    padding: 4px 8px;
}

.app .sidebar .settings .chips .chip:hover,
.app .sidebar .settings .chips .chip.active {
    outline: 1px solid rgb(7 6 6 / 98%);
    background: transparent;
    box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.15);
}

.app .sidebar,
.app .sidebar-wrapper,
.app .top-bar,
.app .bottom-bar {
    -ms-user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    user-select: none;
}

.app .error {
    display: block;
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    padding: 28px 32px;
}

.app .error .error-title {
    display: block;
    margin-bottom: 16px;
    color: red;
    font-weight: 300;
    font-size: 32px;
    line-height: 1;
}

.app .error .error-description,
.app .error .error-info {
    display: block;
    margin-bottom: 8px;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.4;
}

.app .error .error-dump {
    display: block;
    background: rgba(0, 0, 0, 0.1);
    margin-top: 16px;
    padding: 8px;
    border-radius: 5px;
    font-family: monospace;
    word-wrap: break-word;
    word-break: break-all;
    font-size: 12px;
}

@media only screen and (max-width: 950px) {
    .app .bar {
        height: 52px;
        line-height: 36px;
        padding: 0 4px;
    }
}

@media only screen and (max-width: 450px) {
    .app .bar .title {
        display: none !important;
    }
}

.app .hidden {
    display: none !important;
}

.open-icon {
    display: block;
    background-image: url(assets/open.png);
    background-size: contain;
    background-repeat: no-repeat;
    width: 35px;
    height: 35px;
}

.menu-icon {
    display: block;
    background-image: url(assets/menu.png);
    background-size: contain;
    background-repeat: no-repeat;
    width: 35px;
    height: 35px;
}

.book-title {
    font-size: 18px;
}


.book-author {
    font-size: 18px;
}

.donwnload-link {
    display: inline-block;
    background-image: url(assets/download.svg);
    padding-bottom: 45px;
    background-size: contain;
    background-repeat: no-repeat;
    width: 35px;
    height: 35px;
    margin-left: 10px;
    cursor: pointer;
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* High z-index to cover everything else */
}

.hidden {
    display: none;
}

.loader {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader-spinner {
    border: 8px solid #f3f3f3;
    /* Light grey */
    border-top: 8px solid #807979;
    /* Blue */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader-text {
    color: black;
    margin-top: 20px;
    font-size: 16px;
}

.progress-bar {
    width: 80%;
    height: 20px;
    background-color: #ccc;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-bar-fill {
    height: 100%;
    background-color: #807979;
    width: 0%;
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

.open-big-button {
    cursor: pointer;
}

.tab-list {
    height: 50px;
}

.open-menu-button {
    margin-left: 2px;
    font-size: 14px;
}

.open-button {
    display: flex;
    align-items: center;
}

/*material ui*/
/* CSS */
/* CSS */
.open-button {
    display: inline-block;
    width: 116px;
    max-width: 100%;
    font-size: 20px;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    margin: 20px auto;
    color: inherit;
    text-decoration: none;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.open-button:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.open-button:focus-visible {
    outline: none;
}

.open-icon {
    display: inline-block;
    background-image: url(assets/open.png);
    /* Замените на путь к вашей иконке */
    background-size: contain;
    background-repeat: no-repeat;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
    /* Расстояние между иконкой и текстом */
}

.open-menu-button {
    vertical-align: middle;
    font-size: 20px;
}



.item-list {
    align-items: center;
    height: 100%;
    justify-content: center;
    display: flex !important;
    ;
}


input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    /* Hides the slider so that custom slider can be styled */
    appearance: none;
    height: 13px;
    /* Высота трека */

    background: transparent;
    border-radius: 5px;
    border: 1px solid #807979;
    /*background: transparent; !* Otherwise white in Chrome *!*/
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #898787;
    cursor: pointer;
    border: 1px solid #807979;
}

.navigation-bar {
    padding-top: 15px !important;
    margin-bottom: 10px;

}

.search-icon {
    background-image: url(assets/search2.png);
    background-size: contain;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
}

.info-icon {
    background-image: url(assets/info.png);
    background-size: contain;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
}

.setting-icon {
    background-image: url(assets/settings.png);
    background-size: contain;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
}

.files-icon {
    background-image: url(assets/files.png);
    background-repeat: no-repeat;
    background-size: contain;
    width: 20px;
    height: 20px;
}

.fullscreen-icon {
    background-image: url(assets/expand.png);
    background-repeat: no-repeat;
    background-size: contain;
    display: block;
    width: 27px;
    margin-right: 7px;
    cursor: pointer;
    height: 24px;
}

.resize-icon {
    background-image: url(assets/resize.png);
}

.right-arrow {
    background-image: url(assets/left-arrow.png);
    transform: rotate(180deg);
    background-repeat: no-repeat;
    display: block;
    background-size: contain;
    width: 20px;
    height: 20px;
}

.left-arrow {
    background-image: url(assets/left-arrow.png);
    background-repeat: no-repeat;
    display: block;
    background-size: contain;
    width: 20px;
    height: 20px;
}

.setting-container {
    display: flex;
    justify-content: flex-start;
}

.action-button {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 200px;
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 5px;
    padding: 10px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.action-button:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.action-button-left {
    margin-right: 14px;
}

.action-container {
    flex-direction: column;
    display: flex;
}

.hidden-opacity {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Полное скрытие элемента из верстки */
.hidden-display {
    display: none !important;
}

#star-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-right: 10px;
}

.contact-us-container,
.star-container-menu {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-left: 10px;
}

.action-container {}

.full-stars,
.full-stars-bar {
    text-align: center;
}

.full-stars .rating-group,
.full-stars-bar .rating-group {
    display: inline-flex;
}

.full-stars input,
.full-stars-bar input {
    position: absolute;
    left: -9999px;
}

.full-stars label,
.full-stars-bar label {
    margin: 0;
    cursor: pointer;
}

.full-stars label a svg,
.full-stars-bar label a svg {
    margin: 2px;
    height: 30px;
    width: 30px;
    fill: #ff8400;
    transition: fill 0.3s;
}

.full-stars input:checked~label a svg,
.full-stars-bar input:checked~label a svg {
    fill: #ffc711;
}

.full-stars .rating-group:hover label a svg,
.full-stars-bar>.rating-group:hover label a svg {
    fill: #ff8400;
}

.full-stars .rating-group input:hover~label a svg,
.full-stars-bar .rating-group input:hover~label a svg {
    fill: #ffc711;
}

/* Стили для режима скролла */
.epub-container[data-flow="scrolled"] {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100% !important;
}

.epub-container[data-flow="scrolled"] iframe {
    height: auto !important;
    min-height: 100% !important;
}

/* Обеспечиваем правильный скролл для epub.js в режиме scrolled */
.app .book>div[style*="overflow"] {
    overflow-y: auto !important;
}

.app .book iframe[style*="height"] {
    min-height: 100% !important;
}

/* Дополнительные стили для поддержки скролла */
.app .book>div {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Непрерывный скролл: контейнер без внутренних paginated высот */
.epub-container[data-manager="continuous"] {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.epub-container[data-manager="continuous"] iframe {
    height: auto !important;
    min-height: auto !important;
}

/* Стили для кастомной темы */
.custom-theme-controls {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.custom-color-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-color-setting label {
    font-size: 13px;
    color: #333;
    margin-right: 8px;
}

.custom-color-setting input[type="color"] {
    width: 40px;
    height: 30px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.custom-color-setting input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
    border-radius: 3px;
}

.custom-color-setting input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* Стили для кастомного шрифта */
.custom-font-controls {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.custom-font-setting {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.custom-font-setting label {
    font-size: 13px;
    color: #333;
    margin-bottom: 8px;
}

.custom-font-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.custom-font-name {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.custom-font-chip {
    position: relative;
    transition: all 0.2s ease;
}

.custom-font-chip:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.custom-font-chip.active {
    background: rgba(138, 77, 77, 0.1) !important;
    border-color: #8a4d4d !important;
    color: #8a4d4d !important;
}

.custom-font-preview {
    background: #f9f9f9;
    color: #333;
    font-weight: normal;
    line-height: 1.4;
}

/* Стили для кастомного размера шрифта */
.custom-size-controls {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.custom-size-setting {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.custom-size-setting label {
    font-size: 13px;
    color: #333;
    margin-bottom: 8px;
}

.custom-size-input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.custom-size-input-wrapper input[type="number"] {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.custom-size-input-wrapper input[type="number"]:focus {
    outline: none;
    border-color: #8a4d4d;
    box-shadow: 0 0 0 2px rgba(138, 77, 77, 0.1);
}

.size-unit {
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.custom-size-chip {
    position: relative;
    transition: all 0.2s ease;
}

.custom-size-chip:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.custom-size-chip.active {
    background: rgba(138, 77, 77, 0.1) !important;
    border-color: #8a4d4d !important;
    color: #8a4d4d !important;
}

.custom-size-preview {
    background: #f9f9f9;
    color: #333;
    font-weight: normal;
    line-height: 1.4;
}

/* Стили для кастомного межстрочного интервала */
.custom-spacing-controls {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.custom-spacing-setting {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.custom-spacing-setting label {
    font-size: 13px;
    color: #333;
    margin-bottom: 8px;
}

.custom-spacing-input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.custom-spacing-input-wrapper input[type="number"] {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.custom-spacing-input-wrapper input[type="number"]:focus {
    outline: none;
    border-color: #8a4d4d;
    box-shadow: 0 0 0 2px rgba(138, 77, 77, 0.1);
}

.spacing-unit {
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.custom-spacing-chip {
    position: relative;
    transition: all 0.2s ease;
}

.custom-spacing-chip:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.custom-spacing-chip.active {
    background: rgba(138, 77, 77, 0.1) !important;
    border-color: #8a4d4d !important;
    color: #8a4d4d !important;
}

.custom-spacing-preview {
    background: #f9f9f9;
    color: #333;
    font-weight: normal;
    font-size: 14px;
}

.custom-margin-chip {
    position: relative;
    transition: all 0.2s ease;
}

.custom-margin-chip:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.custom-margin-chip.active {
    background: rgba(138, 77, 77, 0.1) !important;
    border-color: #8a4d4d !important;
    color: #8a4d4d !important;
}

.custom-margin-controls {
    padding: 8px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.custom-margin-setting {
    display: flex;
    align-items: center;
}

.custom-margin-setting input {
    padding: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* Обеспечиваем правильную инициализацию размеров контейнера */
.epub-container {
    width: 100% !important;
    height: 100% !important;
}

.epub-container iframe {
    width: 100% !important;
    height: 100% !important;
}

/* ПРАВИЛЬНОЕ РЕШЕНИЕ: ограничиваем высоту .book чтобы navigation-footer поместился */
.app .book {
    flex: 1 1 auto;
    max-height: calc(100vh - 88px);
    /* 100vh минус две панели по 44px */
    min-height: 0;
    overflow: hidden;
}

/* Когда нижняя панель скрыта — освобождаем место для книги */
.app.footer-hidden .book {
    max-height: calc(100vh - 44px);
}

/* Гарантируем что navigation-footer всегда виден */
.navigation-footer {
    flex: 0 0 44px;
    /* Фиксированная высота */
    z-index: 100;
}

.icon-container {
    display: flex;
    margin-left: 16px;
}

.navigation-bar-left-container {
    display: flex;
    align-items: center;
}


/* Стили для ссылки-обертки */
.icon-container .customer-portal-link {
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
    cursor: pointer;
}

/* Стили для SVG аватара */
.user-avatar-svg {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    /* Делаем SVG идеально круглым */
    transition: transform 0.2s ease-in-out;
}

.user-avatar-svg:hover {
    transform: scale(1.1);
    /* Легкое увеличение при наведении */
}

/* Стили для текста (инициала) внутри SVG */
.avatar-initial-text {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 50px;
    /* Размер буквы */
    font-weight: 500;
    fill: #ffffff;
    /* Цвет буквы - белый */
}

.highlight-icon {
    display: block;
    /* по умолчанию чёрная иконка, как у остальных значков меню */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="%23000000"><path d="M840-240v160H120v-160h720Zm-160-80 126-126q20-20 20-49t-20-49L558-792q-20-20-49-20t-49 20L160-492v172h172l348-348Zm-328 0H240v-112l298-298 112 112-298 298Z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    width: 24px;
    height: 24px;
    margin: 0 auto;
    opacity: 1;
}

.item.active .highlight-icon {
    /* для активной вкладки цвет иконки такой же, как и в обычном состоянии */
    opacity: 1;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="%23000000"><path d="M840-240v160H120v-160h720Zm-160-80 126-126q20-20 20-49t-20-49L558-792q-20-20-49-20t-49 20L160-492v172h172l348-348Zm-328 0H240v-112l298-298 112 112-298 298Z"/></svg>');
}

.highlight-menu {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10000;
}

.highlight-confirm-btn {
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.highlight-confirm-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Style for the underline in the book */
.highlight-underline {
    border-bottom: 2px solid #ffeb3b;
    /* Default yellow underline */
    background: transparent !important;
    cursor: pointer;
}

.highlights-list {
    padding: 10px;
}

.highlight-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.highlight-item:hover {
    background: #f9f9f9;
}

.highlight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.highlight-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.highlight-date {
    font-size: 12px;
    color: #888;
}

.highlight-text {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 8px;
    cursor: pointer;
    max-height: 4.2em;
    /* Approx 3 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.highlight-comment {
    margin-top: 8px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}


.ui-disabled {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.ui-disabled::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    z-index: 100;
    cursor: not-allowed;
}

.highlight-comment-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px;
    font-size: 13px;
    resize: vertical;
}

.highlight-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.highlight-delete-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
}

.highlight-delete-btn:hover {
    color: #d32f2f;
}

/* --- Улучшенные стили для блока комментариев highlight --- */

.highlight-comments {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

.highlight-comment-item {
    padding: 6px 8px;
    border-radius: 4px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    margin-top: 6px;
}

.highlight-comment-item.editing {
    background: #fff;
    border-color: #8a4d4d40;
    box-shadow: 0 0 0 1px rgba(138, 77, 77, 0.2);
}

.highlight-comment-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.highlight-comment-date {
    font-size: 11px;
    color: #999;
}

.highlight-comment-actions {
    display: flex;
    gap: 4px;
}

.highlight-comment-edit-btn,
.highlight-comment-delete-btn {
    border: none;
    background: transparent;
    font-size: 11px;
    padding: 2px 4px;
    cursor: pointer;
    color: #777;
    border-radius: 3px;
}

.highlight-comment-edit-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #444;
}

.highlight-comment-delete-btn {
    font-size: 13px;
}

.highlight-comment-delete-btn:hover {
    background: rgba(211, 47, 47, 0.06);
    color: #d32f2f;
}

.highlight-comment-text {
    font-size: 13px;
    line-height: 1.4;
    color: #444;
    white-space: pre-wrap;
    word-break: break-word;
    cursor: default;
}

.highlight-comment-input {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
    padding: 6px 8px;
    font-size: 13px;
    resize: vertical;
    line-height: 1.4;
}

.highlight-comment-input:focus {
    outline: none;
    border-color: #8a4d4d;
    box-shadow: 0 0 0 2px rgba(138, 77, 77, 0.15);
}

.highlight-add-comment-wrapper {
    margin-top: 6px;
    display: flex;
    justify-content: flex-start;
}

.highlight-add-comment-btn {
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
}

.highlight-add-comment-btn:hover {
    background: #f3f3f3;
    border-color: #ccc;
}
