/* Общие панели книги и авторизации доступны из любого раздела. */
dialog { margin: auto; }
#book-dialog { width: min(800px, 96vw); max-width: 96vw; height: min(620px, 92svh); max-height: 92svh; padding: 0; border: 0; background: transparent; color: #e8ddca; overflow: hidden; }
#book-dialog::backdrop, #auth-dialog::backdrop { background: rgb(20 16 13 / 35%); }
.book-dialog-shell { position: relative; height: 100%; min-height: 0; padding: 56px 40px 28px; border-radius: 6px; background: #1c1b18 url('design/OknoKnigi_fon.svg') right top / cover no-repeat; }
.book-dialog-close, .auth-dialog-close { position: absolute; top: 16px; right: 16px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0; padding: 0; border: 0; background: transparent; color: #e8ddca; font-size: 30px; line-height: 1; cursor: pointer; z-index: 2; }
#book-dialog-content { height: 100%; min-height: 0; }
.book-panel-content { height: 100%; min-height: 0; display: grid; grid-template-rows: 96px 48px 84px minmax(0, 1fr) 60px; gap: 12px; overflow: hidden; }
.book-tags { display: flex; flex-wrap: wrap; align-content: start; gap: 6px; }
.book-tags .tag { font-size: 12px; line-height: 1.3; padding: 4px 8px; }
.book-panel-content h1 { color: #e8ddca; font-size: 36px; line-height: 1.15; margin: 0; overflow: hidden; overflow-wrap: anywhere; }
.book-panel-content .demo-label { display: none; }
.book-panel-content a { color: #e8ddca; }
.book-panel-content .book-like { color: var(--wine); }
.book-panel-author, .book-panel-content .tags { min-height: 0; overflow: auto; margin: 0; overflow-wrap: anywhere; }
.book-panel-content .tags { align-content: start; }
.book-description { min-height: 0; overflow: auto; overflow-wrap: anywhere; margin: 0; padding-right: 12px; line-height: 1.55; scrollbar-color: #b5936b #29241e; }
.book-panel-actions { display: grid; grid-template-columns: 48px minmax(0, 170px) minmax(0, 240px); gap: 16px; align-items: center; justify-content: space-between; min-width: 0; height: 48px; align-self: end; }
.book-panel-actions .book-like-form { display: flex; height: 48px; margin: 0; }
.book-panel-actions .book-like { width: 48px; height: 48px; margin: 0; }
.book-weave { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; min-height: 0; margin: 0; padding: 8px 12px; background: url('design/book-weave.svg') center / 100% 100% no-repeat; text-align: center; text-decoration: none; font-size: 15px; }
.book-buy { display: block; width: 100%; height: 48px; margin: 0; padding: 0; border: 0; border-radius: 4px; background: #771b12 url('design/book-buy.svg') center / 100% 100% no-repeat; }
.book-buy:disabled { opacity: .65; cursor: default; }
.book-standalone .book-dialog-shell { height: min(620px, 85svh); }
body.book-modal-open, body.auth-modal-open { overflow: hidden; }
#auth-dialog { width: min(480px, 96vw); max-width: 96vw; max-height: 94svh; padding: 0; border: 0; background: transparent; color: #e8ddca; overflow: auto; scrollbar-width: thin; }
.auth-panel { position: relative; min-height: 640px; padding: 180px 34px 28px; background: url('design/auth-panel.svg') center / 100% 100% no-repeat; }
.auth-content h1 { color: #e8ddca; font-size: 30px; text-align: center; margin: 0 0 20px; }
.auth-content .form-field { margin-bottom: 14px; }
.auth-content input:not([type="hidden"]):not([type="checkbox"]) { background: #dfd1c5 url('design/auth-input.svg') center / 100% 100% no-repeat; border: 0; border-radius: 8px; min-height: 44px; }
.auth-content .form-field-checkbox label { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.auth-content .form-field-checkbox input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; padding: 0; accent-color: #771b12; }
.auth-content .button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; margin-top: 20px; padding: 10px; border: 0; border-radius: 8px; background: url('design/auth-button.svg') center / 100% 100% no-repeat; color: #e8ddca; text-align: center; }
.auth-content a { color: #e8ddca; }
.auth-content > p { text-align: center; margin: 20px 0 0; }
.auth-content .field-help { color: #e8ddca; font-size: 12px; }
.auth-content .errorlist { color: #ffe1bf; padding-left: 20px; }
@media (max-width: 600px) {
    .book-dialog-shell { padding: 54px 20px 20px; }
    .book-panel-content { grid-template-rows: 80px 42px 84px minmax(0, 1fr) 60px; gap: 8px; }
    .book-panel-actions { gap: 8px; }
    .book-weave { font-size: 12px; }
    .auth-panel { padding: min(38vw, 180px) 24px 26px; }
}
