.hero { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
        .hero img { width: 84px; height: 84px; flex-shrink: 0; }
        .hero .title { margin: 0 0 2px; }
        .hero p { margin: 0; color: var(--muted); font-weight: 600; }
        .hero #lastAdded { margin-top: 6px; font-size: 0.9rem; font-weight: 400; }
        #lastAdded time { color: var(--accent); font-weight: 600; }

        .search { position: relative; margin-bottom: 12px; }
        .search input { border-radius: 999px; padding-left: 2.6rem; min-height: 50px; box-shadow: var(--shadow); }
        .search svg { position: absolute; left: 0.95rem; top: 50%; width: 20px; height: 20px; margin-top: -10px; fill: var(--muted); pointer-events: none; }

        .controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
        .controls select { width: auto; min-width: 9.5rem; border-radius: 999px; padding: 0 2rem 0 1rem; }
        .stats { color: var(--muted); font-size: 0.9rem; }
        .stats span { color: var(--accent); font-weight: 700; }

        .alphabet-nav {
            display: flex;
            gap: 4px;
            overflow-x: auto;
            scrollbar-width: none;
            margin: 0 calc(-1 * var(--gutter)) 16px;
            padding: 4px var(--gutter);
        }
        .alphabet-nav::-webkit-scrollbar { display: none; }
        .letter {
            flex-shrink: 0;
            width: var(--tap);
            height: var(--tap);
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            font-weight: 700;
            font-size: 0.85rem;
            color: var(--accent);
            background: var(--surface);
            border: 1px solid var(--border);
            cursor: pointer;
        }
        .letter.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
        .letter.disabled { color: var(--muted); opacity: 0.35; cursor: default; background: transparent; }

        .books-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
        @media (min-width: 700px) { .books-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        @media (min-width: 1040px) { .books-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

        .book-card { padding: 12px; display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; }
        .book-card:hover .book-title { text-decoration: underline; }
        .book-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
        .book-card-inner { display: flex; gap: 12px; }
        .book-cover, .book-cover-placeholder {
            width: 78px;
            height: 112px;
            flex-shrink: 0;
            border-radius: 6px;
            object-fit: cover;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        }
        .book-cover-placeholder {
            display: flex;
            align-items: center;
            justify-content: center;
            background: color-mix(in srgb, var(--brand) 18%, var(--surface));
            color: var(--accent);
            font-family: var(--hand);
            font-size: 2.4rem;
        }
        .book-info { min-width: 0; }
        .book-title { font-size: 1.02rem; line-height: 1.3; margin: 0 0 2px; }
        .book-subtitle { font-size: 0.85rem; color: var(--muted); margin-bottom: 2px; }
        .book-author { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
        .book-meta { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
        .book-tag {
            font-size: 0.75rem;
            font-weight: 700;
            padding: 2px 9px;
            border-radius: 999px;
            background: color-mix(in srgb, var(--sun) 35%, transparent);
            color: var(--text);
        }
        .book-summary {
            margin: 0;
            font-size: 0.88rem;
            color: var(--muted);
            display: -webkit-box;
            -webkit-line-clamp: 4;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .book-details { border-top: 1px dashed var(--border); padding-top: 8px; font-size: 0.78rem; color: var(--muted); }
        .book-details-grid { display: flex; flex-wrap: wrap; gap: 2px 14px; overflow-wrap: anywhere; }

        .no-results { text-align: center; color: var(--muted); padding: 48px 16px; }
        .no-results .title { transform: none; font-size: 2rem; }

        .back-to-top {
            position: fixed;
            right: 16px;
            bottom: calc(16px + env(safe-area-inset-bottom));
            width: var(--tap);
            height: var(--tap);
            border-radius: 50%;
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--accent);
            box-shadow: var(--shadow);
            font-size: 1.3rem;
            cursor: pointer;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.2s ease;
        }
        .back-to-top.visible { opacity: 1; visibility: visible; }

        .fade-in { animation: fadeIn 0.35s ease forwards; opacity: 0; }
        @keyframes fadeIn { to { opacity: 1; } }
.book-title a { color: inherit; text-decoration: none; }
.book-title a:hover { text-decoration: underline; }
.book-title { overflow-wrap: anywhere; }
.controls { flex-wrap: wrap; }
