/* BOOK_EDITOR_PHASE3E3A_V1 */

.book-editor-page {
    --be-green: #173d2d;
    --be-green-soft: #285844;
    --be-gold: #d2a342;
    --be-gold-deep: #a97619;
    --be-cream: #faf7ef;
    --be-border: rgba(23, 61, 45, .12);
    --be-shadow: 0 18px 50px rgba(23, 61, 45, .08);

    width: min(1480px, calc(100% - 28px));
    margin: 16px auto 115px;
    color: var(--be-green);
    direction: rtl;
}

.book-editor-page,
.book-editor-page * {
    box-sizing: border-box;
}

.book-editor-page button,
.book-editor-page input,
.book-editor-page textarea,
.book-editor-page select {
    font-family: inherit;
}

.book-editor-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 25px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid var(--be-border);
    border-radius: 27px;
    background:
        radial-gradient(
            circle at 8% 10%,
            rgba(210,163,66,.18),
            transparent 30%
        ),
        linear-gradient(140deg, #fff, #faf8f2);
    box-shadow: var(--be-shadow);
}

.book-editor-hero-copy {
    min-width: 0;
}

.book-editor-back {
    display: inline-flex;
    margin-bottom: 14px;
    color: var(--be-gold-deep);
    font-size: .8rem;
    font-weight: 950;
    text-decoration: none;
}

.book-editor-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--be-gold-deep);
    font-size: .72rem;
    font-weight: 950;
}

.book-editor-hero h1 {
    margin: 0 0 7px;
    font-size: clamp(1.65rem, 3vw, 2.7rem);
    line-height: 1.25;
}

.book-editor-hero p {
    max-width: 800px;
    margin: 0;
    color: #607168;
    line-height: 1.75;
}

.book-editor-hero-status {
    min-width: 205px;
    display: grid;
    gap: 9px;
}

.book-editor-hero-status > span {
    padding: 9px 12px;
    border: 1px solid var(--be-border);
    border-radius: 12px;
    background: #fff;
    color: #66786e;
    font-size: .75rem;
    font-weight: 900;
    text-align: center;
}

.book-editor-hero-status > span.dirty {
    border-color: rgba(210,163,66,.35);
    background: #fff8e9;
    color: var(--be-gold-deep);
}

.book-editor-preview-link {
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 12px;
    background: var(--be-green);
    color: #fff !important;
    font-size: .8rem;
    font-weight: 950;
    text-decoration: none;
}

.book-editor-preview-link.disabled {
    opacity: .55;
    pointer-events: none;
}

.book-editor-notice {
    margin-bottom: 13px;
    padding: 12px 15px;
    border-radius: 14px;
    font-size: .85rem;
    font-weight: 900;
    text-align: center;
}

.book-editor-notice.success {
    border: 1px solid rgba(24,151,92,.22);
    background: #ebfff4;
    color: #126d45;
}

.book-editor-notice.error {
    border: 1px solid rgba(194,53,53,.2);
    background: #fff0f0;
    color: #9c2d2d;
}

.book-editor-notice.info {
    border: 1px solid rgba(210,163,66,.3);
    background: #fff8e8;
    color: #8a641a;
}

.book-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(285px, 355px);
    gap: 15px;
    align-items: start;
}

.book-editor-main,
.book-editor-side {
    display: grid;
    gap: 15px;
    min-width: 0;
}

.book-editor-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--be-border);
    border-radius: 23px;
    background: #fff;
    box-shadow: 0 13px 35px rgba(23,61,45,.045);
}

.book-editor-card.compact {
    padding: 17px;
    border-radius: 20px;
}

.book-editor-side .sticky-card {
    position: static;
    top: auto;
    z-index: auto;
}

.book-editor-section-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 17px;
}

.book-editor-section-head > span {
    min-width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(210,163,66,.13);
    color: var(--be-gold-deep);
    font-size: .76rem;
    font-weight: 950;
}

.book-editor-section-head h2 {
    margin: 0 0 3px;
    font-size: 1.13rem;
}

.book-editor-section-head p {
    margin: 0;
    color: #738279;
    font-size: .76rem;
    line-height: 1.55;
}

.book-editor-section-head.small {
    margin-bottom: 13px;
}

.book-editor-section-head.small > span {
    min-width: 42px;
    height: 31px;
    border-radius: 999px;
}

.book-editor-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.book-editor-fields.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.book-editor-fields label {
    min-width: 0;
    display: grid;
    gap: 6px;
    align-content: start;
    color: var(--be-green);
    font-size: .78rem;
    font-weight: 900;
}

.book-editor-fields label.wide,
.book-editor-search-preview.wide {
    grid-column: 1 / -1;
}

.book-editor-fields input,
.book-editor-fields textarea,
.book-editor-fields select {
    width: 100%;
    border: 1px solid var(--be-border);
    border-radius: 13px;
    background: #fff;
    color: var(--be-green);
    outline: none;
    font-size: .84rem;
    font-weight: 750;
    transition:
        border-color .16s ease,
        box-shadow .16s ease;
}

.book-editor-fields input,
.book-editor-fields select {
    min-height: 46px;
    padding: 0 12px;
}

.book-editor-fields textarea {
    padding: 11px 12px;
    resize: vertical;
    line-height: 1.75;
}

.book-editor-fields input:focus,
.book-editor-fields textarea:focus,
.book-editor-fields select:focus {
    border-color: rgba(210,163,66,.72);
    box-shadow: 0 0 0 3px rgba(210,163,66,.11);
}

.book-editor-fields small {
    color: #7c8982;
    font-size: .67rem;
    font-weight: 750;
    line-height: 1.5;
}

.book-editor-slug-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.book-editor-slug-field button {
    min-width: 76px;
    border: 1px solid rgba(210,163,66,.3);
    border-radius: 12px;
    background: var(--be-cream);
    color: var(--be-gold-deep);
    font-weight: 950;
    cursor: pointer;
}

.book-editor-media-grid {
    display: grid;
    grid-template-columns: minmax(230px, .36fr) minmax(0, .64fr);
    gap: 13px;
}

.book-editor-cover-box,
.book-editor-gallery-box {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--be-border);
    border-radius: 17px;
    background: var(--be-cream);
}

.book-editor-cover-preview {
    min-height: 315px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid rgba(210,163,66,.19);
    border-radius: 15px;
    background: #fff;
}

.book-editor-cover-preview img {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    filter: drop-shadow(0 13px 20px rgba(23,61,45,.13));
}

.book-editor-cover-preview.empty img {
    opacity: .42;
}

.book-editor-media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.book-editor-media-actions button {
    min-height: 38px;
    flex: 1 1 130px;
    padding: 7px 9px;
    border: 1px solid var(--be-border);
    border-radius: 10px;
    background: #fff;
    color: var(--be-green);
    font-size: .7rem;
    font-weight: 900;
    cursor: pointer;
}

.book-editor-media-actions button.danger {
    color: #a22e2e;
}

.book-editor-cover-box > small,
.book-editor-gallery-box > small {
    display: block;
    margin-top: 8px;
    overflow-wrap: anywhere;
    color: #76867d;
    font-size: .65rem;
    line-height: 1.5;
}

.book-editor-gallery-box > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.book-editor-gallery-box > header strong,
.book-editor-gallery-box > header small {
    display: block;
}

.book-editor-gallery-box > header strong {
    margin-bottom: 3px;
    font-size: .85rem;
}

.book-editor-gallery-box > header small {
    color: #74837b;
    font-size: .66rem;
}

.book-editor-gallery-box > header b {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(210,163,66,.13);
    color: var(--be-gold-deep);
    font-size: .69rem;
}

.book-editor-gallery-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
}

.book-editor-gallery-empty {
    grid-column: 1 / -1;
    min-height: 110px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(23,61,45,.18);
    border-radius: 13px;
    background: rgba(255,255,255,.6);
    color: #7a8880;
    font-size: .72rem;
    font-weight: 800;
}

.book-editor-gallery-item {
    position: relative;
    min-width: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--be-border);
    border-radius: 12px;
    background: #fff;
}

.book-editor-gallery-item > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.book-editor-gallery-item > span {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(23,61,45,.88);
    color: #fff;
    font-size: .62rem;
    font-weight: 950;
}

.book-editor-gallery-item > div {
    position: absolute;
    right: 4px;
    bottom: 4px;
    left: 4px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
}

.book-editor-gallery-item button {
    min-height: 27px;
    border: 0;
    border-radius: 7px;
    background: rgba(255,255,255,.94);
    color: var(--be-green);
    font-weight: 950;
    cursor: pointer;
}

.book-editor-gallery-item button.danger {
    color: #a52e2e;
}

.book-editor-gallery-item button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.book-editor-switches {
    display: grid;
    gap: 8px;
}

.book-editor-switches label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--be-border);
    border-radius: 13px;
    background: var(--be-cream);
    cursor: pointer;
}

.book-editor-switches input {
    margin-top: 3px;
    accent-color: var(--be-green);
}

.book-editor-switches strong,
.book-editor-switches small {
    display: block;
}

.book-editor-switches strong {
    margin-bottom: 2px;
    font-size: .8rem;
}

.book-editor-switches small {
    color: #74837b;
    font-size: .65rem;
    line-height: 1.45;
}

.book-editor-live-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--be-border);
    border-radius: 14px;
    background: var(--be-cream);
}

.book-editor-live-card img {
    width: 82px;
    height: 105px;
    object-fit: contain;
    border-radius: 9px;
    background: #fff;
}

.book-editor-live-card small,
.book-editor-live-card strong,
.book-editor-live-card span {
    display: block;
}

.book-editor-live-card small {
    color: var(--be-gold-deep);
    font-size: .63rem;
    font-weight: 900;
}

.book-editor-live-card strong {
    margin: 4px 0 7px;
    font-size: .83rem;
    line-height: 1.4;
}

.book-editor-live-card span {
    color: var(--be-gold-deep);
    font-size: .9rem;
    font-weight: 950;
}

.book-editor-search-preview {
    padding: 15px;
    border: 1px solid var(--be-border);
    border-radius: 15px;
    background: var(--be-cream);
}

.book-editor-search-preview small,
.book-editor-search-preview strong,
.book-editor-search-preview span {
    display: block;
}

.book-editor-search-preview small {
    margin-bottom: 7px;
    color: #78867e;
    font-size: .66rem;
}

.book-editor-search-preview strong {
    color: #214da0;
    font-size: 1rem;
    line-height: 1.4;
}

.book-editor-search-preview span {
    margin: 4px 0;
    color: #287345;
    font-size: .7rem;
    direction: ltr;
    text-align: left;
    overflow-wrap: anywhere;
}

.book-editor-search-preview p {
    margin: 0;
    color: #59675f;
    font-size: .74rem;
    line-height: 1.6;
}

.book-editor-sticky-actions {
    position: fixed;
    right: max(14px, calc((100vw - 1480px) / 2));
    bottom: 13px;
    left: max(14px, calc((100vw - 1480px) / 2));
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 15px;
    border: 1px solid rgba(210,163,66,.26);
    border-radius: 17px;
    background: rgba(255,255,255,.93);
    box-shadow: 0 18px 55px rgba(23,61,45,.18);
    backdrop-filter: blur(14px);
}

.book-editor-sticky-actions strong,
.book-editor-sticky-actions span {
    display: block;
}

.book-editor-sticky-actions strong {
    max-width: 550px;
    overflow: hidden;
    font-size: .86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-editor-sticky-actions span {
    margin-top: 2px;
    color: #78867e;
    font-size: .66rem;
}

.book-editor-sticky-buttons {
    display: flex;
    gap: 7px;
}

.book-editor-primary-button,
.book-editor-secondary-button {
    min-height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
}

.book-editor-primary-button {
    border: 0;
    background:
        linear-gradient(135deg, var(--be-green), var(--be-green-soft));
    color: #fff;
    box-shadow: 0 10px 25px rgba(23,61,45,.19);
}

.book-editor-primary-button:disabled {
    opacity: .55;
    cursor: wait;
}

.book-editor-secondary-button {
    border: 1px solid var(--be-border);
    background: #fff;
    color: var(--be-green);
}

.book-editor-loading,
.book-editor-error {
    min-height: 420px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    margin: 18px;
    padding: 25px;
    border: 1px solid rgba(23,61,45,.12);
    border-radius: 24px;
    background: #fff;
    color: #173d2d;
    text-align: center;
}

.book-editor-loading > span {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(23,61,45,.12);
    border-top-color: #d2a342;
    border-radius: 50%;
    animation: bookEditorSpin .8s linear infinite;
}

.book-editor-error p {
    margin: 0;
    color: #718077;
}

.book-editor-error a {
    padding: 10px 17px;
    border-radius: 12px;
    background: #173d2d;
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

@keyframes bookEditorSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1050px) {
    .book-editor-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .book-editor-media-grid {
        grid-template-columns: 1fr;
    }

    .book-editor-side .sticky-card {
        position: static;
    }
}

@media (max-width: 820px) {
    .book-editor-page {
        width: min(100% - 18px, 720px);
        margin-top: 9px;
        margin-bottom: 122px;
    }

    .book-editor-hero {
        align-items: stretch;
        padding: 17px;
        border-radius: 20px;
    }

    .book-editor-hero-status {
        min-width: 170px;
    }

    .book-editor-layout {
        grid-template-columns: 1fr;
    }

    .book-editor-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .book-editor-side .sticky-card {
        position: static;
    }

    .book-editor-sticky-actions {
        right: 9px;
        bottom: 8px;
        left: 9px;
    }
}

@media (max-width: 600px) {
    .book-editor-hero {
        display: grid;
        gap: 14px;
    }

    .book-editor-hero-status {
        grid-template-columns: 1fr 1fr;
        min-width: 0;
    }

    .book-editor-card,
    .book-editor-card.compact {
        padding: 13px;
        border-radius: 17px;
    }

    .book-editor-fields,
    .book-editor-fields.two-columns,
    .book-editor-side {
        grid-template-columns: 1fr;
    }

    .book-editor-section-head {
        gap: 9px;
        margin-bottom: 13px;
    }

    .book-editor-section-head > span {
        min-width: 33px;
        height: 33px;
    }

    .book-editor-section-head h2 {
        font-size: 1rem;
    }

    .book-editor-media-grid {
        grid-template-columns: 1fr;
    }

    .book-editor-cover-preview {
        min-height: 250px;
    }

    .book-editor-gallery-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .book-editor-sticky-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 9px;
        border-radius: 14px;
    }

    .book-editor-sticky-actions > div:first-child {
        display: none;
    }

    .book-editor-sticky-buttons {
        display: grid;
        grid-template-columns: .65fr 1.35fr;
    }

    .book-editor-primary-button,
    .book-editor-secondary-button {
        min-height: 43px;
        padding: 7px 10px;
    }
}

@media (max-width: 390px) {
    .book-editor-gallery-preview {
        grid-template-columns: 1fr 1fr;
    }

    .book-editor-hero-status {
        grid-template-columns: 1fr;
    }
}


/* BOOK_EDITOR_PHASE3E3A2_IMPROVEMENTS */

.book-editor-classification-card {
    border-color: rgba(210, 163, 66, .3);
    background:
        radial-gradient(
            circle at 8% 10%,
            rgba(210, 163, 66, .11),
            transparent 31%
        ),
        #fff;
}

.book-editor-generator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px dashed rgba(210, 163, 66, .58);
    border-radius: 15px;
    background: #fff9ec;
}

.book-editor-generator strong,
.book-editor-generator small {
    display: block;
}

.book-editor-generator strong {
    margin-bottom: 4px;
    color: var(--be-green);
    font-size: .84rem;
}

.book-editor-generator small {
    color: #736548;
    font-size: .69rem;
    line-height: 1.6;
}

.book-editor-generator button {
    min-height: 43px;
    flex: 0 0 auto;
    padding: 8px 15px;
    border: 0;
    border-radius: 12px;
    background:
        linear-gradient(
            135deg,
            var(--be-gold),
            var(--be-gold-deep)
        );
    color: #fff;
    font-size: .75rem;
    font-weight: 950;
    cursor: pointer;
    box-shadow:
        0 9px 22px
        rgba(169, 118, 25, .18);
}

@media (max-width: 600px) {
    .book-editor-generator {
        display: grid;
        gap: 10px;
    }

    .book-editor-generator button {
        width: 100%;
    }
}

/* BOOK_EDITOR_PHASE3E3A3B */

.book-editor-hero-simple {
    min-height: 112px;
    padding: 20px 24px;
    border-radius: 21px;
}

.book-editor-hero-simple .book-editor-eyebrow {
    margin-bottom: 2px;
}

.book-editor-hero-simple h1 {
    margin: 0;
    font-size: clamp(1.55rem, 2.5vw, 2.25rem);
}

.book-editor-generator-compact {
    justify-content: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
}

.book-editor-generator-compact button {
    min-width: 210px;
}

.book-editor-custom-subject[hidden] {
    display: none !important;
}

@media (max-width: 600px) {
    .book-editor-hero-simple {
        min-height: 0;
        padding: 15px;
    }

    .book-editor-hero-simple .book-editor-hero-status {
        grid-template-columns: 1fr 1fr;
    }

    .book-editor-generator-compact button {
        width: 100%;
        min-width: 0;
    }
}
