/* ============================================
           УНИКАЛЬНЫЙ ДИЗАЙН — НЕ ПОХОЖ НА ЛИТРЕС
           ============================================ */

/* ---------- Переменные ---------- */
:root {
    --warm: #C57B57;
    --warm-light: #E8C9B0;
    --warm-dark: #A86545;
    --sand: #F5E6D3;
    --cream: #FDF8F2;
    --graphite: #2D2D2D;
    --graphite-light: #4A4A4A;
    --gray-soft: #8F8F8F;
    --bg: #F8F4EF;
    --card-shadow: 0 4px 24px rgba(45, 45, 45, 0.06);
    --card-hover: 0 8px 36px rgba(45, 45, 45, 0.10);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--bg);
    color: var(--graphite);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Container ---------- */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.header {
    padding: 24px 0 16px;
    border-bottom: 2px solid var(--sand);
    background: var(--cream);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: -0.3px;
    color: var(--graphite);
}
.logo .mark {
    background: var(--warm);
    color: #fff;
    font-size: 12px;
    padding: 4px 14px;
    border-radius: 40px;
    font-weight: 600;
    letter-spacing: 0.3px;
    font-family: 'Inter', sans-serif;
}
.logo .bolt {
    font-size: 28px;
    line-height: 1;
}
.nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-family: 'Inter', -apple-system, sans-serif;
}
.nav a {
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    color: var(--graphite-light);
    transition: var(--transition);
    letter-spacing: 0.2px;
}
.nav a:hover {
    background: var(--warm);
    color: #fff;
}

/* ---------- Hero ---------- */
.hero {
    padding: 56px 0 48px;
    text-align: center;
    background: var(--cream);
    border-radius: 0 0 48px 48px;
    margin-bottom: 32px;
}
.hero h1 {
    font-size: clamp(34px, 5.5vw, 58px);
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    font-family: 'Inter', -apple-system, sans-serif;
}
.hero h1 .accent-text {
    color: var(--warm);
    position: relative;
}
.hero h1 .accent-text::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--warm-light);
    border-radius: 4px;
    opacity: 0.5;
    z-index: -1;
}
.hero p {
    font-size: clamp(16px, 1.4vw, 20px);
    color: var(--gray-soft);
    max-width: 580px;
    margin: 12px auto 28px;
}
.hero-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn {
    padding: 14px 34px;
    border-radius: 60px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', -apple-system, sans-serif;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary {
    background: var(--warm);
    color: #fff;
}
.btn-primary:hover {
    background: var(--warm-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(197, 123, 87, 0.3);
}
.btn-outline {
    background: transparent;
    color: var(--graphite);
    border: 2px solid var(--sand);
}
.btn-outline:hover {
    border-color: var(--warm);
    color: var(--warm);
    transform: translateY(-3px);
}

/* ---------- Stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
    max-width: 680px;
    margin: 32px auto 0;
}
.stat-item {
    background: #fff;
    padding: 18px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--sand);
    transition: var(--transition);
}
.stat-item:hover {
    border-color: var(--warm-light);
}
.stat-item .number {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: var(--warm);
}
.stat-item .label {
    font-size: 13px;
    color: var(--gray-soft);
}

/* ---------- Section ---------- */
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.section-title {
    font-size: clamp(24px, 2.8vw, 32px);
    font-weight: 700;
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: -0.3px;
}
.section-title .light {
    font-weight: 400;
    color: var(--gray-soft);
    font-family: 'Georgia', serif;
}
.section-subtitle {
    color: var(--gray-soft);
    font-size: 15px;
}
.link-more {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--warm);
    border-bottom: 2px solid var(--warm-light);
    padding-bottom: 2px;
    transition: var(--transition);
    font-size: 14px;
}
.link-more:hover {
    border-color: var(--warm);
    color: var(--warm-dark);
}

/* ---------- Categories ---------- */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}
.category-item {
    background: #fff;
    padding: 16px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--sand);
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    transition: var(--transition);
    cursor: pointer;
    color: var(--graphite-light);
}
.category-item:hover {
    border-color: var(--warm);
    background: var(--cream);
    transform: translateY(-3px);
}
.category-item .emoji {
    font-size: 28px;
    display: block;
    margin-bottom: 4px;
}

/* ---------- Book Grid ---------- */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.book-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.book-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid transparent;
    height: 100%;
    cursor: pointer;
}
.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-hover);
    border-color: var(--warm-light);
}
.book-cover {
    aspect-ratio: 2/3;
    background: var(--sand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    color: var(--gray-soft);
    position: relative;
    overflow: hidden;
}
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.book-cover .flag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--warm);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.book-cover .flag.exclusive {
    background: var(--graphite);
}
.book-info {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.book-title {
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    line-height: 1.3;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-author {
    font-size: 13px;
    color: var(--gray-soft);
    margin-bottom: 6px;
}
.book-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-soft);
    margin-bottom: 10px;
    flex-wrap: wrap;
    font-family: 'Inter', sans-serif;
}
.book-meta .rating {
    color: var(--warm);
    font-weight: 600;
}
.book-meta .genre {
    background: var(--sand);
    padding: 2px 10px;
    border-radius: 30px;
}
.book-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid var(--sand);
    padding-top: 10px;
}
.book-footer .btn-more {
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--warm);
    background: transparent;
    padding: 0;
    border-radius: 0;
    transition: var(--transition);
}
.book-card:hover .book-footer .btn-more {
    color: var(--warm-dark);
}
.book-price {
    font-size: 17px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: var(--graphite);
}
.btn-buy {
    background: transparent;
    border: 1.5px solid var(--warm);
    color: var(--warm);
    padding: 5px 16px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}
.btn-buy:hover {
    background: var(--warm);
    color: #fff;
}

/* ---------- AI Preview ---------- */
.ai-preview {
    background: var(--graphite);
    color: #fff;
    border-radius: var(--radius);
    padding: 36px 32px;
    margin: 32px 0 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.ai-preview h2 {
    font-size: 26px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}
.ai-preview h2 .accent {
    color: var(--warm-light);
}
.ai-preview p {
    opacity: 0.7;
    max-width: 480px;
    margin-bottom: 20px;
    font-size: 15px;
}
.ai-demo {
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 20px 22px;
    max-width: 520px;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.06);
}
.ai-demo .message,
.ai-chat-history .message {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.ai-demo .avatar,
.ai-chat-history .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.ai-demo .bubble,
.ai-chat-history .bubble {
    background: rgba(255,255,255,0.08);
    padding: 10px 16px;
    border-radius: 14px 14px 14px 4px;
    font-size: 14px;
    line-height: 1.6;
}
.ai-demo .bubble.user,
.ai-chat-history .bubble.user {
    background: var(--warm);
    border-radius: 14px 14px 4px 14px;
    color: #fff;
}
.ai-demo .bubble .highlight {
    color: var(--warm-light);
    font-weight: 600;
}
.ai-demo .typing,
.ai-chat-history .typing {
    display: flex;
    gap: 5px;
    padding: 6px 8px;
}
.ai-demo .typing span,
.ai-chat-history .typing span {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: typing 1.4s infinite both;
}
.ai-demo .typing span:nth-child(2),
.ai-chat-history .typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-demo .typing span:nth-child(3),
.ai-chat-history .typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ---------- Partner Block ---------- */
.partner-block {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 28px 30px;
    margin: 28px 0;
    border: 1px solid var(--sand);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}
.partner-block .label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--warm);
}
.partner-block h3 {
    font-size: 20px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    margin: 2px 0 4px;
}
.partner-block p {
    color: var(--gray-soft);
    font-size: 14px;
    max-width: 460px;
}

/* ---------- Empty state ---------- */
.empty-state {
    background: #fff;
    border: 1px solid var(--sand);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    margin-bottom: 40px;
}
.empty-state .emoji {
    font-size: 48px;
    margin-bottom: 12px;
}
.empty-state .message {
    font-size: 17px;
    color: var(--graphite);
    font-family: 'Inter', -apple-system, sans-serif;
}

/* ---------- Footer ---------- */
.footer {
    background: var(--graphite);
    color: rgba(255,255,255,0.5);
    padding: 36px 0 24px;
    margin-top: 32px;
    border-radius: 40px 40px 0 0;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.footer .logo {
    color: #fff;
}
.footer .logo .mark {
    background: var(--warm);
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}
.footer-links a {
    transition: var(--transition);
}
.footer-links a:hover {
    color: #fff;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 16px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .header-inner { flex-direction: column; align-items: stretch; }
    .nav { justify-content: center; }
    /* Мобильная лента книг: горизонтальный скролл */
    .book-grid {
        display: flex;
        grid-template-columns: none;
        gap: 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .book-card-link {
        flex: 0 0 160px;
        scroll-snap-align: start;
    }
    .categories { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .ai-preview { padding: 24px 18px; }
    .stats { grid-template-columns: 1fr 1fr; }
    .hero { padding: 32px 0 28px; }
    .partner-block { flex-direction: column; text-align: center; }
    .footer { border-radius: 20px 20px 0 0; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 400px) {
    .book-card-link { flex: 0 0 140px; }
    .book-info { padding: 10px 12px 12px; }
    .book-title { font-size: 12px; }
    .tags-filter { padding: 14px 14px; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    margin: 20px 0 8px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    color: var(--gray-soft);
}
.breadcrumbs a { color: var(--warm); transition: var(--transition); }
.breadcrumbs a:hover { color: var(--warm-dark); text-decoration: underline; }
.breadcrumbs-sep { margin: 0 8px; color: var(--sand); }
.breadcrumbs-current { color: var(--graphite-light); }

/* ---------- Book Detail ---------- */
.book-detail {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    margin: 24px 0 32px;
    box-shadow: var(--card-shadow);
}
.book-detail-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 36px;
}
.book-detail-cover {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--sand);
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}
.book-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-detail-cover .flag {
    position: absolute; top: 12px; right: 12px;
    background: var(--warm); color: #fff;
    font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 700;
    padding: 4px 12px; border-radius: 30px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.book-detail-cover .flag.exclusive { background: var(--graphite); }
.book-detail-info { display: flex; flex-direction: column; gap: 14px; }
.book-detail-title {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.2;
    letter-spacing: -0.3px;
}
.book-detail-author { font-size: 16px; color: var(--gray-soft); }
.book-detail-meta {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-family: 'Inter', sans-serif; font-size: 14px;
}
.book-detail-meta .rating { color: var(--warm); font-weight: 700; }
.book-detail-meta .genre { background: var(--sand); padding: 4px 14px; border-radius: 30px; font-size: 13px; }
.book-detail-meta .source { color: var(--gray-soft); font-size: 13px; }
.book-detail-description { font-size: 15px; line-height: 1.8; color: var(--graphite-light); }
.book-detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.book-detail-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.book-detail-actions .book-price { font-size: 24px; }
.btn-buy-large {
    background: var(--warm); color: #fff;
    padding: 12px 28px; border-radius: 40px;
    font-size: 15px; font-weight: 600; font-family: 'Inter', sans-serif;
    transition: var(--transition);
}
.btn-buy-large:hover { background: var(--warm-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(197,123,87,0.3); }
.btn-buy-audio {
    background: transparent; border: 1.5px solid var(--warm); color: var(--warm);
    padding: 10px 22px; border-radius: 40px;
    font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif;
    transition: var(--transition);
}
.btn-buy-audio:hover { background: var(--warm); color: #fff; }
.btn-buy-free {
    background: transparent; border: 1.5px solid #5a9e6f; color: #5a9e6f;
    padding: 10px 22px; border-radius: 40px;
    font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif;
    transition: var(--transition);
}
.btn-buy-free:hover { background: #5a9e6f; color: #fff; }
.book-detail-formats { display: flex; gap: 10px; flex-wrap: wrap; }
.format-badge {
    background: var(--sand); padding: 6px 14px; border-radius: 30px;
    font-size: 13px; font-family: 'Inter', sans-serif; color: var(--graphite-light);
}
.similar-books { margin: 40px 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 32px 0; flex-wrap: wrap; }
.pagination-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px;
    border-radius: 10px; background: #fff; border: 1px solid var(--sand);
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 500;
    color: var(--graphite-light); transition: var(--transition);
}
.pagination-link:hover { border-color: var(--warm); color: var(--warm); }
.pagination-current { background: var(--warm); border-color: var(--warm); color: #fff; }
.pagination-dots { color: var(--gray-soft); }

/* ---------- Sort Controls ---------- */
.sort-controls { display: flex; align-items: center; gap: 10px; font-family: 'Inter', sans-serif; font-size: 14px; color: var(--gray-soft); }
.sort-controls select {
    padding: 8px 14px; border-radius: 10px; border: 1px solid var(--sand);
    background: #fff; font-family: 'Inter', sans-serif; font-size: 13px;
    color: var(--graphite); cursor: pointer; outline: none; transition: var(--transition);
}
.sort-controls select:focus { border-color: var(--warm); }

/* ---------- Button More / book-actions ---------- */
.btn-more {
    display: inline-block; padding: 5px 14px; border-radius: 40px;
    font-size: 12px; font-weight: 600; font-family: 'Inter', sans-serif;
    background: var(--sand); color: var(--graphite-light); transition: var(--transition);
}
.btn-more:hover { background: var(--warm-light); color: var(--graphite); }
.book-actions { display: flex; gap: 6px; align-items: center; }
.book-title a { color: inherit; transition: var(--transition); }
.book-title a:hover { color: var(--warm); }

/* ---------- Tags filter (подборки по тегам) ---------- */
.tags-filter {
    margin: 28px 0 8px;
    padding: 18px 22px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}
.tags-filter-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--graphite-light);
    letter-spacing: 0.3px;
}
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-link {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 999px;
    background: var(--sand);
    color: var(--graphite-light);
    font-size: 13px;
    font-family: Arial, Helvetica, sans-serif;
    border: 1px solid transparent;
    transition: var(--transition);
}
.tag-link:hover {
    background: var(--warm-light);
    color: var(--graphite);
    transform: translateY(-1px);
}
.tag-link.active {
    background: var(--warm);
    color: #fff;
    border-color: var(--warm-dark);
    box-shadow: 0 2px 10px rgba(197, 123, 87, 0.35);
}

/* ---------- Not found (404) ---------- */
.not-found-block {
    text-align: center;
    padding: 60px 20px;
    margin: 26px 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}
.not-found-icon { font-size: 46px; margin-bottom: 12px; }
.not-found-block h2 { font-size: 22px; margin-bottom: 8px; }
.not-found-block p { color: var(--gray-soft); }

/* ---------- AI Chat (живой умный поиск) ---------- */
.ai-chat {
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    max-width: 640px;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.08);
}
.ai-chat-history {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.ai-chat-history .message { margin-bottom: 12px; }
.ai-chat-history .message:last-child { margin-bottom: 0; }
.ai-chat-history .message.user { flex-direction: row-reverse; }

/* примеры запросов */
.ai-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.ai-example-btn {
    background: rgba(255,255,255,0.08);
    border: 1px dashed rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.85);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-family: 'Inter', Arial, sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}
.ai-example-btn:hover {
    background: var(--warm);
    border-color: var(--warm);
    color: #fff;
    transform: translateY(-1px);
}

/* форма */
.ai-form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.ai-input {
    flex: 1;
    min-width: 0;
    padding: 11px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.25);
    color: #fff;
    font-size: 14px;
    font-family: 'Inter', Arial, sans-serif;
    outline: none;
    transition: var(--transition);
}
.ai-input::placeholder { color: rgba(255,255,255,0.4); }
.ai-input:focus {
    border-color: var(--warm-light);
    box-shadow: 0 0 0 3px rgba(197,123,87,0.25);
}
.ai-input:disabled, .ai-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.ai-submit {
    flex-shrink: 0;
    white-space: nowrap;
}
.ai-submit .ai-submit-loader {
    display: inline-block;
    animation: spin 1.2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ai-hint {
    margin-top: 10px;
    font-size: 11.5px;
    color: rgba(255,255,255,0.45);
}
.ai-error {
    margin-top: 10px;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    background: rgba(220, 80, 60, 0.18);
    border: 1px solid rgba(220, 80, 60, 0.5);
    color: #ffb4a8;
    font-size: 13px;
}

/* markdown внутри ответа ИИ */
.ai-chat-history .bubble p { margin: 0 0 8px; }
.ai-chat-history .bubble p:last-child { margin-bottom: 0; }
.ai-chat-history .bubble h2,
.ai-chat-history .bubble h3,
.ai-chat-history .bubble h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--warm-light);
    margin: 0 0 8px;
}
.ai-chat-history .bubble ul,
.ai-chat-history .bubble ol {
    margin: 0 0 8px;
    padding-left: 20px;
}
.ai-chat-history .bubble li { margin-bottom: 4px; }
.ai-chat-history .bubble a {
    color: var(--warm-light);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}
.ai-chat-history .bubble a:hover { color: #fff; }
.ai-chat-history .bubble strong { color: #fff; }

/* ===== Блок магазинов (где читать/слушать) ===== */
.book-shops {
    margin-top: 18px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    background: var(--cream);
    border: 1px solid var(--sand);
}
.book-shops-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray-soft);
    margin-bottom: 6px;
    font-family: 'Inter', -apple-system, sans-serif;
}
.shop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 0;
    border-top: 1px solid var(--sand);
}
.shop-row:first-of-type { border-top: none; }
.shop-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.shop-name {
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--graphite);
}
.shop-format {
    background: var(--sand);
    padding: 3px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--graphite-light);
    white-space: nowrap;
}
.shop-row-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.shop-price {
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--graphite);
    white-space: nowrap;
}
.shop-price-free { color: #4c8a5f; }
.book-price-free { color: #4c8a5f; }
.btn-shop {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-shop-buy {
    background: var(--warm);
    color: #fff;
}
.btn-shop-buy:hover {
    background: var(--warm-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(197, 123, 87, 0.3);
}
.btn-shop-free {
    background: transparent;
    border: 1.5px solid #5a9e6f;
    color: #5a9e6f;
}
.btn-shop-free:hover {
    background: #5a9e6f;
    color: #fff;
}
.btn-shop-audio {
    background: transparent;
    border: 1.5px solid var(--warm);
    color: var(--warm);
}
.btn-shop-audio:hover {
    background: var(--warm);
    color: #fff;
}

/* Описание книги — заголовок */
.book-detail-description-title {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray-soft);
    margin-bottom: 8px;
}
.book-detail-annotation {
    margin-bottom: 10px;
    font-style: italic;
}

/* ===== Итроник: аватар и подпись загрузки ===== */
.ai-avatar-big {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warm), var(--warm-dark));
    color: #fff;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 36px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 6px 24px rgba(197, 123, 87, 0.4);
    user-select: none;
}
.typing-label {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
    font-family: 'Inter', Arial, sans-serif;
}
/* Буква «И» в аватаре чата */
.ai-chat-history .avatar {
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 700;
    color: var(--warm-light);
}

@media (max-width: 640px) {
    .ai-form { flex-direction: column; }
    .ai-submit { width: 100%; }
    .ai-chat-history { max-height: 300px; }
    .ai-example-btn { font-size: 12px; padding: 6px 12px; }
    .book-detail { padding: 20px; }
    .book-detail-layout { grid-template-columns: 1fr; gap: 20px; }
    .book-detail-cover { max-width: 240px; margin: 0 auto; }
    .book-detail-actions { flex-direction: column; align-items: flex-start; }
    .shop-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    .shop-row-right { width: 100%; justify-content: space-between; }
    .btn-shop { padding: 9px 18px; font-size: 13px; }
    .ai-avatar-big { width: 56px; height: 56px; font-size: 28px; }
}
