@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Auth Screen ── */
.auth-screen {
    position: fixed;
    inset: 0;
    width: 100%;
    min-height: 100vh;
    height: 100dvh;
    padding: calc(28px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
    background: #0a0f1a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, transform 0.6s ease;
    overflow: hidden;
}

.auth-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 1;
}

.auth-stars-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.auth-screen.exiting {
    opacity: 0;
    transform: scale(1.015);
    pointer-events: none;
}

.library-card {
    width: min(420px, 100%);
    background: rgba(14, 21, 38, 0.94);
    border: 1px solid rgba(210, 220, 245, 0.08);
    border-radius: 28px;
    padding: 34px 30px 24px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow:
        24px 24px 70px rgba(2, 5, 12, 0.48),
        -14px -14px 38px rgba(34, 47, 76, 0.18),
        inset 1px 1px 0 rgba(255, 255, 255, 0.05),
        inset -1px -1px 0 rgba(5, 10, 20, 0.62);
    backdrop-filter: blur(18px) saturate(122%);
    -webkit-backdrop-filter: blur(18px) saturate(122%);
}

.library-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.08) 0%, transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 24%, transparent 76%, rgba(255, 255, 255, 0.015));
    pointer-events: none;
}

.library-card::after {
    content: "";
    position: absolute;
    inset: 11px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    pointer-events: none;
}

.library-card-header {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.library-card-logo {
    font-family: 'Helvetica Neue', Helvetica, -apple-system, sans-serif;
    font-size: 30px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.94);
    letter-spacing: -0.045em;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.lc-books {
    overflow: visible;
    opacity: 0.74;
}

.library-card-subtitle {
    font-size: 10px;
    letter-spacing: 0.42em;
    color: rgba(214, 223, 255, 0.32);
    text-transform: uppercase;
    font-weight: 600;
}

.library-card-stamp {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 62px;
    height: 62px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    background: rgba(17, 26, 46, 0.28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    transform: scale(0.94);
    z-index: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.library-card-stamp.stamped {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(124, 208, 154, 0.28);
    background: radial-gradient(circle at 30% 30%, rgba(104, 194, 136, 0.18), rgba(44, 76, 62, 0.14) 55%, rgba(12, 18, 32, 0.32));
    box-shadow:
        0 14px 32px rgba(9, 17, 34, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.library-card-stamp.stamped::after {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(146, 230, 174, 0.84);
    font-size: 24px;
    text-shadow: 0 0 18px rgba(108, 195, 138, 0.24);
}

.library-card-body {
    min-height: 168px;
    position: relative;
    z-index: 1;
}

.auth-step {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-label {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(214, 223, 255, 0.38);
    font-weight: 600;
}

.auth-input {
    background: rgba(10, 16, 30, 0.98);
    border: 1px solid rgba(214, 223, 255, 0.05);
    border-radius: 16px;
    padding: 15px 16px;
    font-size: 16px;
    line-height: 1.25;
    color: rgba(248, 250, 255, 0.94);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-family: inherit;
    box-shadow:
        inset 8px 8px 18px rgba(4, 8, 18, 0.56),
        inset -5px -5px 14px rgba(25, 36, 60, 0.22),
        1px 1px 0 rgba(255, 255, 255, 0.015);
}

.auth-input:focus {
    background: rgba(12, 20, 37, 1);
    border-color: rgba(176, 194, 255, 0.24);
    box-shadow:
        inset 10px 10px 20px rgba(4, 8, 18, 0.58),
        inset -6px -6px 16px rgba(27, 39, 64, 0.22),
        0 0 0 4px rgba(86, 108, 170, 0.1);
}

.auth-input::placeholder {
    color: rgba(224, 232, 255, 0.24);
}

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: linear-gradient(180deg, rgba(244, 247, 252, 0.97), rgba(230, 235, 244, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 18px;
    padding: 15px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #1b2232;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    font-family: inherit;
    letter-spacing: -0.01em;
    box-shadow:
        12px 12px 28px rgba(6, 9, 18, 0.24),
        -6px -6px 18px rgba(255, 255, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.auth-google-btn:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 243, 251, 0.95));
    box-shadow:
        14px 14px 30px rgba(6, 9, 18, 0.26),
        -8px -8px 20px rgba(255, 255, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.auth-google-btn:active {
    transform: scale(0.985);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 2px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(214, 223, 255, 0.1);
}

.auth-divider span {
    font-size: 10px;
    color: rgba(214, 223, 255, 0.24);
    text-transform: uppercase;
    letter-spacing: 0.28em;
}

.auth-button {
    background: linear-gradient(180deg, rgba(33, 48, 82, 0.96), rgba(21, 32, 56, 0.98));
    border: 1px solid rgba(195, 210, 255, 0.09);
    border-radius: 16px;
    padding: 15px 16px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(245, 248, 255, 0.94);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    font-family: inherit;
    letter-spacing: -0.01em;
    margin-top: 2px;
    box-shadow:
        14px 14px 30px rgba(5, 8, 16, 0.3),
        -8px -8px 18px rgba(46, 64, 103, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.auth-button:hover {
    background: linear-gradient(180deg, rgba(43, 60, 101, 0.86), rgba(24, 37, 66, 0.98));
    border-color: rgba(195, 210, 255, 0.18);
    box-shadow:
        16px 16px 34px rgba(5, 8, 16, 0.34),
        -10px -10px 20px rgba(49, 68, 110, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.auth-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-button:active {
    transform: scale(0.985);
}

.auth-check-icon {
    font-size: 38px;
    text-align: center;
    margin-bottom: 8px;
    opacity: 0.78;
}

.auth-check-text {
    font-size: 20px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.94);
    text-align: center;
}

.auth-check-sub {
    font-size: 13px;
    color: rgba(214, 223, 255, 0.52);
    text-align: center;
    line-height: 1.5;
}

.auth-check-sub strong {
    color: rgba(255, 255, 255, 0.84);
}

.auth-link-btn {
    background: none;
    border: none;
    color: rgba(214, 223, 255, 0.44);
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    font-family: inherit;
    transition: color 0.18s ease;
}

.auth-link-btn:hover {
    color: rgba(255, 255, 255, 0.74);
}

.auth-username-preview {
    font-size: 13px;
    color: rgba(214, 223, 255, 0.38);
    text-align: center;
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(10, 16, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow:
        inset 7px 7px 14px rgba(4, 8, 18, 0.5),
        inset -4px -4px 10px rgba(24, 35, 57, 0.18);
}

.auth-username-preview strong {
    color: rgba(255, 255, 255, 0.78);
}

.auth-error {
    font-size: 12px;
    color: #f59e9e;
    text-align: center;
    min-height: 16px;
}

.library-card-footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    position: relative;
    z-index: 1;
}

.library-card-number {
    font-size: 10px;
    letter-spacing: 0.34em;
    color: rgba(214, 223, 255, 0.24);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .auth-screen {
        align-items: center;
    }

    .library-card {
        width: min(100%, 420px);
        padding: 32px 22px 22px;
        border-radius: 24px;
    }

    .library-card::after {
        inset: 9px;
        border-radius: 18px;
    }

    .library-card-header {
        margin-bottom: 24px;
    }

    .library-card-logo {
        font-size: 28px;
    }

    .library-card-stamp {
        width: 58px;
        height: 58px;
        top: 18px;
        right: 18px;
    }

    .auth-divider {
        margin: 4px 0 0;
    }
}

/* ── Action Bar (+ and Share) ── */
.action-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 18px;
}

.action-group {
    display: flex;
    align-items: center;
}

.action-group-secondary {
    gap: 10px;
}

.action-group-share {
    margin-left: 2px;
}

.mobile-utility-menu {
    display: none;
}

.action-btn {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    font-family: inherit;
    font-size: 12px;
    overflow: visible;
    position: relative;
    /* Staggered entrance */
    opacity: 0;
    transform: translateY(-12px) scale(0.9);
    animation: actionEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.action-btn-label {
    display: none;
}

.add-book-btn { animation-delay: 0.1s; }
.io-btn { animation-delay: 0.22s; }
.logout-btn { animation-delay: 0.28s; }
.share-btn { animation-delay: 0.38s; }

@keyframes actionEnter {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Shared hover/tap: squash & stretch */
.action-btn:hover {
    background: rgba(0, 0, 0, 0.55);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
}

.action-btn:active {
    animation: btnSquash 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes btnSquash {
    0% { transform: scale(1); }
    30% { transform: scale(0.88, 1.06); }
    60% { transform: scale(1.04, 0.96); }
    100% { transform: scale(1); }
}

/* ── Search ── */
.search-container {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.library-header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.library-header-tools .search-container {
    margin-left: 0;
}

.search-toggle-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.search-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
}

.utility-menu-toggle {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.utility-menu-toggle:hover,
.utility-menu-toggle.active {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.72);
}

.search-input-wrap {
    position: fixed;
    top: 72px;
    left: 20px;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    height: 42px;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 200;
    transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
}

.search-container.open .search-toggle-btn {
    opacity: 0;
    pointer-events: none;
}

.search-container.open .search-input-wrap {
    max-width: min(400px, calc(100vw - 40px));
    opacity: 1;
    pointer-events: auto;
}

.search-input-icon {
    flex-shrink: 0;
    margin-left: 12px;
    color: rgba(255,255,255,0.35);
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-family: inherit;
    padding: 0 8px;
    height: 100%;
    min-width: 0;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.search-clear-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    margin-right: 10px;
    transition: background 0.15s, color 0.15s;
}

.search-clear-btn:hover {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

/* Search result count badge */
.search-count {
    flex-shrink: 0;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-right: 8px;
    white-space: nowrap;
}

/* Grid items hidden by search */
.grid-item.search-hidden {
    display: none !important;
}

/* Shelf book highlight pulse */
@keyframes bookSearchPulse {
    0%, 100% { emissive: #000; }
    50% { emissive: #fff; }
}

/* ── Add Book Button ── */
.add-book-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.add-book-btn::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.22);
    opacity: 0;
    transform: scale(0.86);
    pointer-events: none;
}

.add-book-glyph {
    position: relative;
    width: 18px;
    height: 18px;
    display: block;
    transform-origin: 50% 50%;
    opacity: 0.94;
    transition:
        transform 0.16s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease;
}

.add-book-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
    transition:
        transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease;
}

.add-book-bar-v {
    transform: translate(-50%, -50%) rotate(90deg);
}

.add-book-bar-h {
    transform: translate(-50%, -50%);
}

.add-book-btn:hover .add-book-glyph {
    transform: rotate(3deg);
    opacity: 1;
}

.add-book-btn:active .add-book-glyph {
    transform: rotate(0deg) scale(0.94);
    opacity: 1;
}

.add-book-btn:active .add-book-bar-v {
    transform: translate(-50%, -50%) rotate(90deg);
}

.add-book-btn:active .add-book-bar-h {
    transform: translate(-50%, -50%);
}

.add-book-btn.launching::after {
    animation: addBookHalo 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.add-book-btn.active .add-book-glyph {
    transform: rotate(45deg) scale(1.02);
    opacity: 1;
}

.add-book-btn.active .add-book-bar-v {
    transform: translate(-50%, -50%) rotate(90deg);
}

.add-book-btn.active .add-book-bar-h {
    transform: translate(-50%, -50%);
}

.add-book-btn.active:hover .add-book-glyph {
    transform: rotate(45deg) scale(1.02);
}

.add-book-btn.active:active .add-book-glyph {
    transform: rotate(45deg) scale(0.96);
}

@keyframes addBookHalo {
    0% {
        opacity: 0;
        transform: scale(0.86);
    }
    32% {
        opacity: 0.52;
    }
    100% {
        opacity: 0;
        transform: scale(1.28);
    }
}

/* ── Share Button ── */
.share-btn {
    padding: 9px 16px;
    min-width: 108px;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.share-btn-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.share-icon,
.share-check {
    transition:
        transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease,
        color 0.16s ease;
}

.share-check {
    position: absolute;
    left: 0;
    opacity: 0;
    transform: translateY(3px) scale(0.92);
}

.share-label {
    transition:
        transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease,
        color 0.16s ease;
}

.share-btn:hover {
    transform: translateY(-1px);
}

.share-btn:hover .share-icon {
    transform: translateY(-1px);
}

.share-btn:hover .share-label {
    transform: translateX(1px);
}

.share-btn.copied .share-icon {
    opacity: 0;
    transform: translateY(-4px) scale(0.92);
}

.share-btn.copied .share-check {
    opacity: 1;
    transform: translateY(0) scale(1);
    color: rgba(214, 224, 198, 0.92);
}

.share-btn.copied .share-label {
    transform: translateX(2px);
    color: rgba(214, 224, 198, 0.92);
}

.share-btn.copied {
    border-color: rgba(214, 224, 198, 0.18);
    background: rgba(18, 24, 18, 0.46);
}

/* Share acknowledgement */
.share-btn.stamping {
    animation: sharePulse 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sharePulse {
    0% { transform: scale(1); }
    40% { transform: scale(0.97); }
    72% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

/* ── Add Book Modal ── */
.add-book-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    --add-launch-x: 0px;
    --add-launch-y: 0px;
    --add-origin-x: 50%;
    --add-origin-y: 50%;
}

.add-book-modal.is-open {
    pointer-events: auto;
}

.add-book-backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.add-book-modal.is-open .add-book-backdrop {
    opacity: 1;
}

.add-book-card {
    position: relative;
    width: min(520px, calc(100vw - 24px));
    max-height: 90vh;
    background: #111827;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 24px;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translate3d(var(--add-launch-x), var(--add-launch-y), 0) scale(0.84);
    transform-origin: var(--add-origin-x) var(--add-origin-y);
    transition:
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.22s ease;
}

.add-book-modal.is-open .add-book-card {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.add-step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.add-step-title {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

.add-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.add-close-btn:hover {
    color: rgba(255,255,255,0.6);
}

.add-capture-zone {
    border: 2px dashed rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255,255,255,0.02);
}

.add-capture-zone:hover {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.04);
}

.add-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.add-capture-icon {
    color: rgba(255,255,255,0.25);
    margin-bottom: 12px;
}

.add-capture-text {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 4px;
}

.add-capture-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.25);
}

.add-analyzing {
    text-align: center;
    padding: 16px 0;
}

.add-preview-img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 16px;
    background: rgba(0,0,0,0.3);
    overflow: hidden;
}

.add-preview-img img {
    width: 100%;
    height: 100%;
    max-height: 220px;
    object-fit: contain;
}

.add-analyzing-bar {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.add-analyzing-progress {
    width: 30%;
    height: 100%;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
    animation: analyzeSlide 1.5s ease-in-out infinite;
}

@keyframes analyzeSlide {
    0% { transform: translateX(-100%); width: 30%; }
    50% { width: 60%; }
    100% { transform: translateX(400%); width: 30%; }
}

.add-analyzing-text {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.5px;
}

.add-confirm-layout {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.add-preview-column {
    width: 148px;
    min-width: 148px;
    flex-shrink: 0;
}

.add-confirm-layout .add-preview-img {
    width: 148px;
    min-width: 148px;
    max-height: 220px;
    margin-bottom: 0;
}

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

.add-field-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.add-field-block-primary {
    grid-column: 1 / -1;
}

.add-field-helper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.add-field-helper-text {
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255,255,255,0.36);
}

.add-inline-action {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.82);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.add-inline-action:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
}

.add-field-label {
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}

.add-field-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 13px;
    color: #fff;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.add-field-input:focus {
    border-color: rgba(255,255,255,0.25);
}

.add-status-message {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    font-size: 12px;
    line-height: 1.45;
    color: rgba(232, 238, 255, 0.82);
}

.add-status-message.is-info {
    border-color: rgba(164, 190, 255, 0.12);
    background: rgba(33, 48, 86, 0.34);
}

.add-status-message.is-success {
    border-color: rgba(163, 206, 175, 0.16);
    background: rgba(20, 38, 28, 0.42);
    color: rgba(222, 240, 229, 0.9);
}

.add-status-message.is-warning {
    border-color: rgba(214, 186, 133, 0.16);
    background: rgba(48, 36, 16, 0.42);
    color: rgba(241, 226, 198, 0.92);
}

.add-status-message.is-error {
    border-color: rgba(218, 138, 138, 0.16);
    background: rgba(52, 20, 20, 0.42);
    color: rgba(245, 214, 214, 0.92);
}

.add-rescue-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.add-secondary-btn {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.78);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.add-secondary-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.16);
    transform: translateY(-1px);
}

.add-confirm-btn {
    width: 100%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.add-confirm-btn:hover {
    background: rgba(255,255,255,0.15);
}

.add-retake-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
}

.add-retake-btn:hover {
    color: rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
    .action-bar {
        display: none !important;
    }

    .mobile-utility-menu {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 180;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

    .mobile-utility-menu.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-utility-backdrop {
        position: absolute;
        inset: 0;
        border: 0;
        background: rgba(4, 8, 16, 0.18);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        opacity: 0;
        transition: opacity 0.18s ease;
    }

    .mobile-utility-menu.is-open .mobile-utility-backdrop {
        opacity: 1;
    }

    .mobile-utility-panel {
        position: absolute;
        top: calc(env(safe-area-inset-top, 0px) + 72px);
        right: 12px;
        width: min(320px, calc(100vw - 24px));
        padding: 12px;
        border-radius: 24px;
        background: rgba(7, 11, 21, 0.9);
        border: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 24px 60px rgba(0,0,0,0.38);
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
        transform: translateY(-8px) scale(0.98);
        opacity: 0;
        transition: transform 0.18s ease, opacity 0.18s ease;
    }

    .mobile-utility-menu.is-open .mobile-utility-panel {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    .mobile-utility-primary {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 16px 18px;
        border: 1px solid rgba(181, 198, 255, 0.12);
        border-radius: 18px;
        background: linear-gradient(180deg, rgba(22, 34, 60, 0.96), rgba(14, 22, 40, 0.94));
        color: rgba(248,250,255,0.94);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
        font: inherit;
        text-align: left;
    }

    .mobile-utility-primary-icon {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        background: rgba(255,255,255,0.06);
        color: rgba(255,255,255,0.92);
        flex-shrink: 0;
    }

    .mobile-utility-primary-copy {
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
    }

    .mobile-utility-primary-title {
        font-size: 16px;
        font-weight: 500;
        color: rgba(248,250,255,0.95);
    }

    .mobile-utility-primary-meta {
        font-size: 12px;
        color: rgba(214,223,255,0.48);
    }

    .mobile-utility-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 10px;
    }

    .mobile-utility-grid.single-tile {
        grid-template-columns: 1fr;
    }

    .mobile-utility-tile {
        width: 100%;
        min-height: 102px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 10px;
        padding: 16px;
        border: 1px solid rgba(255,255,255,0.07);
        border-radius: 18px;
        background: rgba(255,255,255,0.03);
        color: rgba(245,248,255,0.9);
        text-align: left;
        font: inherit;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    }

    .mobile-utility-tile svg {
        color: rgba(255,255,255,0.9);
    }

    .mobile-utility-tile-label {
        font-size: 14px;
        font-weight: 500;
        color: rgba(248,250,255,0.95);
    }

    .mobile-utility-tile-meta {
        font-size: 11px;
        color: rgba(214,223,255,0.42);
        margin-top: auto;
    }

    .mobile-utility-tile.is-copied {
        border-color: rgba(214, 224, 198, 0.16);
        background: rgba(18, 24, 18, 0.42);
    }

    .mobile-utility-tile.is-copied .mobile-utility-tile-label,
    .mobile-utility-tile.is-copied .mobile-utility-tile-meta {
        color: rgba(214, 224, 198, 0.92);
    }

    .mobile-utility-signout {
        width: 100%;
        margin-top: 10px;
        padding: 14px 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border: 1px solid rgba(255,255,255,0.06);
        border-radius: 18px;
        background: rgba(255,255,255,0.02);
        color: rgba(226,232,249,0.82);
        text-align: left;
        font: inherit;
    }

    .mobile-utility-signout-copy {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-utility-signout-label {
        font-size: 14px;
        font-weight: 500;
        color: rgba(248,250,255,0.88);
    }

    .mobile-utility-signout-meta {
        font-size: 11px;
        color: rgba(214,223,255,0.38);
    }

    .mobile-utility-primary,
    .mobile-utility-tile,
    .mobile-utility-signout {
        transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    }

    .mobile-utility-primary:active,
    .mobile-utility-tile:active,
    .mobile-utility-signout:active {
        transform: scale(0.985);
    }

    .mobile-utility-primary:hover,
    .mobile-utility-tile:hover,
    .mobile-utility-signout:hover {
        border-color: rgba(255,255,255,0.11);
    }

    .add-book-card {
        width: calc(100% - 24px);
        max-width: 520px;
        padding: 20px;
    }

    .add-confirm-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .add-preview-column {
        width: 100%;
        min-width: 0;
    }

    .add-confirm-layout .add-preview-img {
        width: 160px;
    }

    .add-confirm-fields,
    .add-rescue-actions {
        grid-template-columns: 1fr;
    }

    .add-field-helper {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Shelvd Logo ── */
.shelvd-logo {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255,255,255,0.25);
    letter-spacing: -0.04em;
    font-weight: 500;
    font-family: 'Helvetica Neue', Helvetica, -apple-system, sans-serif;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.shelvd-logo-books {
    overflow: visible;
    opacity: 0.5;
}

.shelvd-logo:hover {
    color: rgba(255,255,255,0.5);
}

body {
    background: #0a0f1a;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* ── 3D Container ── */
.library-3d-container {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #0a0f1a;
    overflow: hidden;
    z-index: 1;
}

#globe-view {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #0a0f1a;
    overflow: hidden;
    z-index: 1;
}

#globe-view canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.library-3d-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Loading ── */
.library-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: rgba(255,255,255,0.6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ── User Header ── */
.library-user-header {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 16px;
    z-index: 50;
    border-radius: 12px;
    max-width: 280px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.library-user-header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.library-user-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.library-user-username {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    line-height: 1.2;
}

.library-user-stats {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    line-height: 1.3;
}

/* ── View Toggle Pill ── */
.library-view-toggle-pill {
    display: flex;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.library-view-toggle-pill.hidden {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.library-view-toggle-pill .view-toggle {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 4px;
    position: relative;
    overflow: hidden;
}

.library-view-toggle-pill .view-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.library-view-toggle-pill .view-toggle label input[type="radio"] {
    display: none;
}

.library-view-toggle-pill .view-toggle .toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    transition: color 0.25s ease;
}

.library-view-toggle-pill .view-toggle .toggle-icon svg {
    width: 18px;
    height: 18px;
}

.library-view-toggle-pill .view-toggle label:hover {
    color: rgba(255, 255, 255, 0.7);
}

.library-view-toggle-pill .view-toggle label:has(input:checked) {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* ── Book Arrow (Swipe Up) ── */
.library-book-arrow {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.library-book-arrow.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.library-book-arrow-button {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    animation: arrowBounce 2s ease-in-out infinite;
}

.library-book-arrow-button:hover {
    background: rgba(255,255,255,0.2);
}

.library-book-arrow-button svg {
    width: 24px;
    height: 24px;
    stroke: rgba(255,255,255,0.8);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.library-book-arrow-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ── Stack Scrollbar ── */
.stack-scrollbar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 8px;
    height: 300px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.stack-scrollbar.visible {
    opacity: 1;
    pointer-events: auto;
}

.stack-scrollbar-track {
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    position: relative;
}

.stack-scrollbar-thumb {
    width: 100%;
    height: 60px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    position: absolute;
    top: 0;
    cursor: grab;
    transition: background 0.2s;
}

.stack-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.35);
}

.stack-scrollbar-thumb:active {
    background: rgba(0,0,0,0.5);
    cursor: grabbing;
}

/* ── Grid View ── */
.grid-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 2;
    background: #0a0f1a;
    overflow-y: auto;
    padding: 80px 24px 100px;
}

.grid-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.grid-book {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s;
    opacity: 0;
    animation: gridFadeIn 0.4s ease forwards;
}

.grid-book:hover {
    transform: translateY(-4px);
}

.grid-book-cover {
    width: 100%;
    aspect-ratio: 0.66;
    background: #111827;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.grid-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-book-cover .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    line-height: 1.3;
}

.grid-book-info {
    padding: 8px 2px;
}

.grid-book-title {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-book-author {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

.grid-book-meta {
    font-size: 10px;
    color: rgba(255,255,255,0.28);
    margin-top: 4px;
}

@keyframes gridFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Upload Spinner Overlay ── */
.add-upload-spinner {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(17, 24, 39, 0.85);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 2;
}

.add-upload-spinner-text {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
}

.add-step-capture {
    position: relative;
}

/* ── PWA Install Banner ── */
.pwa-install-banner {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    background: #111827;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 16px 20px;
    width: calc(100% - 32px);
    max-width: 380px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    animation: bannerSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bannerSlideUp {
    from { transform: translateX(-50%) translateY(100px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.pwa-install-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
}

.pwa-install-title {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.pwa-install-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
}

.pwa-install-btn {
    flex: 1;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.pwa-install-btn:hover {
    background: rgba(255,255,255,0.18);
}

.pwa-dismiss-btn {
    background: none;
    border: none;
    padding: 10px 14px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
}

.pwa-dismiss-btn:hover {
    color: rgba(255,255,255,0.5);
}

/* ── iOS Install Sheet ── */
.ios-install-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: #111827;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px 16px 0 0;
    padding: 20px 24px 32px;
    box-shadow: 0 -16px 48px rgba(0,0,0,0.5);
    animation: sheetSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.ios-install-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ios-install-title {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

.ios-install-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.ios-install-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    line-height: 1.4;
}

.ios-step strong {
    color: rgba(255,255,255,0.9);
}

.ios-step-num {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    flex-shrink: 0;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .shelvd-logo {
        display: none;
    }

    .library-user-header {
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 10px;
        border-radius: 0;
        background: rgba(5, 10, 18, 0.54);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .library-user-header-content {
        text-align: left;
        justify-content: space-between;
        align-items: center;
    }

    .library-user-header-left {
        align-items: flex-start;
        min-width: 0;
    }

    .library-header-tools {
        flex-shrink: 0;
    }

    .utility-menu-toggle {
        display: inline-flex;
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .search-toggle-btn {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .search-container.open + .utility-menu-toggle {
        opacity: 0;
        pointer-events: none;
    }

    .search-input-wrap {
        top: calc(env(safe-area-inset-top, 0px) + 60px);
        left: 12px;
        right: 12px;
    }

    .library-user-username { font-size: 12px; }
    .library-user-stats { font-size: 10px; }

    .stack-scrollbar {
        width: 12px;
        height: 60vh;
    }

    .stack-scrollbar-thumb {
        min-height: 44px;
    }

    .library-view-toggle-pill {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    }

    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 14px;
    }

    .grid-view {
        padding: 60px 16px 90px;
    }

    /* Globe is desktop-only */
    .globe-toggle-label {
        display: none !important;
    }
}

/* ── Add Book: Choose Method ── */
.add-choose-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 8px 0;
}
.add-choose-option {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 24px 12px; border-radius: 14px; cursor: pointer;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s, border-color 0.15s; text-align: center;
}
.add-choose-option:hover {
    background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15);
}
.add-choose-option-primary {
    border-color: rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.07);
}
.add-choose-icon { color: rgba(255,255,255,0.5); }
.add-choose-label {
    font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.85);
    font-family: "SF Pro Display", "Helvetica Neue", sans-serif;
}
.add-choose-desc {
    font-size: 11px; color: rgba(255,255,255,0.35); line-height: 1.3;
    font-family: "SF Pro Text", "Helvetica Neue", sans-serif;
}
.add-back-btn {
    font-size: 20px !important; padding: 4px 10px !important;
}

@media (max-width: 768px) {
    .add-choose-options {
        grid-template-columns: 1fr;
    }
}

/* ── Import/Export Modal ── */
.io-modal {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; align-items: center; justify-content: center;
}
.io-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.io-card {
    position: relative; z-index: 1;
    background: #141a2a; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 24px; width: 90%; max-width: 380px;
}
.io-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.io-title {
    font-size: 18px; font-weight: 600; color: rgba(255,255,255,0.9);
    font-family: "SF Pro Display", "Helvetica Neue", sans-serif;
}
.io-close {
    background: none; border: none; color: rgba(255,255,255,0.4);
    font-size: 24px; cursor: pointer; padding: 4px 8px; line-height: 1;
}
.io-close:hover { color: rgba(255,255,255,0.8); }
.io-options { display: flex; flex-direction: column; gap: 8px; }
.io-option {
    display: flex; align-items: center; gap: 14px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px; padding: 14px 16px; cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: left; width: 100%;
}
.io-option:hover {
    background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12);
}
.io-option-icon { color: rgba(255,255,255,0.5); flex-shrink: 0; }
.io-option-label {
    font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.85);
    font-family: "SF Pro Display", "Helvetica Neue", sans-serif;
}
.io-option-desc {
    font-size: 12px; color: rgba(255,255,255,0.35); margin-top: 2px;
    font-family: "SF Pro Text", "Helvetica Neue", sans-serif;
}
.io-progress { margin-top: 16px; }
.io-progress-text {
    font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 8px;
    font-family: "SF Pro Text", "Helvetica Neue", sans-serif;
}
.io-progress-bar {
    height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden;
}
.io-progress-fill {
    height: 100%; background: rgba(255,255,255,0.5); border-radius: 2px;
    width: 0%; transition: width 0.3s;
}

/* ── Barcode Scanner Modal ── */
.barcode-modal {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}
.barcode-modal-inner {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
}
.barcode-modal-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.barcode-modal-title {
    color: rgba(255,255,255,0.88);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.barcode-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}
.barcode-modal-close:hover { color: rgba(255,255,255,0.88); }
.barcode-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.barcode-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.barcode-box {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 72%;
    height: 30%;
    border: 2px solid rgba(255,255,255,0.7);
    border-radius: 6px;
    box-shadow: 0 0 0 2000px rgba(0,0,0,0.42);
}
.barcode-box::before,
.barcode-box::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: #fff;
    border-style: solid;
}
.barcode-box::before { top: -2px; left: -2px; border-width: 3px 0 0 3px; border-radius: 3px 0 0 0; }
.barcode-box::after  { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; border-radius: 0 0 3px 0; }
.barcode-hint {
    position: absolute;
    bottom: 12px;
    left: 0; right: 0;
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    letter-spacing: 0.02em;
}
.barcode-capture-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.88);
    border-radius: 24px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s;
}
.barcode-capture-btn:hover:not(:disabled) { background: rgba(255,255,255,0.2); }
.barcode-capture-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.barcode-status {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    text-align: center;
    min-height: 20px;
}

/* ═══════════════════════════════════════════════════════
   EDITORIAL LIGHT THEME — Criterion / Monocle
   Primary: #000000 · Secondary: #6e6e6e · Muted: #b3b3b3
   Type: DM Serif Display (headings) + existing sans (body)
   ═══════════════════════════════════════════════════════ */

/* Global */
body {
    background: #ffffff !important;
    color: #000000 !important;
}

/* ── Auth screen ── */
.auth-screen {
    background: #ffffff;
}
.auth-stars {
    display: none;
}

/* ── Library card — flat editorial card ── */
.library-card {
    background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.library-card::before { display: none !important; }
.library-card::after  { display: none !important; }

/* ── Logo & typography ── */
.library-card-header {
    text-align: center !important;
    margin-bottom: 32px !important;
}
.library-card-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-family: 'DM Serif Display', Georgia, serif !important;
    font-size: 26px !important;
    font-weight: 400 !important;
    color: #000000 !important;
    letter-spacing: -0.02em !important;
    text-shadow: none !important;
    margin-bottom: 6px !important;
}
.library-card-tagline {
    font-size: 13px !important;
    color: #b3b3b3 !important;
    margin: 0 !important;
    letter-spacing: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif !important;
}
.lc-books { opacity: 0.8 !important; color: #000000 !important; }
.library-card-subtitle { color: #6e6e6e !important; }
.library-card-number   { color: #b3b3b3 !important; }
.library-card-footer   { border-color: rgba(0,0,0,0.1) !important; }
.library-card-stamp    { display: none !important; }

/* ── Auth inputs ── */
.auth-label               { color: #6e6e6e !important; }
.auth-input               { background: transparent !important; border: none !important; color: #000000 !important; box-shadow: none !important; padding: 0 !important; flex: 1 !important; }
.auth-input:focus         { outline: none !important; background: transparent !important; box-shadow: none !important; }
.auth-input::placeholder  { color: #b3b3b3 !important; }

/* ── Auth field wrap (icon + input combined) ── */
.auth-field-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.14) !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    margin-bottom: 10px !important;
    transition: border-color 0.15s !important;
}
.auth-field-wrap:focus-within {
    border-color: rgba(0,0,0,0.4) !important;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06) !important;
}
.auth-field-icon { color: #b3b3b3 !important; flex-shrink: 0 !important; }

/* ── Auth buttons ── */
.auth-button              { background: #000000 !important; border-color: #000000 !important; color: #ffffff !important; box-shadow: none !important; border-radius: 10px !important; }
.auth-button:hover        { background: #222222 !important; border-color: #222222 !important; }
.auth-google-btn          { background: #ffffff !important; border: 1px solid rgba(0,0,0,0.14) !important; color: #000000 !important; box-shadow: none !important; border-radius: 10px !important; }
.auth-google-btn:hover    { background: #f9f9f9 !important; }
.auth-divider::before,
.auth-divider::after      { background: rgba(0,0,0,0.1) !important; }
.auth-divider span        { color: #b3b3b3 !important; }

/* ── Auth states ── */
.auth-check-text          { color: #000000 !important; }
.auth-check-sub           { color: #6e6e6e !important; }
.auth-check-sub strong    { color: #000000 !important; }
.auth-link-btn            { color: #6e6e6e !important; }
.auth-link-btn:hover      { color: #000000 !important; }
.auth-username-preview    { background: #f9f9f9 !important; border-color: rgba(0,0,0,0.1) !important; color: #6e6e6e !important; box-shadow: none !important; }
.auth-username-preview strong { color: #000000 !important; }
.auth-error               { color: #c0392b !important; }

/* ── App canvas containers ── */
.library-3d-container,
#globe-view { background: #ffffff !important; }

/* ── Shelvd logo (bottom-right) ── */
.shelvd-logo       { font-family: 'DM Serif Display', Georgia, serif !important; font-weight: 400 !important; color: #b3b3b3 !important; letter-spacing: -0.02em !important; }
.shelvd-logo:hover { color: #6e6e6e !important; }
.shelvd-logo-books { color: #000000 !important; opacity: 0.35; }

/* ── User header (top-left) ── */
.library-user-header    { background: rgba(255,255,255,0.9) !important; backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important; box-shadow: 0 1px 12px rgba(0,0,0,0.06) !important; border: 1px solid rgba(0,0,0,0.08) !important; }
.library-user-username  { font-family: 'DM Serif Display', Georgia, serif !important; font-size: 14px !important; font-weight: 400 !important; color: #000000 !important; letter-spacing: -0.01em !important; }
.library-user-stats     { color: #6e6e6e !important; }

/* ── Action Dropdown ── */
@keyframes adropItemIn {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}

.adrop-bar {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 50 !important;
}
@media (max-width: 768px) {
    .adrop-bar { display: none !important; }
}

.adrop { position: relative !important; display: inline-block !important; }

.adrop-trigger {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 8px 12px !important;
    background: rgba(255,255,255,0.92) !important;
    border: 1px solid rgba(0,0,0,0.09) !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    cursor: pointer !important;
    color: rgba(0,0,0,0.55) !important;
    transition: background 0.12s, box-shadow 0.12s, color 0.12s !important;
    outline: none !important;
    font-family: inherit !important;
}
.adrop-trigger:hover { background: #ffffff !important; box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important; color: #000 !important; }
.adrop-trigger .add-book-glyph .add-book-bar { background: currentColor !important; }

.adrop-chevron {
    color: rgba(0,0,0,0.3) !important;
    transition: transform 0.2s ease !important;
    flex-shrink: 0 !important;
}
.adrop.open .adrop-chevron { transform: rotate(180deg) !important; }

/* Dropdown menu */
.adrop-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    min-width: 168px !important;
    background: #ffffff !important;
    border: 1.5px solid rgba(0,0,0,0.1) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04) !important;
    overflow: hidden !important;
    z-index: 200 !important;
    /* closed state */
    opacity: 0 !important;
    transform: translateY(-8px) scale(0.97) !important;
    transform-origin: top right !important;
    pointer-events: none !important;
    transition: opacity 0.18s ease, transform 0.18s ease !important;
}
.adrop.open .adrop-menu {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
}

/* Stagger items when opening */
.adrop.open .adrop-item:nth-child(1) { animation: adropItemIn 0.2s ease both 0.02s !important; }
.adrop.open .adrop-item:nth-child(2) { animation: adropItemIn 0.2s ease both 0.06s !important; }
.adrop.open .adrop-item:nth-child(3) { animation: adropItemIn 0.2s ease both 0.10s !important; }
.adrop.open .adrop-item:nth-child(5) { animation: adropItemIn 0.2s ease both 0.14s !important; }

.adrop-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 10px 14px !important;
    background: none !important;
    border: none !important;
    border-bottom: 1.5px solid rgba(0,0,0,0.07) !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif !important;
    letter-spacing: -0.01em !important;
    color: #000000 !important;
    text-align: left !important;
    outline: none !important;
    transition: background 0.1s ease !important;
}
.adrop-item:last-child { border-bottom: none !important; }
.adrop-item:hover { background: rgba(0,0,0,0.04) !important; }
.adrop-item svg { color: rgba(0,0,0,0.4) !important; flex-shrink: 0 !important; }
.adrop-item:hover svg { color: #000000 !important; }

.adrop-divider {
    height: 1.5px !important;
    background: rgba(0,0,0,0.07) !important;
    margin: 0 !important;
}

/* Share button inner in dropdown */
.adrop-bar .share-btn-inner {
    display: flex !important; align-items: center !important; gap: 10px !important; width: 100% !important;
}
.adrop-bar .share-check { display: none !important; color: rgba(0,0,0,0.4) !important; }
.adrop-bar .share-label { color: #000000 !important; font-size: 13px !important; font-family: inherit !important; }
.adrop-bar .share-btn.copied .share-icon  { display: none !important; }
.adrop-bar .share-btn.copied .share-check { display: block !important; }

/* ── Search ── */
.search-toggle-btn,
.utility-menu-toggle        { background: rgba(255,255,255,0.92) !important; border-color: rgba(0,0,0,0.1) !important; color: #6e6e6e !important; }
.search-toggle-btn:hover,
.utility-menu-toggle:hover,
.utility-menu-toggle.active { background: #ffffff !important; border-color: rgba(0,0,0,0.2) !important; color: #000000 !important; }
.search-input-wrap          { background: #ffffff !important; border-color: rgba(0,0,0,0.12) !important; backdrop-filter: blur(16px) !important; box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important; }
.search-input               { color: #000000 !important; }
.search-input::placeholder  { color: #b3b3b3 !important; }
.search-input-icon          { color: #b3b3b3 !important; }
.search-clear-btn           { background: rgba(0,0,0,0.05) !important; color: #6e6e6e !important; }
.search-clear-btn:hover     { background: rgba(0,0,0,0.1) !important; color: #000000 !important; }
.search-count               { color: #b3b3b3 !important; }

/* ── View toggle pill (bottom-center) ── */
.library-view-toggle-pill .view-toggle                    { background: rgba(255,255,255,0.95) !important; border-color: rgba(0,0,0,0.1) !important; backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important; box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important; }
.library-view-toggle-pill .view-toggle label              { color: #b3b3b3 !important; }
.library-view-toggle-pill .view-toggle label:hover        { color: #6e6e6e !important; }
.library-view-toggle-pill .view-toggle label:has(input:checked) { background: rgba(0,0,0,0.06) !important; color: #000000 !important; }

/* ── Book arrow ── */
.library-book-arrow-button  { background: rgba(255,255,255,0.9) !important; border: 1px solid rgba(0,0,0,0.1) !important; color: #6e6e6e !important; }

/* ── Book Action Bar ── */
.book-action-bar {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 100px;
    padding: 7px 10px 7px 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
    white-space: nowrap;
    max-width: calc(100vw - 48px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    z-index: 100;
}
.book-action-bar.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.book-action-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 13px;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.book-action-delete {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: #b3b3b3;
    padding: 5px 8px;
    border-radius: 100px;
    transition: color 0.15s, background 0.15s;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 12px;
}
.book-action-delete:hover { color: #cc2200; background: rgba(204,34,0,0.06); }
.book-action-delete.confirming { color: #cc2200; background: rgba(204,34,0,0.08); }

/* ── Add book modal ── */
.add-book-backdrop  { background: rgba(255,255,255,0.75) !important; backdrop-filter: blur(8px) !important; -webkit-backdrop-filter: blur(8px) !important; }
.add-book-card      { background: #ffffff !important; border-color: rgba(0,0,0,0.08) !important; box-shadow: 0 24px 80px rgba(0,0,0,0.1) !important; }
.add-step-title     { color: #000000 !important; font-family: 'DM Serif Display', Georgia, serif !important; font-weight: 400 !important; }
.add-close-btn      { color: #b3b3b3 !important; }
.add-close-btn:hover { color: #000000 !important; }

.add-capture-zone        { border-color: rgba(0,0,0,0.12) !important; background: #f9f9f9 !important; }
.add-capture-zone:hover  { border-color: rgba(0,0,0,0.25) !important; background: #f3f3f3 !important; }
.add-capture-icon        { color: #b3b3b3 !important; }
.add-capture-text        { color: #000000 !important; }
.add-capture-sub         { color: #6e6e6e !important; }

.add-analyzing-bar      { background: rgba(0,0,0,0.07) !important; }
.add-analyzing-progress { background: rgba(0,0,0,0.3) !important; }
.add-analyzing-text     { color: #6e6e6e !important; }
.add-preview-img        { background: #f9f9f9 !important; }

.add-field-label            { color: #6e6e6e !important; }
.add-field-input            { background: #f9f9f9 !important; border-color: rgba(0,0,0,0.12) !important; color: #000000 !important; }
.add-field-input:focus      { border-color: rgba(0,0,0,0.35) !important; background: #ffffff !important; }
.add-field-input::placeholder { color: #b3b3b3 !important; }
.add-field-helper-text      { color: #6e6e6e !important; }
.add-inline-action          { border-color: rgba(0,0,0,0.15) !important; background: #f9f9f9 !important; color: #000000 !important; }
.add-inline-action:hover    { background: #f3f3f3 !important; }

.add-status-message         { border-color: rgba(0,0,0,0.08) !important; background: #f9f9f9 !important; color: #000000 !important; }
.add-status-message.is-info    { border-color: rgba(37,99,180,0.25) !important; background: rgba(37,99,180,0.05) !important; color: #000000 !important; }
.add-status-message.is-success { border-color: rgba(34,120,70,0.25) !important; background: rgba(34,120,70,0.05) !important; color: #000000 !important; }
.add-status-message.is-warning { border-color: rgba(160,100,20,0.25) !important; background: rgba(160,100,20,0.05) !important; color: #000000 !important; }
.add-status-message.is-error   { border-color: rgba(180,40,40,0.25) !important; background: rgba(180,40,40,0.05) !important; color: #000000 !important; }

.add-secondary-btn       { background: #f9f9f9 !important; border-color: rgba(0,0,0,0.12) !important; color: #000000 !important; }
.add-secondary-btn:hover { background: #f3f3f3 !important; border-color: rgba(0,0,0,0.2) !important; }
.add-confirm-btn         { background: #000000 !important; border-color: #000000 !important; color: #ffffff !important; }
.add-confirm-btn:hover   { background: #222222 !important; }
.add-retake-btn          { color: #6e6e6e !important; }

/* ── Add book modal — choose step (new structure) ── */
	.add-choose-option       { background: #f9f9f9 !important; border-color: rgba(0,0,0,0.1) !important; color: #000000 !important; }
	.add-choose-option-primary { background: #ffffff !important; border-color: rgba(0,0,0,0.22) !important; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04) !important; }
	.add-choose-option:hover { background: #f3f3f3 !important; border-color: rgba(0,0,0,0.2) !important; }
.add-choose-icon         { color: #b3b3b3 !important; }
.add-choose-label        { color: #000000 !important; font-family: inherit !important; }
.add-choose-desc         { color: #6e6e6e !important; font-family: inherit !important; }

/* ── Grid view ── */
.grid-view                       { background: #ffffff !important; }
.grid-book-cover                 { background: #f3f3f3 !important; }
.grid-book-cover .placeholder    { color: #b3b3b3 !important; }
.grid-book-title                 { color: #000000 !important; }
.grid-book-author                { color: #6e6e6e !important; }
.grid-book-meta                  { color: #b3b3b3 !important; }

/* ── Mobile utility menu — light theme ── */
.mobile-utility-panel {
    background: rgba(255,255,255,0.96) !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: 0 24px 60px rgba(0,0,0,0.14) !important;
}

.mobile-utility-primary {
    background: #f5f5f5 !important;
    border-color: rgba(0,0,0,0.08) !important;
    color: #000000 !important;
    box-shadow: none !important;
}
.mobile-utility-primary-icon {
    background: rgba(0,0,0,0.06) !important;
    color: #000000 !important;
}
.mobile-utility-primary-title { color: #000000 !important; }
.mobile-utility-primary-meta  { color: #6e6e6e !important; }

.mobile-utility-tile {
    background: #f5f5f5 !important;
    border-color: rgba(0,0,0,0.07) !important;
    color: #000000 !important;
    box-shadow: none !important;
}
.mobile-utility-tile svg        { color: rgba(0,0,0,0.5) !important; }
.mobile-utility-tile-label      { color: #000000 !important; }
.mobile-utility-tile-meta       { color: #6e6e6e !important; }
.mobile-utility-tile.is-copied  { background: rgba(0,0,0,0.04) !important; border-color: rgba(0,0,0,0.1) !important; }
.mobile-utility-tile.is-copied .mobile-utility-tile-label,
.mobile-utility-tile.is-copied .mobile-utility-tile-meta { color: #000000 !important; }

.mobile-utility-signout {
    background: #f5f5f5 !important;
    border-color: rgba(0,0,0,0.07) !important;
    color: #000000 !important;
}
.mobile-utility-signout-label { color: #000000 !important; }
.mobile-utility-signout-meta  { color: #6e6e6e !important; }

.mobile-utility-primary:active,
.mobile-utility-tile:active,
.mobile-utility-signout:active { background: #ebebeb !important; }

/* ── View Select ── */
.vselect { position: relative; }

.vselect-trigger {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 7px 10px 7px 14px;
    cursor: pointer;
    font-size: 13px; font-weight: 500;
    color: #000000; letter-spacing: -0.01em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    transition: background 0.1s, box-shadow 0.1s;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}
.vselect-trigger:hover { background: #ffffff; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.vselect-trigger-inner { display: flex; align-items: center; gap: 7px; }
.vselect-chevron { color: rgba(0,0,0,0.3); flex-shrink: 0; transition: transform 0.15s ease; }
.vselect.open .vselect-chevron { transform: rotate(180deg); }

.vselect-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px) scaleY(0.94);
    transform-origin: bottom center;
    min-width: 160px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.04);
    padding: 6px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
}
.vselect.open .vselect-dropdown {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scaleY(1);
    pointer-events: auto;
}

.vselect-hover-bg, .vselect-checked-bg {
    position: absolute; left: 6px; right: 6px;
    border-radius: 10px; pointer-events: none;
}
.vselect-hover-bg {
    background: rgba(0,0,0,0.04);
    opacity: 0;
    z-index: 0;
    transition: top 0.06s ease, height 0.06s ease, opacity 0.1s ease;
}
.vselect-checked-bg {
    background: rgba(0,0,0,0.06);
    z-index: 0;
    transition: top 0.2s cubic-bezier(0.34, 1.3, 0.64, 1), height 0.12s ease;
}

.vselect-item {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 8px 10px;
    border: none; border-radius: 10px;
    background: none; cursor: pointer; outline: none;
    font-size: 13px; letter-spacing: -0.01em;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    color: rgba(0,0,0,0.38);
    text-align: left;
    transition: color 0.08s ease;
}
.vselect-item.is-checked { color: #000000; font-weight: 500; }
.vselect-item:hover { color: #000000; }

.vselect-check {
    margin-left: auto; flex-shrink: 0;
    opacity: 0; transform: scale(0.6);
    transition: opacity 0.1s ease, transform 0.14s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.vselect-item.is-checked .vselect-check { opacity: 1; transform: scale(1); }

/* ── Import/Export Modal — light editorial theme ── */
.io-backdrop                { background: rgba(255,255,255,0.75) !important; backdrop-filter: blur(8px) !important; -webkit-backdrop-filter: blur(8px) !important; }
.io-card                    { background: #ffffff !important; border-color: rgba(0,0,0,0.08) !important; box-shadow: 0 24px 80px rgba(0,0,0,0.1) !important; }
.io-title                   { color: #000000 !important; font-family: 'DM Serif Display', Georgia, serif !important; font-weight: 400 !important; }
.io-close                   { color: #b3b3b3 !important; }
.io-close:hover             { color: #000000 !important; }
.io-option                  { background: #f9f9f9 !important; border-color: rgba(0,0,0,0.1) !important; }
.io-option:hover            { background: #f3f3f3 !important; border-color: rgba(0,0,0,0.2) !important; }
.io-option-icon             { color: #b3b3b3 !important; }
.io-option-label            { color: #000000 !important; font-family: inherit !important; }
.io-option-desc             { color: #6e6e6e !important; font-family: inherit !important; }
.io-progress-text           { color: #6e6e6e !important; }
.io-progress-bar            { background: rgba(0,0,0,0.07) !important; }
.io-progress-fill           { background: #000000 !important; }
