/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #8b5e3c;
    --primary-hover: #6d4a2e;
    --danger: #a63d2f;
    --danger-hover: #8b3122;
    --success: #5a7a4a;
    --warning: #c4956a;
    --gray-50: #faf6f1;
    --gray-100: #f3ece4;
    --gray-200: #e4d9cc;
    --gray-300: #d1c3b3;
    --gray-400: #ae9e8f;
    --gray-500: #8c7a6b;
    --gray-600: #736252;
    --gray-700: #5a4a3a;
    --gray-800: #4b3a2c;
    --gray-900: #3d2b1f;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(61,43,31,0.1), 0 1px 2px rgba(61,43,31,0.06);
    --shadow-md: 0 4px 6px rgba(61,43,31,0.1), 0 2px 4px rgba(61,43,31,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--gray-900);
    background: #faf6f1;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

main.container {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Navbar */
.navbar {
    background: #fffdf9;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-brand:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-links a {
    color: var(--gray-700);
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: var(--primary);
    text-decoration: none;
}

.nav-links a.btn:not(.btn-outline) {
    color: white;
}

.nav-links a.btn:not(.btn-outline):hover {
    color: white;
}

/* Hamburger button — hidden on desktop */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-700);
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.nav-hamburger:hover,
.nav-hamburger-active {
    background: var(--gray-100);
    color: var(--primary);
}

/* Profile dropdown menu */
.profile-menu {
    position: relative;
}

.profile-menu-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.profile-menu-badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.3rem;
    font-size: 0.6rem;
    line-height: 1rem;
}

.profile-menu-toggle:hover {
    background: var(--primary);
    color: white;
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 200px;
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 200;
    padding: 0.5rem 0;
}

.profile-dropdown.open {
    display: block;
}

.profile-dropdown-name {
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 0.25rem;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--gray-700);
    transition: background 0.1s;
}

.profile-dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary);
    text-decoration: none;
}

.profile-dropdown-divider {
    border: none;
    border-top: 1px solid var(--gray-100);
    margin: 0.25rem 0;
}

.profile-dropdown-logout {
    color: var(--danger);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.profile-dropdown-logout:hover {
    background: #f5ddd8;
    color: var(--danger);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
    background: var(--primary);
    color: white;
}

.btn:hover {
    background: var(--primary-hover);
    text-decoration: none;
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fdf0ed;
    color: var(--danger);
    border: 1px solid #f0c9c0;
}

.alert-success {
    background: #f2f5ef;
    color: var(--success);
    border: 1px solid #c8d6b8;
}

.alert-info {
    background: #f5f0e8;
    color: var(--primary);
    border: 1px solid var(--gray-300);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.15);
}

/* Cards */
.card {
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card + .card {
    margin-top: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Auth pages */
.auth-container {
    max-width: 400px;
    margin: 3rem auto;
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-container .card {
    padding: 2rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--gray-500);
}
.auth-legal {
    text-align: center;
    margin-top: 0.85rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}
.auth-legal a {
    color: var(--gray-400);
    text-decoration: underline;
}

/* Username picker on signup */
.username-choices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.username-choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-700);
}

.username-choice:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.username-choice input[type="radio"] {
    accent-color: var(--primary);
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

.username-choice:has(input:checked) {
    border-color: var(--primary);
    background: #f5ead8;
    color: var(--gray-900);
}

/* Dashboard top upload button */
.dashboard-top {
    text-align: center;
    margin-bottom: 1.5rem;
}

.upload-shelf-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary), #a0714e);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(139, 94, 60, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.upload-shelf-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(139, 94, 60, 0.45);
    text-decoration: none;
    color: white;
}

.upload-shelf-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    font-size: 1.1rem;
    line-height: 1;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
}

/* Profile header */
.profile-header {
    margin-bottom: 1.5rem;
}

.profile-header h1 {
    font-size: 1.75rem;
}

.profile-stats {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.4rem;
}

.profile-stats-sep {
    color: var(--gray-300);
}
.profile-stats-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
}
.profile-stats-link:hover {
    text-decoration: underline;
    color: var(--primary);
}
.profile-member-since {
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.owner-link {
    color: inherit;
    text-decoration: none;
}
.owner-link:hover {
    text-decoration: underline;
}

.profile-section-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-top: 0.85rem;
    margin-bottom: 0.4rem;
}

.profile-list-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: var(--gray-900);
    transition: background 0.1s;
}
.profile-list-row:last-child { border-bottom: none; }
.profile-list-row:hover { color: var(--primary); text-decoration: none; }
.profile-list-name { font-weight: 500; font-size: 0.95rem; }
.profile-list-count { font-size: 0.82rem; color: var(--gray-400); white-space: nowrap; }
.profile-list-row:hover .profile-list-count { color: var(--primary); }

.follow-btn {
    display: inline-block;
    vertical-align: middle;
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1.5px solid var(--primary);
    border-radius: 999px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.follow-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.follow-btn-following {
    background: transparent;
    color: var(--primary);
}

.follow-btn-following:hover {
    background: #f5ddd8;
    border-color: var(--danger);
    color: var(--danger);
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Shelf card */
.shelf-card {
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s;
}

.shelf-card:hover {
    box-shadow: var(--shadow-md);
}

.shelf-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.shelf-card-body {
    padding: 1rem;
}

.shelf-card-body h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.shelf-card-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Recommendation shelf header */
.rec-shelf-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rec-shelf-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    flex-shrink: 0;
}

/* Rename inline form */
.rename-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rename-input {
    flex: 1;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
}

.rename-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.15);
}

/* Shelf detail */
.shelf-img-card {
    padding: 0;
    overflow: hidden;
    margin-bottom: 1rem;
}

.shelf-detail-img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 0;
    background: var(--gray-100);
    margin-bottom: 0;
    display: block;
}

.shelf-img-card .lightbox-wrap {
    margin-bottom: 0;
}

.shelf-header-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

.shelf-like-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 0.88rem;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.shelf-like-btn:hover { color: #e05c6a; background: #fdf0f1; }
.shelf-like-btn--liked { color: #e05c6a; }

.shelf-like-static {
    font-size: 0.88rem;
    color: var(--gray-400);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Book list */
.book-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.book-item:last-child {
    border-bottom: none;
}

.book-item--reading .book-title::before {
    content: "· ";
    color: var(--primary);
    font-size: 1.6rem;
    line-height: 0;
    vertical-align: -0.2rem;
}

.reading-remove-btn {
    background: none;
    border: none;
    color: var(--gray-300);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.15rem 0.3rem;
    cursor: pointer;
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.book-item--reading:hover .reading-remove-btn {
    opacity: 1;
}

.reading-remove-btn:hover {
    color: var(--danger);
}

.book-title {
    font-weight: 600;
}

.book-author {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.book-links {
    display: flex;
    gap: 0.75rem;
    white-space: nowrap;
    font-size: 0.8rem;
}

.book-link {
    font-size: 0.8rem;
    white-space: nowrap;
}

.book-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Three-dot book menu */
.book-menu {
    position: relative;
}

.book-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-500);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.book-menu-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.book-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    min-width: 200px;
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 50;
    padding: 0.25rem 0;
}

.book-menu-dropdown.open {
    display: block;
}

.book-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--gray-700);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.1s;
}

.book-menu-item:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.book-menu-item-danger:hover {
    background: #f5ddd8;
    color: var(--danger);
}

/* Recommendations */
.rec-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.rec-item:last-child {
    border-bottom: none;
}

.rec-reason {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Status badge */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pending {
    background: #f5ead8;
    color: #7a5c2e;
}

.badge-processing {
    background: #eae0d2;
    color: #6d4a2e;
}

.badge-done {
    background: #e8eed8;
    color: #4a6434;
}

.badge-failed {
    background: #f5ddd8;
    color: #8b3122;
}

.badge-public {
    background: #e8eed8;
    color: #4a6434;
}

.badge-private {
    background: var(--gray-100);
    color: var(--gray-700);
}

.badge-status {
    font-size: 0.72rem;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.badge-status-want_to_read {
    background: #eae0d2;
    color: #6d4a2e;
}

.badge-status-reading {
    background: #dde8f0;
    color: #2e5a7a;
}

.badge-status-finished {
    background: #e8eed8;
    color: #4a6434;
}

.book-status-form {
    display: inline-flex;
    align-items: center;
}

.book-status-select {
    font-size: 0.78rem;
    padding: 0.25rem 1.6rem 0.25rem 0.6rem;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    background: #fffdf9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238c7a6b'/%3E%3C/svg%3E") no-repeat right 0.55rem center;
    background-size: 8px;
    appearance: none;
    -webkit-appearance: none;
    color: var(--gray-700);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.book-status-select:hover {
    border-color: var(--primary);
}

.book-status-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.15);
}

/* Book count badge in heading */
.book-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.45rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.4rem;
}

/* Status dot for owner book list */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
    flex-shrink: 0;
}

.status-dot-reading     { background: #2e5a7a; }
.status-dot-finished    { background: #4a6434; }
.status-dot-want_to_read { background: #8b5e3c; }

/* Save to Want to Read button */
.save-book-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-400, #b0a090);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.save-book-btn:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.save-book-btn.saved {
    color: var(--primary);
}

.save-book-btn.saved:hover {
    color: var(--danger);
    background: #f5ddd8;
}

.save-book-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.save-book-btn .icon-saved { display: none; }
.save-book-btn.saved .icon-unsaved { display: none; }
.save-book-btn.saved .icon-saved { display: block; }

/* Comments */
.comment {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.comment-text {
    font-size: 0.9rem;
}

/* Upload area */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: #f5ead8;
}

.upload-area p {
    color: var(--gray-500);
    margin-top: 0.5rem;
}

.upload-preview {
    max-width: 100%;
    max-height: 300px;
    margin-top: 1rem;
    border-radius: var(--radius);
    display: none;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Processing animation overlay */
.processing-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(250, 246, 241, 0.92);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.processing-overlay.active {
    display: flex;
}

.processing-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: processingFadeIn 0.4s ease-out;
}

@keyframes processingFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.processing-animation {
    max-width: 340px;
    width: 80vw;
    height: auto;
    border-radius: 12px;
}

.processing-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gray-700);
    letter-spacing: 0.01em;
}

/* Footer */
.footer {
    background: var(--gray-900);
    border-top: none;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-300);
    margin-top: auto;
}
.footer-legal {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--gray-400);
}
.footer-legal a {
    color: var(--gray-400);
    text-decoration: none;
}
.footer-legal a:hover {
    color: var(--gray-200);
    text-decoration: underline;
}

.footer--minimal {
    background: transparent;
    padding: 0.75rem 0;
}
.footer-contact-link {
    font-size: 0.78rem;
    color: var(--gray-400);
    text-decoration: none;
}
.footer-contact-link:hover {
    color: var(--gray-600);
    text-decoration: underline;
}

/* Legal pages (privacy, terms) */
.legal-page {
    max-width: 740px;
    margin: 2.5rem auto 4rem;
    padding: 0 1rem;
    line-height: 1.75;
    color: var(--gray-900);
}
.legal-page h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}
.legal-page .legal-meta {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}
.legal-page h2 {
    font-size: 1.1rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}
.legal-page p,
.legal-page ul {
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}
.legal-page ul {
    padding-left: 1.5rem;
}
.legal-page a {
    color: var(--primary);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* Welcome hero (first-time dashboard) */
.welcome-hero {
    text-align: center;
    max-width: 640px;
    margin: 1rem auto 0;
    padding: 2.5rem 1.5rem 2rem;
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.welcome-hero h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 0.35rem;
}

.welcome-subtitle {
    color: var(--gray-500);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.welcome-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.welcome-step {
    padding: 1rem 0.75rem;
    border-radius: var(--radius);
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
}

.welcome-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.welcome-step h4 {
    font-size: 0.9rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.welcome-step p {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.45;
}

.welcome-cta {
    padding: 0.7rem 2rem;
    font-size: 1rem;
    margin-top: 2rem;
    background: #5e8f4e;
    border-color: #5e8f4e;
}
.welcome-cta:hover {
    background: #4d7840;
    border-color: #4d7840;
}

.welcome-hint {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.example-shelf-figure {
    margin: 2rem 0 0;
    padding: 0;
    text-align: center;
}

/* Carousel */
.shelf-carousel {
    position: relative;
    max-width: 560px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.shelf-carousel__track {
    display: flex;
    transition: transform 0.35s ease;
}

.shelf-carousel__slide {
    min-width: 100%;
}

.shelf-carousel__slide .lightbox-wrap {
    display: block;
    margin-bottom: 0;
}

.example-shelf-img {
    width: 100%;
    display: block;
}

.shelf-carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-700);
    box-shadow: var(--shadow-md);
    transition: background 0.15s;
}

.shelf-carousel__btn:hover { background: #fff; }
.shelf-carousel__btn--prev { left: 0.5rem; }
.shelf-carousel__btn--next { right: 0.5rem; }

.shelf-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.shelf-carousel__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    border: none;
    background: var(--gray-300);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.shelf-carousel__dot--active { background: var(--primary); }

.shelf-carousel__caption {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--gray-500);
    font-style: italic;
}

@media (max-width: 640px) {
    .welcome-steps {
        grid-template-columns: 1fr;
    }
}

/* Genre pill list on public profile */
.genre-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
}

.genre-tag {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--gray-700);
    background: var(--gray-50);
}

/* Edit profile (wider than auth) */
.edit-profile-container {
    max-width: 640px;
    margin: 3rem auto;
}

@media (min-width: 900px) {
    .edit-profile-container {
        max-width: 960px;
    }

    .avatar-picker-section {
        margin-left: -2rem;
        margin-right: -2rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

.edit-profile-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.edit-profile-container .card {
    padding: 2rem;
}

/* Genre picker */
.genre-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.genre-chip {
    padding: 0.4rem 0.9rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 999px;
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    background: white;
}

.genre-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.genre-chip.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Notification badge */
.notification-badge {
    display: inline-block;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    min-width: 1.1rem;
    text-align: center;
    line-height: 1.3;
    vertical-align: super;
}

/* Notification unread highlight */
.notification-unread {
    border-left: 3px solid var(--primary);
}

/* Discover page */
.discover-subtitle {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 0.15rem;
    margin-bottom: 1.5rem;
}

.discover-section {
    margin-bottom: 2.25rem;
}

.discover-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.discover-section-title i {
    color: var(--primary);
    font-size: 0.95rem;
}

/* Currently Reading horizontal scroll */
.discover-reading-scroll {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    padding: 0.2rem 0.1rem 0.85rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.discover-reading-scroll::-webkit-scrollbar {
    height: 4px;
}

.discover-reading-scroll::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 2px;
}

.discover-reading-scroll::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.discover-reading-card {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 175px;
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}

.discover-reading-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}

.discover-reading-spine {
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, #c49a6c 100%);
    flex-shrink: 0;
}

.discover-reading-body {
    padding: 0.85rem 0.85rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.discover-reading-book-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.discover-reading-book-author {
    font-size: 0.78rem;
    color: var(--gray-500);
    font-style: italic;
    margin: 0;
}

.discover-reading-who {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
    margin-top: auto;
    padding-top: 0.5rem;
}

/* Explore shuffle button */
.discover-explore-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.85rem;
}

.discover-shuffle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.83rem;
    color: var(--gray-500);
    text-decoration: none;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: color 0.15s, border-color 0.15s;
}

.discover-shuffle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    text-decoration: none;
}

/* Following shelves pagination */
.feed-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.feed-pagination-info {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* Feed tabs */
.feed-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.feed-tab {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.feed-tab:hover {
    color: var(--gray-700);
    text-decoration: none;
}

.feed-tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Feed grid */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 860px) {
    .feed-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
    .feed-grid { grid-template-columns: 1fr; }
}

.feed-item {
    display: flex;
    flex-direction: column;
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s;
}

.feed-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.feed-item-img-link {
    display: block;
}

.feed-item-img-link img {
    display: block;
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.feed-item .shelf-card-body {
    flex: 1;
}

.feed-item-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.feed-item-shelf-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-900);
    margin-bottom: 0.1rem;
}

.feed-item-owner {
    display: block;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.feed-item-owner:hover { text-decoration: underline; }

.feed-item-date {
    display: block;
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-top: 0.1rem;
}

.feed-like-form { margin: 0; }

.feed-like-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 1rem;
    padding: 0.2rem 0.3rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
    flex-shrink: 0;
}

.feed-like-btn:hover { color: #e05c6a; background: #fdf0f1; }
.feed-like-btn--liked { color: #e05c6a; }
.feed-like-btn--liked i { color: #e05c6a; }

.feed-like-count {
    font-size: 0.72rem;
    color: var(--gray-500);
}

.feed-like-static {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.78rem;
    color: var(--gray-400);
    flex-shrink: 0;
    padding: 0.2rem 0.3rem;
}


/* Shelf description */
.shelf-description-block {
    margin-bottom: 1.25rem;
}

.shelf-description-text {
    color: var(--gray-700);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 0.35rem;
}

.shelf-description-add-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 0.85rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.shelf-description-add-btn:hover { color: var(--primary); }

.shelf-description-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 0.85rem;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    line-height: 1;
}

.shelf-description-edit-btn:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.desc-form {
    margin-top: 0.65rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
}

.desc-textarea {
    width: 100%;
    min-height: 80px;
    resize: none;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--gray-200);
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.92rem;
    font-family: inherit;
    font-style: italic;
    line-height: 1.65;
    color: var(--gray-700);
    background: #fffdf9;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.desc-textarea::placeholder {
    color: var(--gray-300);
    font-style: italic;
}

.desc-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.12);
}

.desc-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.65rem;
}

.desc-char-count {
    font-size: 0.75rem;
    color: var(--gray-300);
}

/* Feed card description caption */
.feed-item-desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    line-height: 1.4;
    margin: 0.2rem 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Like section */
.like-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Lightbox */
.lightbox-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-bottom: 1.5rem;
}

.lightbox-wrap .shelf-detail-img {
    margin-bottom: 0;
}

.lightbox-trigger {
    cursor: zoom-in;
}

.lightbox-hint {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: rgba(255, 255, 255, 0.8);
    color: var(--gray-700);
    border-radius: 50%;
    opacity: 0.6;
    transition: opacity 0.2s;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.lightbox-wrap:hover .lightbox-hint {
    opacity: 1;
}

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(61, 43, 31, 0.9);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-img {
    max-width: 95%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* Landing page */
.landing {
    max-width: 1100px;
    margin: 0 auto;
}

.landing-hero {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: center;
    padding: 4rem 1rem 3.5rem;
}

.landing-hero-text {
    text-align: left;
}

.landing-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

.landing-hero-login {
    margin-top: 0.85rem;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.landing-hero-login a {
    color: var(--primary);
    text-decoration: underline;
}

.landing-hero h1 {
    font-size: 2.2rem;
    line-height: 1.12;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.landing-hero-sub {
    font-size: 1.1rem;
    color: var(--gray-500);
    margin: 0 0 2rem;
    line-height: 1.6;
}

.landing-hero-actions {
    display: flex;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.landing-btn-primary {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background: #5e8f4e;
    border-color: #5e8f4e;
    box-shadow: 0 2px 8px rgba(94, 143, 78, 0.35);
}

.landing-btn-primary:hover {
    background: #4d7840;
    border-color: #4d7840;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(94, 143, 78, 0.45);
}

.landing-btn-secondary {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

.landing-section-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.landing-steps {
    padding: 2.5rem 0;
    border-top: 1px solid var(--gray-200);
}

.landing-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.landing-step {
    text-align: center;
    padding: 1.5rem 1rem;
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.landing-step-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.landing-step h3 {
    font-size: 1rem;
    color: var(--gray-900);
    margin-bottom: 0.35rem;
}

.landing-step p {
    font-size: 0.88rem;
    color: var(--gray-500);
    line-height: 1.5;
}

.landing-features {
    padding: 2.5rem 0;
    border-top: 1px solid var(--gray-200);
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.landing-feature {
    padding: 1.25rem;
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.landing-feature-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    display: block;
}

.landing-feature h3 {
    font-size: 1.1rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.landing-feature p {
    font-size: 0.98rem;
    color: var(--gray-500);
    line-height: 1.5;
}

.landing-pillar-label {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.4rem;
}

.landing-community {
    padding: 2.5rem 0;
    border-top: 1px solid var(--gray-200);
}

.landing-cta {
    text-align: center;
    padding: 2.5rem 1rem 3rem;
    border-top: 1px solid var(--gray-200);
}

.landing-cta h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.landing-cta p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    .landing-hero {
        grid-template-columns: 1fr;
    }

    .landing-hero-text {
        text-align: center;
    }

    .landing-hero-actions {
        justify-content: center;
    }

    .landing-hero-image {
        order: -1;
    }

    .landing-hero h1 {
        font-size: 1.75rem;
    }

    .landing-hero-sub {
        font-size: 1rem;
    }

    .landing-steps-grid {
        grid-template-columns: 1fr;
    }

    .landing-features-grid {
        grid-template-columns: 1fr;
    }
}

/* List picker popover */
.list-picker-wrap {
    position: relative;
}

.list-picker-pop {
    position: absolute;
    left: 0;
    top: calc(100% + 0.3rem);
    min-width: 200px;
    max-width: 260px;
    max-height: 380px;
    overflow-y: auto;
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 200;
    padding: 0.35rem 0;
}

.list-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

.list-picker-item:hover {
    background: var(--gray-50);
}

.list-picker-item input[type="checkbox"] {
    accent-color: var(--primary);
    width: 0.9rem;
    height: 0.9rem;
    flex-shrink: 0;
    cursor: pointer;
}

.list-picker-new-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-top: 1px solid var(--gray-100);
    margin-top: 0.25rem;
}

.list-picker-new-input {
    flex: 1;
    min-width: 0;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-family: inherit;
}

.list-picker-new-input:focus {
    outline: none;
    border-color: var(--primary);
}

.list-picker-create-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
}

.list-picker-create-btn:hover {
    background: var(--primary-hover);
}

.list-picker-section-label {
    padding: 0.3rem 0.75rem 0.15rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-400);
}

.list-picker-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.3rem 0;
}

.list-picker-action {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    border: none;
    background: none;
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    color: var(--gray-700);
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}

.list-picker-action:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.list-picker-action:disabled {
    opacity: 0.5;
    cursor: default;
}

.list-picker-action i {
    font-size: 0.9rem;
    width: 1rem;
    text-align: center;
}

.list-picker-empty {
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    color: var(--gray-500);
    font-style: italic;
}

/* My Lists explainer */
.lists-explainer {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.lists-explainer-titlerow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.lists-explainer-titlerow:hover .lists-explainer-title {
    color: var(--gray-700);
}

.lists-explainer-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.15s;
}

.lists-explainer-titlerow .bi-chevron-up,
.lists-explainer-titlerow .bi-chevron-down {
    color: var(--gray-400);
    font-size: 0.85rem;
    transition: color 0.15s;
}

.lists-explainer-titlerow:hover .bi-chevron-up,
.lists-explainer-titlerow:hover .bi-chevron-down {
    color: var(--gray-700);
}

.lists-explainer-lead {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.lists-explainer-tips {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.lists-explainer-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-500);
}

@media (max-width: 640px) {
    .lists-explainer {
        padding: 0.85rem 1rem;
    }
}

/* My Lists page */
.lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.list-card {
    display: flex;
    flex-direction: column;
    background: #fffdf9;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.list-card:hover {
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.list-card--default {
    border-left: 3px solid var(--primary);
    background: #fffcf7;
}

.list-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}

.list-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-900);
    line-height: 1.3;
}

.list-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
}

.list-card-count-text {
    font-size: 0.82rem;
    color: var(--gray-500);
}

.list-card-preview {
    list-style: none;
    font-size: 0.82rem;
    color: var(--gray-700);
    line-height: 1.5;
}

.list-card-preview li {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-card-empty {
    font-size: 0.82rem;
    color: var(--gray-500);
    font-style: italic;
}

/* List detail manual add row */
.list-add-row {
    padding: 0.5rem 0 0.25rem;
    border-top: 1px solid var(--gray-100);
    margin-top: 0.25rem;
}

.list-add-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    font-size: 0.85rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.2rem 0;
    font-family: inherit;
    transition: color 0.15s;
}

.list-add-trigger:hover {
    color: var(--primary);
}

.list-add-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* List detail remove button */
.list-detail-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-500);
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.list-detail-remove:hover {
    background: #f5ddd8;
    color: var(--danger);
}

/* ===== Book Status Tags ===== */

.book-status-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.book-status-tag--reading {
    background: #e8f0fe;
    color: #3367d6;
}

.book-status-tag--finished {
    background: #e6f4ea;
    color: var(--success);
}

/* Discover — People tab */
.people-card {
    margin-top: 0.5rem;
}

.people-row {
    align-items: center;
}

.people-name {
    font-weight: 600;
    color: var(--gray-900);
    text-decoration: none;
}

.people-name:hover {
    color: var(--primary);
}

.people-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    gap: 0.3rem;
    align-items: center;
    margin-top: 0.1rem;
}

.people-meta-sep {
    color: var(--gray-300);
}

.people-bio {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-top: 0.15rem;
}

/* ===== Book Clubs index ===== */

.clubs-section-header {
    margin-top: 1.5rem;
    margin-bottom: 0.65rem;
}

.clubs-section-heading {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}

.clubs-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 0;
}

.clubs-empty-inline {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0.25rem 0 1.5rem;
}

.clubs-discover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.clubs-search-form {
    display: flex;
}

.clubs-search-bar {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    gap: 0.4rem;
    background: #fff;
    transition: border-color 0.15s;
}

.clubs-search-bar:focus-within {
    border-color: var(--primary);
}

.clubs-search-icon {
    color: var(--gray-400);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.clubs-search-input {
    border: none;
    outline: none;
    font-size: 0.875rem;
    width: 180px;
    background: transparent;
    color: var(--gray-900);
}

.clubs-search-input::placeholder {
    color: var(--gray-400);
}

.clubs-search-clear {
    color: var(--gray-400);
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.15s;
}

.clubs-search-clear:hover {
    color: var(--gray-700);
}

/* ===== Book Clubs ===== */

.club-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.club-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.club-card-meta {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.club-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 500;
}

.club-badge--public {
    background: #d4edda;
    color: var(--success);
}

.club-badge--private {
    background: var(--gray-200);
    color: var(--gray-700);
}

.club-vote-btn {
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--gray-700);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.club-vote-btn:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    color: var(--primary);
}

.club-vote-btn--voted {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.club-vote-btn--voted:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.club-message {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.club-message:last-child {
    border-bottom: none;
}

.club-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.club-delete-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.3;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
    border-radius: var(--radius);
}

.club-message:hover .club-delete-btn,
.club-suggestion-row:hover .club-delete-btn {
    opacity: 1;
}

.club-delete-btn:hover {
    color: var(--danger);
    background: var(--gray-100);
}

@media (hover: none) {
    .club-delete-btn {
        opacity: 0.5;
    }
}

/* ── Report button (flag icon) ── */
.report-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
    border-radius: var(--radius);
}

.comment:hover .report-btn,
.club-message:hover .report-btn {
    opacity: 1;
}

.report-btn:hover {
    color: var(--danger);
    background: var(--gray-100);
    opacity: 1;
}

@media (hover: none) {
    .report-btn { opacity: 0.5; }
}

/* report button when not in a hover-parent (e.g. profile page) */
.report-btn--visible {
    opacity: 1;
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* ── Report modal ── */
.report-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.report-modal-overlay.report-modal-open {
    display: flex;
}

.report-modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--gray-200);
}

.report-modal-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.report-modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-500);
    cursor: pointer;
    line-height: 1;
    padding: 0.1rem 0.3rem;
    border-radius: var(--radius);
}
.report-modal-close:hover { background: var(--gray-100); color: var(--gray-900); }

.report-modal-body {
    padding: 1rem 1.1rem;
}

.report-modal-footer {
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.form-select {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--gray-900);
    background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237a7a7a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2rem;
}
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.12);
}

.form-textarea {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--gray-900);
    resize: vertical;
    min-height: 70px;
}
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.12);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--gray-700);
}

.form-group {
    margin-bottom: 0.9rem;
}
.form-group:last-child { margin-bottom: 0; }

.club-message-text {
    font-size: 0.95rem;
    color: var(--gray-900);
    white-space: pre-wrap;
    word-break: break-word;
}

.club-pending-banner {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.club-pending-banner-text {
    font-size: 0.95rem;
    color: var(--gray-900);
}

.club-pending-actions {
    display: flex;
    gap: 0.5rem;
}

.club-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.club-suggestion-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.club-suggestion-row:last-child {
    border-bottom: none;
}

.club-suggestion-info {
    flex: 1;
    min-width: 0;
}

.club-suggestion-title {
    font-weight: 500;
    color: var(--gray-900);
}

.club-suggestion-author {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.club-suggestion-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Club unread badge */
.club-unread-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    line-height: 1.6;
}

/* Club two-column chat grid */
.club-chat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.club-chat-grid .card + .card {
    margin-top: 0;
}

.club-preview-col {
    display: flex;
    flex-direction: column;
}

.club-preview-messages {
    flex: 1;
    margin-bottom: 0.75rem;
    max-height: 20rem;
    overflow-y: auto;
}

.club-view-all-link {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.club-view-all-link:hover {
    text-decoration: underline;
}

.club-quick-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    border-top: 1px solid var(--gray-200);
    padding-top: 0.75rem;
}

.club-quick-input-row textarea {
    flex: 1;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    resize: none;
    overflow-y: hidden;
    line-height: 1.5;
    max-height: 6rem;
    font-family: inherit;
}

.club-breadcrumb {
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.club-breadcrumb a {
    color: var(--gray-500);
    text-decoration: none;
}

.club-breadcrumb a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.club-breadcrumb span {
    margin: 0 0.25rem;
}

@media (max-width: 680px) {
    .club-chat-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .nav-hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: #fffdf9;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-md);
        padding: 0.75rem 1rem;
        gap: 0;
        z-index: 150;
    }

    .nav-links.nav-open {
        display: flex;
    }

    .nav-links a,
    .nav-links .btn {
        display: block;
        padding: 0.65rem 0.5rem;
        font-size: 1rem;
        border-radius: var(--radius);
    }

    .nav-links a:hover {
        background: var(--gray-50);
    }

    .nav-links .btn {
        text-align: center;
        margin-top: 0.25rem;
    }

    .nav-links .btn-outline {
        margin-top: 0.25rem;
    }

    .desktop-only {
        display: none;
    }

    /* Move profile menu inline in mobile nav */
    .profile-menu {
        position: static;
    }

    .profile-menu-toggle {
        display: none;
    }

    .profile-dropdown {
        display: block;
        position: static;
        border: none;
        box-shadow: none;
        padding: 0;
        min-width: unset;
        background: transparent;
    }

    .profile-dropdown-name {
        border-bottom: none;
        padding: 0.65rem 0.5rem;
        color: var(--primary);
    }

    .profile-dropdown-item {
        padding: 0.65rem 0.5rem;
        border-radius: var(--radius);
    }

    .profile-dropdown-item:hover {
        background: var(--gray-50);
    }

    .profile-dropdown-divider {
        margin: 0.25rem 0.5rem;
    }

    .navbar {
        position: relative;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* ===== Avatars ===== */
.user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.user-avatar-sm {
    width: 1.75rem;
    height: 1.75rem;
}

.user-avatar-lg {
    width: 7rem;
    height: 7rem;
}

.nav-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.profile-header-avatar {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Avatar picker grid */
.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.25rem;
}

.avatar-option {
    cursor: pointer;
    border: 2.5px solid transparent;
    border-radius: 50%;
    overflow: hidden;
    width: 7rem;
    height: 7rem;
    transition: border-color 0.15s;
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-option:hover {
    border-color: var(--primary-hover);
}

.avatar-option.selected {
    border-color: var(--primary);
    outline: 3px solid rgba(139, 94, 60, 0.25);
    outline-offset: 1px;
}

.avatar-none-option {
    cursor: pointer;
    border: 2.5px solid transparent;
    border-radius: 50%;
    width: 7rem;
    height: 7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--gray-300);
    transition: border-color 0.15s;
}

.avatar-none-option:hover {
    border-color: var(--gray-400);
}

.avatar-none-option.selected {
    border-color: var(--primary);
    outline: 3px solid rgba(139, 94, 60, 0.25);
    outline-offset: 1px;
}

/* Skip link (onboarding) */
.bio-save-btn {
    transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}

.bio-save-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

/* Skip link (onboarding) */
.skip-link {
    font-size: 0.875rem;
    color: var(--gray-400);
}

.skip-link:hover {
    color: var(--gray-600);
}

/* Inline user row with avatar */
.user-avatar-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Danger Zone */
.danger-zone {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border: 1.5px solid #f0c9c0;
    border-radius: var(--radius);
    background: #fdf0ed;
}

.danger-zone p {
    margin: 0.4rem 0 1rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.danger-zone-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--danger);
}

/* ── Generic modal ───────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay--open {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem 0.9rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal__header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal__close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 0.2rem;
}

.modal__close:hover {
    color: var(--gray-700);
}

.modal__body {
    padding: 1.2rem 1.4rem;
}

.modal__body p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.9rem 1.4rem 1.2rem;
    border-top: 1px solid var(--gray-200);
}

/* Delete account modal overlay */
.delete-account-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.delete-account-overlay--open {
    display: flex;
}

.delete-account-modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
}

.delete-account-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem 0.9rem;
    border-bottom: 1px solid var(--gray-200);
}

.delete-account-modal__header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--danger);
}

.delete-account-modal__close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 0.2rem;
}

.delete-account-modal__close:hover {
    color: var(--gray-700);
}

.delete-account-modal__body {
    padding: 1.2rem 1.4rem;
}

.delete-account-modal__body p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.delete-account-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.9rem 1.4rem 1.2rem;
    border-top: 1px solid var(--gray-200);
}

/* ── Account Settings page ────────────────────────────────────── */
.settings-card-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.settings-inline-form {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.settings-inline-form input {
    flex: 1;
    min-width: 0;
}

.notif-pref-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.notif-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-pref-label {
    font-size: 0.9rem;
    color: var(--gray-700);
}

.settings-logout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 2.4rem;
    height: 1.3rem;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--gray-300);
    border-radius: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: var(--shadow-md);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateY(-50%) translateX(1.1rem);
}

.currently-reading-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.currently-reading-add-btn {
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--gray-400);
    line-height: 1;
    display: flex;
    align-items: center;
    transition: color 0.15s, border-color 0.15s;
}

.currently-reading-add-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* Reading list detail */
.list-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.6rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--gray-100);
}

.list-card-header-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--gray-400);
}

.list-book-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.list-book-item:last-child {
    border-bottom: none;
}

.list-item-num {
    display: inline-block;
    min-width: 1.5rem;
    font-size: 0.78rem;
    color: var(--gray-300);
    font-weight: 500;
}

.list-item-num::before {
    counter-increment: list-item-counter;
    content: counter(list-item-counter);
}

.list-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.15s;
}

.list-book-item:hover .list-item-actions {
    opacity: 1;
}

.list-detail-remove {
    background: none;
    border: none;
    color: var(--gray-300);
    font-size: 1.05rem;
    line-height: 1;
    padding: 0.1rem 0.25rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: color 0.15s;
}

.list-detail-remove:hover {
    color: var(--danger);
}

.list-drag-handle {
    color: var(--gray-200);
    cursor: grab;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}

.list-book-item:hover .list-drag-handle {
    color: var(--gray-400);
}

.list-drag-handle:active {
    cursor: grabbing;
}

/* ── Notification list ─────────────────────────────────────────────────── */
.notif-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    margin-bottom: 2rem;
}

.notif-item {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    border-left: 3px solid transparent;
    transition: background 0.15s;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item.notif-unread {
    background: var(--gray-50);
    border-left-color: var(--primary);
}

.notif-item:hover {
    background: var(--gray-50);
}

.notif-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    margin-top: 0.1rem;
}

.notif-icon-green   { background: #e8f4e8; color: #4a7a4a; }
.notif-icon-red     { background: #fcecea; color: var(--danger); }
.notif-icon-primary { background: #f5ede6; color: var(--primary); }
.notif-icon-blue    { background: #e8eef8; color: #4a72a8; }

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--gray-900);
}

.notif-text a {
    font-weight: 600;
    color: var(--gray-900);
    text-decoration: none;
}

.notif-text a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.notif-time {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 0.2rem;
}

.notif-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.notif-unread-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 0.4rem;
}

.notif-count-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 0.5rem;
    letter-spacing: 0.02em;
}

/* Generic empty state icon */
.empty-state-icon {
    font-size: 2rem;
    color: var(--gray-300);
    margin-bottom: 0.5rem;
    display: block;
}
