.book-embed-page .book-embed-shell {
    max-width: 1120px;
}

.book-embed {
    --book-embed-control-h: 40px;
    width: min(100%, 1080px);
    margin: 10px auto 28px;
    padding: 0 0 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.book-embed__head {
    display: grid;
    gap: 6px;
    margin: 0 0 16px;
}

.book-embed__head h1 {
    margin: 0;
    color: var(--shell-ink, #1f191b);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0;
}

.book-embed__head p {
    max-width: 42rem;
    margin: 0;
    color: var(--shell-muted, #7a7174);
    font-size: 14px;
    line-height: 1.5;
}

.book-embed__form {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(168px, .7fr) auto;
    gap: 10px 12px;
    align-items: end;
}

.book-embed__field {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: var(--shell-muted, #7a7174);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0;
}

.book-embed__field--url {
    min-width: 0;
}

.book-embed__field--admin {
    grid-column: 1 / 3;
}

.book-embed__result {
    grid-column: 1 / -1;
}

.book-embed__field input,
.book-embed__field select {
    width: 100%;
    min-width: 0;
    height: var(--book-embed-control-h);
    border: 1px solid var(--shell-border, #efe8e5);
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--shell-card, #fffcfb);
    color: var(--shell-ink, #1f191b);
    font-size: 14px;
    font-weight: 600;
    outline: 0;
    box-sizing: border-box;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.book-embed__field input {
    padding: 0 12px;
}

.book-embed__field select {
    padding: 0 36px 0 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%231f191b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    color-scheme: light;
    color: var(--shell-ink, #1f191b) !important;
}

.book-embed__field select option,
.book-embed__field select option:checked,
.book-embed__field select option:hover {
    background-color: var(--shell-card, #fffcfb);
    color: var(--shell-ink, #1f191b);
}

.book-embed__field input::placeholder {
    color: #b3a6a8;
    font-weight: 500;
}

.book-embed__field input:focus,
.book-embed__field select:focus {
    border-color: rgba(201, 120, 130, .55);
    box-shadow: 0 0 0 3px var(--shell-accent-soft, rgba(201, 120, 130, .12));
}

.book-embed__field select:disabled {
    border-color: var(--shell-border, #efe8e5);
    color: var(--shell-muted, #7a7174);
    cursor: wait;
}

.book-embed__field small {
    color: var(--shell-muted, #7a7174);
    font-size: 12px;
    font-weight: 500;
}

.book-embed__model-actions {
    display: flex;
    grid-column: 3;
    align-self: end;
    justify-content: flex-start;
}

.book-embed__model-actions button {
    min-height: var(--book-embed-control-h);
    border: 0;
    background: transparent;
    color: var(--shell-accent, #c97882);
    padding: 0 2px;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.book-embed__model-actions button:disabled {
    color: var(--shell-muted, #7a7174);
    cursor: wait;
}

.book-embed__actions {
    display: flex;
    align-items: end;
}

.book-embed__actions button,
.book-embed__actions .book-embed__login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--book-embed-control-h);
    border: 0;
    border-radius: 10px;
    background: var(--shell-accent, #c97882);
    color: #fff;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: background .16s ease, opacity .16s ease;
}

.book-embed__actions button:hover:not(:disabled),
.book-embed__actions .book-embed__login-btn:hover {
    background: var(--shell-accent-hover, #b56570);
    box-shadow: none;
    transform: none;
}

.book-embed__actions button:disabled {
    cursor: wait;
    opacity: .5;
    box-shadow: none;
}

.book-embed__result {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
}

.book-embed__result-text {
    min-width: 0;
}

.book-embed__result-link {
    flex: 0 0 auto;
    border-radius: 8px;
    padding: 5px 8px;
    color: inherit;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.book-embed__result-link:hover {
    text-decoration: underline;
}

.book-embed__result--success {
    background: rgba(95, 138, 116, .12);
    color: var(--shell-sage, #5f8a74);
}

.book-embed__result--success .book-embed__result-link {
    background: rgba(95, 138, 116, .16);
}

.book-embed__result--exists {
    background: rgba(196, 160, 106, .16);
    color: #8a6a38;
}

.book-embed__result--exists .book-embed__result-link {
    background: rgba(196, 160, 106, .22);
}

.book-embed__result--error {
    background: var(--shell-accent-soft, rgba(201, 120, 130, .12));
    color: var(--shell-rose-800, #8a555e);
}

.book-embed__support {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
    border-top: 1px solid var(--shell-border, #efe8e5);
    padding-top: 18px;
}

.book-embed__support-group,
.book-embed__guide {
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.book-embed__guide {
    grid-column: 1 / -1;
}

.book-embed__support-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--shell-ink, #1f191b);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0;
}

.book-embed__support-head h2::before {
    width: 3px;
    height: 14px;
    border-radius: 99px;
    background: var(--shell-accent, #c97882);
    content: '';
}

.book-embed__support-group:nth-child(2) .book-embed__support-head h2::before {
    background: var(--shell-sage, #5f8a74);
}

.book-embed__support-head p {
    max-width: 42rem;
    margin: 6px 0 0 11px;
    color: var(--shell-muted, #7a7174);
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
}

.book-embed__source-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    margin-top: 10px;
}

.book-embed__source {
    display: flex;
    min-width: 0;
    min-height: 40px;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    padding: 6px 8px;
    color: var(--shell-ink, #1f191b);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.book-embed__source:hover {
    background: var(--shell-rose-100, #f8f2f3);
    color: var(--shell-accent, #c97882);
}

.book-embed__source-icon {
    display: block;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 7px;
    object-fit: contain;
}

.book-embed__source-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.book-embed__source-copy strong {
    overflow: hidden;
    color: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-embed__source-copy small {
    overflow: hidden;
    color: var(--shell-muted, #7a7174);
    font-size: 11px;
    font-weight: 550;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: normal;
}

.book-embed__source-external {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    margin-left: auto;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    opacity: .45;
}

.book-embed__guide-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.book-embed__guide-list li {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 8px;
}

.book-embed__guide-list b {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--shell-rose-100, #f8f2f3);
    color: var(--shell-accent, #c97882);
    font-size: 11px;
    font-weight: 850;
}

.book-embed__guide-list span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.book-embed__guide-list strong {
    color: var(--shell-ink, #1f191b);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
}

.book-embed__guide-list small {
    color: var(--shell-muted, #7a7174);
    font-size: 12px;
    font-weight: 550;
    line-height: 1.5;
    white-space: normal;
}

.book-embed__guide-list a {
    color: var(--shell-accent, #c97882);
    font-weight: 800;
    text-decoration: none;
}

.book-embed__guide-list a:hover {
    text-decoration: underline;
}

body.dark .book-embed,
html.dark .book-embed {
    background: transparent;
    box-shadow: none;
}

body.dark .book-embed__head h1,
html.dark .book-embed__head h1,
body.dark .book-embed__field input,
html.dark .book-embed__field input,
body.dark .book-embed__field select,
html.dark .book-embed__field select {
    color: var(--shell-ink, #f4eaef);
}

body.dark .book-embed__head p,
html.dark .book-embed__head p,
body.dark .book-embed__field,
html.dark .book-embed__field {
    color: var(--shell-muted, #b9a8b2);
}

body.dark .book-embed__field input,
html.dark .book-embed__field input,
body.dark .book-embed__field select,
html.dark .book-embed__field select {
    border-color: var(--shell-border, rgba(255, 255, 255, .08));
}

body.dark .book-embed__field input,
html.dark .book-embed__field input {
    background: var(--shell-card, #211c20);
}

body.dark .book-embed__field select,
html.dark .book-embed__field select {
    background-color: var(--shell-card, #211c20) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23f4eaef' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='M6 8l4 4 4-4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px !important;
    color: var(--shell-ink, #f4eaef) !important;
    color-scheme: dark;
}

body.dark .book-embed__field select option,
html.dark .book-embed__field select option,
body.dark .book-embed__field select option:checked,
html.dark .book-embed__field select option:checked,
body.dark .book-embed__field select option:hover,
html.dark .book-embed__field select option:hover {
    background-color: var(--shell-card, #211c20);
    color: var(--shell-ink, #f4eaef);
}

body.dark .book-embed__actions button,
html.dark .book-embed__actions button {
    background: var(--shell-accent, #e2a8b2);
    color: #1c1418;
}

body.dark .book-embed__actions button:hover:not(:disabled),
html.dark .book-embed__actions button:hover:not(:disabled) {
    background: var(--shell-accent-hover, #f0c4cc);
}

body.dark .book-embed__model-actions button,
html.dark .book-embed__model-actions button {
    color: var(--shell-accent, #e2a8b2);
}

body.dark .book-embed__result--success,
html.dark .book-embed__result--success {
    background: rgba(143, 191, 168, .16);
    color: var(--shell-sage, #8fbfa8);
}

body.dark .book-embed__result--success .book-embed__result-link,
html.dark .book-embed__result--success .book-embed__result-link {
    background: rgba(143, 191, 168, .22);
}

body.dark .book-embed__result--exists,
html.dark .book-embed__result--exists {
    background: rgba(212, 176, 122, .16);
    color: var(--shell-gold, #d4b07a);
}

body.dark .book-embed__result--exists .book-embed__result-link,
html.dark .book-embed__result--exists .book-embed__result-link {
    background: rgba(212, 176, 122, .24);
}

body.dark .book-embed__result--error,
html.dark .book-embed__result--error {
    background: var(--shell-accent-soft, rgba(226, 168, 178, .14));
    color: var(--shell-accent, #e2a8b2);
}

body.dark .book-embed__support,
html.dark .book-embed__support {
    border-top-color: var(--shell-border, rgba(255, 255, 255, .08));
}

body.dark .book-embed__support-group,
html.dark .book-embed__support-group,
body.dark .book-embed__guide,
html.dark .book-embed__guide {
    background: transparent;
}

body.dark .book-embed__support-head h2,
html.dark .book-embed__support-head h2,
body.dark .book-embed__source,
html.dark .book-embed__source,
body.dark .book-embed__source-copy strong,
html.dark .book-embed__source-copy strong,
body.dark .book-embed__guide-list strong,
html.dark .book-embed__guide-list strong {
    color: var(--shell-ink, #f4eaef);
}

body.dark .book-embed__support-head p,
html.dark .book-embed__support-head p,
body.dark .book-embed__source-copy small,
html.dark .book-embed__source-copy small,
body.dark .book-embed__guide-list small,
html.dark .book-embed__guide-list small {
    color: var(--shell-muted, #b9a8b2);
}

body.dark .book-embed__source:hover,
html.dark .book-embed__source:hover {
    background: rgba(255, 255, 255, .05);
    color: var(--shell-accent, #e2a8b2);
}

body.dark .book-embed__guide-list b,
html.dark .book-embed__guide-list b {
    background: var(--shell-accent-soft, rgba(226, 168, 178, .14));
    color: var(--shell-accent, #e2a8b2);
}

body.dark .book-embed__guide-list a,
html.dark .book-embed__guide-list a {
    color: var(--shell-accent, #e2a8b2);
}

@media (min-width: 1024px) {
    .book-embed {
        margin-top: 12px;
        padding-bottom: 16px;
    }

    .book-embed__head h1 {
        font-size: 24px;
    }
}

@media (max-width: 1023px) {
    .book-embed-page .site-page-body {
        padding-top: 4px;
        gap: 16px;
    }

    .book-embed {
        width: 100%;
        margin: 0 auto 20px;
        padding: 0;
    }

    .book-embed__head {
        gap: 6px;
        margin-bottom: 16px;
    }

    .book-embed__head h1 {
        font-size: 20px;
    }

    .book-embed__head p {
        font-size: 13px;
    }

    .book-embed__form {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 12px;
    }

    .book-embed__field--url,
    .book-embed__result {
        grid-column: 1 / -1;
    }

    .book-embed__field--category,
    .book-embed__field--admin {
        grid-column: 1;
    }

    .book-embed__actions,
    .book-embed__model-actions {
        grid-column: 2;
        align-self: end;
    }

    .book-embed__actions button {
        min-width: 132px;
        padding: 0 16px;
    }

    .book-embed__support {
        grid-template-columns: 1fr;
        gap: 22px;
        margin-top: 22px;
        padding-top: 20px;
    }

    .book-embed__guide {
        grid-column: auto;
    }

    .book-embed__guide-list {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .book-embed__support {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 20px;
    }

    .book-embed__guide {
        grid-column: 1 / -1;
    }

    .book-embed__guide-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .book-embed {
        --book-embed-control-h: 44px;
        margin-bottom: 16px;
    }

    .book-embed__form {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
    }

    .book-embed__field input,
    .book-embed__field select {
        font-size: 16px;
    }

    .book-embed__actions button {
        min-width: 0;
        font-size: 13px;
        padding: 0 14px;
    }

    .book-embed__model-actions button {
        white-space: nowrap;
        font-size: 12px;
    }

    .book-embed__field {
        gap: 6px;
    }

    .book-embed__support-head p {
        margin: 8px 0 0;
        font-size: 12px;
        line-height: 1.55;
    }

    .book-embed__source-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        margin-top: 12px;
    }

    .book-embed__source {
        min-height: 52px;
        padding: 10px 12px;
        gap: 10px;
        border: 1px solid var(--shell-border, #efe8e5);
    }

    .book-embed__source-icon {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
        border-radius: 7px;
    }

    .book-embed__source-external {
        display: none;
    }

    .book-embed__guide-list {
        gap: 14px;
        margin-top: 12px;
    }

    .book-embed__guide-list small {
        font-size: 12px;
        line-height: 1.55;
    }

    .book-embed__result {
        align-items: flex-start;
    }
}

@media (max-width: 380px) {
    .book-embed__head h1 {
        font-size: 18px;
    }
}
