/* ── BookClub page styles ─────────────────────────────── */

/* Discussion detail card */
.discussion-detail-card { border-left: 4px solid var(--action); }
.discussion-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.discussion-detail-header h3 { margin: 0 0 0.25rem; }
.discussion-meta { color: var(--muted); margin: 0; font-size: 0.92rem; }
.discussion-detail-actions { display: flex; gap: 0.5rem; flex-shrink: 0; align-items: stretch; flex-wrap: wrap; }
.discussion-detail-actions button, .discussion-detail-actions label.disc-action-label {
    margin-top: 0;
    min-height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.live-progress-btn {
    background: var(--action);
    color: var(--action-text);
    border-color: var(--action);
}

.live-progress-btn:hover {
    background: var(--primary);
}

.live-popup-progress-btn {
    background: var(--action);
    color: var(--action-text);
    border-color: var(--action);
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
    font-weight: 800;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 16%, transparent);
}

.live-popup-progress-btn:hover:not(:disabled) {
    background: var(--primary);
}

.live-popup-progress-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* Discussion edit form */
.discussion-edit-form { margin-top: 1rem; }
.discussion-edit-fields { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.discussion-edit-fields label { margin-bottom: 0; }

/* Item list editor */
.item-list-editor { margin-top: 1rem; margin-bottom: 0.5rem; }
.item-list-editor strong { display: block; margin-bottom: 0.75rem; font-size: 0.95rem; }
.item-row { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.35rem; min-width: 0; }
.item-input { flex: 1 1 auto; min-width: 0; max-width: 100%; display: inline-block; width: 100%; box-sizing: border-box; margin-top: 0; padding: 0.3rem 0.5rem; font-size: 0.9rem; }
.item-input--topic {
    display: block;
    resize: vertical;
    min-height: 0.2rem;
    line-height: 1.25;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow-x: hidden;
}
.btn-icon-small { background: transparent; color: #c0392b; border: none; padding: 0.2rem 0.4rem; font-size: 0.9rem; cursor: pointer; border-radius: 4px; margin-top: 0; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon-small:hover { background: var(--danger-bg); }
.btn-small { background: transparent; color: var(--action); border: 1px solid var(--action); padding: 0.25rem 0.7rem; font-size: 0.85rem; cursor: pointer; border-radius: 4px; margin-top: 0.25rem; }
.btn-small:hover { background: var(--bg); }
.topic-editor-row,
.topic-display-item { margin-left: calc(var(--topic-depth, 0) * 1.35rem); }
.topic-editor-row { display: grid; grid-template-columns: auto minmax(0, 1fr) repeat(5, auto); align-items: center; padding: 0.15rem 0.25rem; border-radius: 6px; transition: background 0.15s; }
.topic-editor-row:hover,
.topic-editor-row:focus-within { background: color-mix(in srgb, var(--action) 10%, transparent); }
.topic-editor-row .item-input { padding-top: calc(0.3rem - 4px); padding-bottom: calc(0.3rem - 4px); font-size: calc(0.9rem - 2px); }
.topic-editor-row > .btn-icon-small,
.topic-editor-row > .topic-move-actions { margin-top: 0; align-self: center; }
.topic-move-actions { display: inline-flex; align-items: center; gap: 0.15rem; min-width: 2.2rem; opacity: 0; transition: opacity 0.15s; }
.topic-editor-row:hover .topic-move-actions,
.topic-editor-row:focus-within .topic-move-actions { opacity: 1; }
.topic-move-btn { color: var(--action); padding: 0.15rem; }
.topic-move-btn:hover { background: var(--bg); }
.topic-image-upload-btn,
.topic-image-url-btn { color: var(--action); }
.topic-image-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    line-height: 1;
    margin-bottom: 0;
    font-weight: normal;
}
.topic-image-upload-btn .theme-icon,
.topic-image-upload-btn .theme-icon svg {
    display: block;
}
.topic-image-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.topic-image-url-row,
.topic-editor-image-preview { grid-column: 2 / -1; width: 100%; }
.topic-image-url-row { margin-top: 0.25rem; }
.topic-image-url-input { width: 100%; }
.topic-editor-image-preview { margin-top: 0.3rem; }
.topic-editor-image-preview img {
    display: block;
    max-width: min(220px, 100%);
    max-height: 140px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.topic-image-error { margin: 0 0 0.4rem; font-size: 0.82rem; }
.discussion-topic-list { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; min-width: 0; }
.discussion-topic-list .discussion-item.topic-display-item { padding: 0.15rem 0.6rem; font-size: 0.875rem; line-height: 1.2; min-height: 24px; box-sizing: border-box; display: flex; align-items: center; width: fit-content; max-width: calc(100% - (var(--topic-depth, 0) * 1.35rem)); margin-bottom: 0; }
.topic-add-child-btn { color: var(--action); border-color: transparent; }
.topic-add-child-btn:hover { background: var(--bg); }
.topic-display-row { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; min-width: 0; max-width: 100%; }
.topic-display-row > span,
.item-reveal-label span { min-width: 0; overflow-wrap: anywhere; }
.topic-display-image {
    display: block;
    max-width: min(260px, 100%);
    max-height: 180px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: filter 0.2s ease, opacity 0.2s ease;
}
.topic-display-image--blurred {
    filter: blur(16px);
    opacity: 0.72;
}
.topic-collapse-btn,
.topic-collapse-spacer { width: 0.9rem; height: 0.9rem; flex: 0 0 0.9rem; }
.topic-collapse-btn { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--muted); padding: 0; border-radius: 4px; cursor: pointer; line-height: 1; margin: 0; }
.topic-collapse-btn .theme-icon,
.topic-collapse-btn svg { width: 0.75rem; height: 0.75rem; }
.topic-collapse-btn:hover { background: var(--bg); color: var(--text); }

/* Discussion sections / sequential reveal */
.discussion-columns { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.discussion-columns .discussion-section { width: 100%; max-width: none; margin-top: 1.1rem; min-width: 0; }
.discussion-section { margin-top: 1.1rem; }
.discussion-section-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.discussion-section-header h4 { margin: 0; }
.discussion-section h4 { margin: 0 0 0.75rem; font-size: 0.95rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.discussion-item { padding: 0.4rem 0.6rem; border-radius: 6px; margin-bottom: 0.3rem; background: var(--bg); border: 1px solid var(--border); transition: background 0.15s; }
.discussion-item.item-revealed { border-color: var(--action); }
.item-reveal-label { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: normal; margin-bottom: 0; }
.item-reveal-label input[type="checkbox"] { display: inline-block; width: auto; max-width: none; margin-top: 0; flex-shrink: 0; }
.item-placeholder { color: var(--muted); font-style: italic; font-size: 0.9rem; user-select: none; }
.disc-strip-count { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.4rem; }

/* Horizontal discussion book strip */
.disc-book-strip { display: flex; gap: 1rem; overflow-x: auto; padding: 1rem; background: var(--bg); border-radius: 8px; margin-bottom: 1rem; scrollbar-width: thin; }
.disc-book-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; flex-shrink: 0; width: 80px; gap: 0.35rem; border-radius: 6px; padding: 0.4rem; transition: background 0.25s; background: transparent; border: none; font: inherit; color: inherit; }
    .disc-book-item:hover,
    .disc-book-item:focus-visible,
    .disc-book-item:focus-within {
        background: var(--surface);
        outline: 2px solid var(--surface);
    }
.disc-book-item--selected {
    outline: 2px solid var(--surface);
    outline-offset: 2px;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px rgba(144, 190, 255, 0.45);
}
.disc-book-item--selected:hover,
.disc-book-item--selected:focus-visible,
.disc-book-item--selected:focus-within {
    outline: 3px solid var(--surface);
    outline-offset: 2px;
}
.disc-book-cover { height: 100px; width: auto; max-width: 70px; border-radius: 4px; display: block; object-fit: cover; }
.disc-book-placeholder { height: 100px; width: 70px; display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; font-size: 2rem; flex-shrink: 0; }
.disc-book-title { font-size: 0.72rem; text-align: center; line-height: 1.3; color: var(--text); max-width: 80px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.disc-book-item--selected .disc-book-title { color: var(--text); text-shadow: 0 1px 1px rgba(0,0,0,0.35); }
.disc-action-label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-weight: normal; }

/* Stats cover images */
.stats-cover-60 { height: 60px; width: auto; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.stats-cover-80 { height: 80px; width: auto; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.stats-top5-li { display: flex; align-items: center; gap: 0.6rem; }
.stat-badge-inline { display: inline-block; font-size: 0.95rem; font-weight: 700; color: var(--action); margin-top: 0.15rem; }

.reading-speed-row {
    display: grid;
    grid-template-columns: minmax(150px, 180px) minmax(150px, 180px) minmax(320px, 1fr);
    gap: 1rem;
    align-items: stretch;
    margin-top: 1.5rem;
}

.reading-speed-row--scatter {
    grid-template-columns: minmax(0, 1fr);
}

.reading-speed-summary-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.reading-speed-summary-row > .stat-card {
    margin-bottom: 0;
}

.reading-speed-plot-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    min-width: 0;
}

.reading-speed-plot-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 700;
}

.reading-speed-plot-header span:last-child {
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.reading-speed-plot {
    position: relative;
    height: 205px;
    width: calc(100% - 84px);
    max-width: calc(100% - 84px);
    margin: 1.1rem auto 0;
}

.reading-speed-axis {
    position: absolute;
    left: 0;
    right: 0;
    top: 104px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--border), var(--action));
}

.reading-speed-axis-label {
    position: absolute;
    top: 118px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.reading-speed-axis-label--slow { left: 0; }
.reading-speed-axis-label--fast { right: 0; }

.reading-speed-point {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 82px;
    z-index: 2;
}

.reading-speed-point::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--action);
    border: 2px solid var(--surface, #fff);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    order: 2;
    margin-top: 4px;
}

.reading-speed-point img,
.reading-speed-cover-placeholder {
    height: 54px;
    width: auto;
    max-width: 42px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.18);
    flex-shrink: 0;
}

.reading-speed-cover-placeholder {
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    font-size: 1.1rem;
}

.reading-speed-point-title {
    order: 3;
    margin-top: 0.45rem;
    max-width: 82px;
    color: var(--text);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.reading-speed-point-value {
    order: 4;
    color: var(--action);
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

@media (max-width: 900px) {
    .reading-speed-row {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .reading-speed-row--scatter {
        grid-template-columns: minmax(0, 1fr);
    }

    .reading-speed-plot-card {
        grid-column: 1 / -1;
    }
}

/* Sessions row */
.sessions-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: stretch; }
.sessions-row > .card { flex: 2 1 280px; margin-bottom: 0; }

.host-queue-standalone {
    margin-bottom: 0;
}
.host-queue-standalone summary { list-style: none; }
.host-queue-standalone summary::-webkit-details-marker { display: none; }
.host-queue-collapsible-summary {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.5rem;
    user-select: none;
}
.host-queue-collapsible-summary .host-queue-toggle-content { flex: 1; min-width: 0; }
.host-queue-collapsible-summary .collapse-toggle { flex-shrink: 0; transition: transform 0.2s ease; }
.host-queue-standalone[open] .host-queue-collapsible-summary .collapse-toggle { transform: rotate(180deg); }
.host-queue-standalone .host-queue-list { padding-top: 0.75rem; }
.host-queue-standalone[open] .host-queue-collapsible-summary { margin-bottom: 0.25rem; }
.host-queue-standalone + .tabs-wrapper .tabs { margin-top: 0; }

/* Next Discussion / overview cards */
.next-discussion-card,
.book-card.overview-card { border-left: 4px solid var(--action); }

.session-summary-card {
    display: flex;
    flex-direction: column;
}

.session-summary-card .mobile-collapsible-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.session-summary-card .pick-summary {
    width: 100%;
    margin-top: auto !important;
    margin-bottom: auto;
    align-items: center;
}

.session-summary-details {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.session-summary-details h3 {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.18;
}

.session-summary-details > p {
    margin: 0;
}

.last-session-summary-details > p:first-of-type {
    display: none;
}

.session-summary-author {
    font-size: 1rem;
    font-weight: 700;
}

.session-summary-date {
    font-size: 0.92rem;
    color: var(--muted);
}

.session-summary-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.session-summary-metrics p {
    margin: 0;
}

.session-summary-overall {
    font-size: 1rem;
}

.last-session-pick-summary {
    align-items: stretch;
    gap: 1.35rem;
    margin-top: 0.8rem !important;
}

.last-session-cover-wrap,
.last-session-cover,
.last-session-cover-placeholder {
    width: 136px;
    height: 184px;
}

.last-session-cover {
    display: block;
    object-fit: cover;
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.last-session-summary-details {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    gap: 0.42rem;
}

.last-session-summary-details h3 {
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0;
}

.last-session-summary-details .session-summary-author {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 700;
}

.last-session-summary-details .session-summary-date {
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.last-session-summary-details .session-summary-date .theme-icon,
.last-session-summary-details .session-summary-date .theme-icon svg {
    width: 0.95rem;
    height: 0.95rem;
}

.last-session-rating-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin-top: 1.1rem;
    padding-top: 0.8rem;
    border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.last-session-rating-stat {
    min-width: 0;
    padding: 0 1rem;
    border-left: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.last-session-rating-stat:first-child {
    padding-left: 0;
    border-left: 0;
}

.last-session-rating-stat:last-child {
    padding-right: 0;
}

.last-session-rating-label {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.18rem;
}

.last-session-rating-stat strong {
    display: block;
    color: var(--text);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.28rem;
}

.last-session-stars {
    position: relative;
    display: inline-block;
    color: color-mix(in srgb, var(--accent) 26%, transparent);
    font-size: 0.9rem;
    line-height: 1;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.last-session-stars-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--rating-pct, 0%);
    color: var(--accent);
    overflow: hidden;
    white-space: nowrap;
}

.next-discussion-date-editor {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.15rem 0 0.4rem;
}

.next-discussion-date-editor input {
    width: auto;
    min-width: 9rem;
    padding: 0.25rem 0.4rem;
    font-size: 0.9rem;
}

.next-discussion-date-status {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
}

.next-discussion-countdown-row {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.next-discussion-countdown-row .countdown-display {
    margin-top: 0;
    line-height: 1;
    color: var(--muted);
}

.next-discussion-start-btn {
    margin-top: 0;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--action);
    background: var(--action);
    color: var(--action-text);
    font-weight: 700;
}

.next-discussion-start-btn:hover,
.next-discussion-start-btn:focus-visible {
    background: var(--primary);
    border-color: var(--primary);
}

.next-discussion-join-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.6rem;
    align-self: flex-start;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--action);
    background: var(--action);
    color: var(--action-text);
    font-weight: 700;
    animation: sessionJoinPulse 1.55s ease-in-out infinite;
}

.next-discussion-join-btn:hover,
.next-discussion-join-btn:focus-visible {
    background: var(--primary);
    border-color: var(--primary);
}

@keyframes sessionJoinPulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--action) 50%, transparent); }
    50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--action) 0%, transparent); }
}

.waiting-room-invite-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1200;
    width: min(340px, calc(100vw - 2.5rem));
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border: 1px solid var(--action);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}

.waiting-room-invite-toast strong {
    font-size: 0.92rem;
    line-height: 1.35;
}

.waiting-room-invite-join {
    margin-top: 0;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--action);
    background: var(--action);
    color: var(--action-text);
    font-weight: 700;
}

.waiting-room-invite-join:hover,
.waiting-room-invite-join:focus-visible {
    background: var(--primary);
    border-color: var(--primary);
}

.waiting-room-invite-close {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    margin: 0;
    padding: 0.15rem;
    width: 1.5rem;
    height: 1.5rem;
    background: transparent;
    border: 0;
    color: var(--muted);
}

.waiting-room-invite-toast--fade {
    animation: waitingRoomInviteFade 0.4s ease-out forwards;
}

@keyframes waitingRoomInviteFade {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(12px); }
}

/* Currently Reading cards */
.currently-reading-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 1rem; margin-top: 0.7rem; }
.currently-reading-card { display: flex; flex-direction: row; align-items: stretch; overflow: hidden; flex-shrink: 0; }

.currently-reading-cover { flex: 0 0 125px; width: 125px; overflow: hidden; background: var(--accent); display: flex; align-items: center; justify-content: center; position: relative; }
.currently-reading-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.currently-reading-cover .cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; background: var(--accent); }
/* Spinner inside .currently-reading-cover — mirrors .cover-load-wrap spinner but for this container */
.currently-reading-cover .cover-spinner::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.4);
    border-top-color: rgba(255,255,255,0.9);
    border-radius: 50%;
    animation: coverSpin 0.7s linear infinite;
}

.currently-reading-card .overview-book-info { flex: 1 1 0; min-width: 0; overflow: hidden; }

.currently-reading-info {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.currently-reading-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.currently-reading-progress {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.25;
    margin-top: auto;
}

.currently-reading-progress-date {
    font-size: 0.82rem;
}

.overview-book-info--flex {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.overview-ratings-footer { margin-top: auto; padding-top: 0.4rem; }

/* Overview book info (shared) */
.overview-book-info { padding: 0.9rem 1rem; }
.overview-book-info .actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.currently-reading-info .actions { margin-top: auto; }
.overview-rating-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin: 0.1rem 0; font-size: 0.93rem; }
.overview-rating-row .rating-label { color: var(--muted); font-size: 0.88rem; }
.overview-rating-row .rating-value { font-weight: 600; text-align: right; white-space: nowrap; }
.overview-rating-row--overall .rating-label,
.overview-rating-row--overall .rating-value { font-weight: 800; }

/* Countdown display */
.countdown-display { font-size: 1.4rem; font-weight: 700; color: var(--action); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; margin-top: 0.5rem; }

/* Statistics tab */
.stats-top-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1rem; align-items: stretch; }
@media (max-width: 700px) { .stats-top-layout { grid-template-columns: 1fr; } }
.stats-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.stats-cards--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.club-word-count-card .stat-number { font-size: clamp(1.35rem, 3.2vw, 2.05rem); }
.club-word-count-card .stat-label { font-size: 0.82rem; }
.stats-top-layout > .statistics-section-card { display: flex; flex-direction: column; }
.stats-top-layout > .statistics-section-card { height: 100%; }
.statistics-collapsible-card {
    display: block;
}

.statistics-collapsible-card summary {
    list-style: none;
}

.statistics-collapsible-card summary::-webkit-details-marker {
    display: none;
}

.statistics-collapsible-header {
    margin: 0;
}

.statistics-collapsible-card > .statistics-collapsible-content {
    margin-top: 0.85rem;
}

.statistics-collapsible-card:not([open]) > .statistics-collapsible-content {
    display: none;
}

.statistics-collapsible-card .collapse-toggle {
    transition: transform 0.2s ease;
}

.statistics-collapsible-card[open] .collapse-toggle {
    transform: rotate(180deg);
}

.statistics-card-summary-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.statistics-collapsible-header.all-books-header {
    margin-bottom: 0;
}

.statistics-collapse-controls { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.statistics-collapse-controls button { padding: 0.25rem 0.7rem; font-size: 0.82rem; }
.glaze-positive { color: var(--action); }
.glaze-negative { color: var(--muted); }
.glaze-table-wrap { overflow-x: auto; }
.glaze-mobile-list { display: none; }
.glaze-mobile-card { display: block; padding: 0.95rem 0; border-bottom: 1px solid var(--border); }
.glaze-mobile-card:first-child { padding-top: 0.35rem; }
.glaze-mobile-card:last-child { border-bottom: none; padding-bottom: 0; }
.glaze-mobile-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; cursor: pointer; list-style: none; }
.glaze-mobile-card-top::-webkit-details-marker { display: none; }
.glaze-mobile-card-title { display: grid; gap: 0.18rem; min-width: 0; }
.glaze-mobile-card-title strong { color: var(--text); font-size: 1rem; line-height: 1.15; }
.glaze-mobile-card-title span { color: var(--muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.glaze-mobile-factor { display: grid; gap: 0.12rem; justify-items: end; text-align: right; white-space: nowrap; }
.glaze-mobile-factor span { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.glaze-mobile-factor-value { display: inline-flex; align-items: center; gap: 0.28rem; }
.glaze-mobile-factor strong { font-size: 1.1rem; line-height: 1; }
.glaze-mobile-caret { transition: transform 0.18s ease; }
.glaze-mobile-card[open] .glaze-mobile-caret { transform: rotate(180deg); }
.glaze-mobile-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; padding-top: 0.8rem; }
.glaze-mobile-metric { display: grid; gap: 0.16rem; padding: 0.55rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.glaze-mobile-metric span { color: var(--muted); font-size: 0.72rem; font-weight: 700; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.03em; }
.glaze-mobile-metric strong { color: var(--text); font-size: 0.98rem; line-height: 1.1; font-variant-numeric: tabular-nums; }

.club-volume-card {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.club-volume-card h3 {
    margin-bottom: 1rem;
}
.stats-top-layout .stats-cards { flex: 1; grid-template-rows: repeat(2, minmax(0, 1fr)); }
.stats-top-layout .stat-card { display: flex; flex-direction: column; justify-content: center; }
.stats-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1rem; }
.stats-two-col > .card { margin-bottom: 0; }
.stats-two-col > .panel { margin-bottom: 0; }
@media (max-width: 700px) { .stats-two-col { grid-template-columns: 1fr; } }
.stats-top-layout > .card { margin-bottom: 0; }
.statistics-section-card { margin-bottom: 1rem; }
.panel.statistics-section-card { border: 1px solid var(--border); }
.statistics-section-card--rankings { border-top: none; }
.club-scorecard { justify-content: space-between; gap: 1.1rem; overflow: hidden; }
.club-scorecard-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.club-scorecard-main h3 { margin-bottom: 0.15rem; }
.club-scorecard-score { display: flex; align-items: baseline; justify-content: flex-end; gap: 0.2rem; color: var(--action); font-variant-numeric: tabular-nums; line-height: 0.95; padding-bottom: 0.2rem }
.club-scorecard-score span { font-size: clamp(3.25rem, 7vw, 5.5rem); font-weight: 800; letter-spacing: 0; color: var(--muted); }
.club-scorecard-score small { font-size: 1rem; font-weight: 700; color: var(--muted); }
.club-scorecard-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.club-scorecard-metrics span { display: grid; gap: 0.05rem; padding: 0.55rem 0.45rem; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: 0.78rem; text-align: center; line-height: 1.15; }
.club-scorecard-metrics strong { color: var(--text); font-size: 1rem; }
.club-scorecard-details { display: grid; gap: 0.85rem; }
.club-scorecard-highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 4px; }
.club-scorecard-highlights div { display: grid; gap: 0.12rem; min-width: 0; padding-top: 0.85rem; border-top: 1px solid var(--border); }
.club-scorecard-highlights span { color: var(--muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; }
.club-scorecard-highlights strong { color: var(--text); font-size: 0.95rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.club-scorecard-highlights small { color: var(--muted); font-size: 0.8rem; }
.club-scorecard-milestones { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.42rem 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--border); align-items: baseline; }
.club-scorecard-milestones span { color: var(--muted); font-size: 0.8rem; }
.club-scorecard-milestones strong { color: var(--text); font-size: 0.9rem; text-align: right; white-space: nowrap; }
@media (max-width: 760px) {
    .club-scorecard-main { grid-template-columns: 1fr; }
    .club-scorecard-score { justify-content: flex-start; }
    .club-scorecard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .club-scorecard-highlights { grid-template-columns: 1fr; }
    .club-scorecard-milestones strong { white-space: normal; }
}

.stats-ranked-list { list-style: decimal; padding-left: 1.5rem; margin: 0; }
.stats-ranked-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--border); gap: 0.5rem; }
.stats-ranked-list li:last-child { border-bottom: none; }
.book-title-stat { flex: 1; font-size: 0.95rem; }

/* Podium */
.podium-wrapper { display: flex; align-items: flex-end; justify-content: center; gap: 0.75rem; padding: 1rem 0 0; max-width: 100%; }
.podium-slot { display: flex; flex-direction: column; align-items: center; flex: 0 1 100px; min-width: 0; }
.podium-cover { width: 80%; max-width: 80px; aspect-ratio: 80/110; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.25); flex-shrink: 0; }
.podium-cover-placeholder { width: 80%; max-width: 80px; aspect-ratio: 80/110; background: var(--border); border-radius: 4px; }
.stats-cover-clickable { cursor: pointer; transition: opacity 0.2s, transform 0.2s ease; }
.stats-cover-clickable:hover { opacity: 0.9; }
.timeline-cover-dot.stats-cover-clickable:hover { transform: translateX(-50%) scale(1.1); }
.podium-title { font-size: 0.72rem; font-weight: 600; text-align: center; margin: 0.35rem 0 0.3rem; color: var(--text); line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; width: 100%; max-width: 100px; }
.podium-block { width: 100%; max-width: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 6px 6px 0 0; gap: 0.1rem; padding: 0.4rem 0; }
.podium-block--1 { height: 200px; background: #c8a800; }
.podium-block--2 { height: 160px; background: #909090; }
.podium-block--3 { height: 120px; background: #a05c2a; }
.podium-block--animated {
    height: var(--podium-final-height);
    animation: podium-grow var(--podium-grow-duration, 450ms) linear both;
    overflow: hidden;
}
@keyframes podium-grow {
    from { height: var(--podium-start-height); }
    to { height: var(--podium-final-height); }
}
.podium-medal { font-size: 1.6rem; line-height: 1; color: rgba(255,255,255,0.92); display: inline-flex; }
.podium-place { font-size: 0.8rem; font-weight: 700; color: #fff; }
.podium-score { font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.85); }

/* Top 10 view */
.top10-wrapper { display: flex; align-items: flex-end; gap: 0.25rem; padding: 1rem 0 0; width: 100%; overflow-x: auto; }
.top10-slot { display: flex; flex-direction: column; align-items: center; flex: 1 1 0; min-width: 0; }
.top10-slot .podium-cover { width: 80%; max-width: 60px; aspect-ratio: 80/110; }
.top10-slot .podium-cover-placeholder { width: 80%; max-width: 60px; aspect-ratio: 80/110; }
.top10-block { background: var(--action); width: 100%; }
.top10-block.podium-block--1 { background: #c8a800; }
.top10-block.podium-block--2 { background: #909090; }
.top10-block.podium-block--3 { background: #a05c2a; }
.top10-block .podium-medal { font-size: 1.1rem; color: rgba(255,255,255,0.85); }
.top10-block .podium-place { font-size: 0.65rem; }
.top10-block .podium-score { font-size: 0.65rem; }
.top10-title { font-size: 0.6rem; font-weight: 600; text-align: center; margin: 0.2rem 0; color: var(--text); line-height: 1.2; width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top10-title-mobile { display: none; }

.stat-badge { background: var(--action); color: var(--action-text); border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.stat-badge .theme-icon,
.stat-badge .theme-icon svg {
    color: currentColor;
    stroke: currentColor;
}
.stat-badge--low { background: var(--warning); }
.stat-hint { font-size: 0.83rem; color: var(--muted); margin: 0.1rem 0 0.1rem; }
.stats-scatter-controls { display: flex; justify-content: flex-end; margin: 0.1rem 0 0.35rem; }
.stats-scatter-toggle { margin-top: 0; padding: 0.2rem 0.55rem; font-size: 0.78rem; line-height: 1.2; }
.stat-rank-bar { flex: 0 0 60px; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.stat-rank-bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--action); }
.stat-rank-bar--low .stat-rank-bar-fill { background: var(--warning); }

.all-books-card h3 { margin: 0; }
.all-books-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
.all-books-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.45rem 0.8rem; color: var(--muted); font-size: 0.84rem; }
.all-books-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.all-books-legend-key { display: inline-grid; gap: 0.08rem; justify-items: center; }
.all-books-legend-swatch { position: relative; display: inline-flex; width: 22px; height: 10px; border-radius: 999px; overflow: hidden; border: 1px solid rgba(0,0,0,0.1); }
.all-books-legend-swatch::before,
.all-books-legend-swatch::after { content: ""; flex: 1; }
.all-books-legend-swatch::before { background: var(--member-dark); }
.all-books-legend-swatch::after { background: var(--member-light); }
.all-books-legend-labels { display: grid; grid-template-columns: 1fr 1fr; width: 22px; font-size: 0.52rem; font-weight: 800; line-height: 1; color: var(--muted); text-align: center; }
.all-books-list { display: flex; flex-direction: column; gap: 0; }
.all-books-row { display: grid; grid-template-columns: minmax(190px, 260px) minmax(180px, 1fr) 96px; align-items: center; gap: 0.85rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.all-books-row:last-child { border-bottom: none; }
.all-books-book { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.all-books-cover { width: 34px; height: 48px; object-fit: cover; border-radius: 3px; flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,0.16); }
.all-books-cover--placeholder { display: flex; align-items: center; justify-content: center; background: var(--accent); box-shadow: none; font-size: 1rem; }
.all-books-title { min-width: 0; color: var(--text); font-weight: 650; font-size: 0.92rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.all-books-score-track { display: flex; width: 100%; height: 16px; background: var(--border); border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); }
.all-books-score-segment { height: 100%; min-width: 2px; }
.all-books-score-segment--empty { flex: 1 1 auto; min-width: 0; background: transparent; }
.all-books-overall { display: grid; justify-items: end; gap: 0.05rem; font-size: 0.78rem; color: var(--muted); line-height: 1.15; white-space: nowrap; }
.all-books-overall strong { color: var(--text); font-size: 1rem; }
.all-books-overall-label { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.68rem; }
@media (max-width: 760px) {
    .all-books-header { align-items: flex-start; flex-direction: column; }
    .all-books-legend { justify-content: flex-start; }
    .all-books-row { grid-template-columns: 1fr 74px; gap: 0.55rem 0.75rem; }
    .all-books-book { grid-column: 1 / -1; }
    .all-books-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .all-books-score-track { height: 14px; }
}

.stats-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.stats-table th, .stats-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.stats-table--compact { margin-top: 0.75rem; font-size: 0.86rem; }
.stats-table-wrap { overflow-x: auto; margin-top: 0.8rem; }
.stats-table--all-books { min-width: 1180px; font-size: 0.84rem; }
.stats-table--all-books th,
.stats-table--all-books td { white-space: nowrap; vertical-align: middle; }
.stats-table--all-books .all-books-book { min-width: 210px; }
.stats-mobile-table-wrap { overflow-x: auto; }
.stats-mobile-list { display: none; }
.stats-mobile-list-header { display: flex; justify-content: flex-end; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.stats-mobile-list-col-header { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.stats-mobile-card { display: block; padding: 0.95rem 0; border-bottom: 1px solid var(--border); }
.stats-mobile-card:first-child { padding-top: 0.35rem; }
.stats-mobile-list-header + .stats-mobile-card { padding-top: 0.35rem; }
.stats-mobile-card:last-child { border-bottom: none; padding-bottom: 0; }
.stats-mobile-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; cursor: pointer; list-style: none; }
.stats-mobile-card-top::-webkit-details-marker { display: none; }
.stats-mobile-card-top strong { color: var(--text); font-size: 1rem; line-height: 1.25; min-width: 0; }
.stats-mobile-highlight { display: grid; gap: 0.12rem; justify-items: end; text-align: right; white-space: nowrap; }
.stats-mobile-highlight span { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.stats-mobile-highlight strong { color: var(--text); font-size: 1.05rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stats-mobile-highlight-value { display: inline-flex; align-items: center; gap: 0.28rem; }
.stats-mobile-caret { transition: transform 0.18s ease; }
.stats-mobile-card[open] .stats-mobile-caret { transform: rotate(180deg); }
.stats-mobile-card-content { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.2s ease, padding-top 0.2s ease; padding-top: 0; }
.stats-mobile-card[open] .stats-mobile-card-content { grid-template-rows: 1fr; padding-top: 0.8rem; }
.stats-mobile-card-content-inner { overflow: hidden; }
.stats-mobile-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.stats-mobile-metric { display: grid; gap: 0.16rem; padding: 0.55rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface) 88%, transparent); min-width: 0; }
.stats-mobile-metric span { color: var(--muted); font-size: 0.72rem; font-weight: 700; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.03em; }
.stats-mobile-metric strong { color: var(--text); font-size: 0.98rem; line-height: 1.2; overflow-wrap: anywhere; }
.stats-mobile-metric--wide { grid-column: 1 / -1; }
.stats-group-header { text-align: center !important; background: color-mix(in srgb, var(--accent) 62%, transparent); }
.milestone-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.55rem 1rem; align-items: baseline; }
.milestone-grid span { color: var(--muted); }
.milestone-grid strong { color: var(--text); text-align: right; white-space: nowrap; }
.stats-table--divisive th:nth-child(3),
.stats-table--divisive td:nth-child(3) { width: 58%; }
.divisive-table-wrap { overflow-x: auto; }
.divisive-mobile-list { display: none; }
.divisive-mobile-card { display: grid; gap: 0.9rem; padding: 0.95rem 0; border-bottom: 1px solid var(--border); }
.divisive-mobile-card:first-child { padding-top: 0.35rem; }
.divisive-mobile-card:last-child { border-bottom: none; padding-bottom: 0; }
.divisive-mobile-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; }
.divisive-mobile-card-top strong { color: var(--text); font-size: 1rem; line-height: 1.25; min-width: 0; }
.divisive-mobile-stddev { display: grid; gap: 0.12rem; justify-items: end; text-align: right; white-space: nowrap; }
.divisive-mobile-stddev span { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.divisive-mobile-stddev strong { color: var(--text); font-size: 1.05rem; line-height: 1; font-variant-numeric: tabular-nums; }
.divisive-mobile-spreads { display: grid; gap: 0.75rem; }
.divisive-mobile-spread { display: grid; gap: 0.45rem; }
.rating-spread-plot { display: grid; gap: 0.7rem; min-width: 300px; padding: 0.2rem 0; }
.rating-spread-row { display: grid; grid-template-columns: 78px minmax(220px, 1fr); gap: 0.65rem; align-items: center; }
.rating-spread-label { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.rating-spread-rail { position: relative; height: 28px; margin: 0 18px; border-radius: 999px; background: color-mix(in srgb, var(--border) 74%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent); }
.rating-spread-rail::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%); background: color-mix(in srgb, var(--muted) 45%, transparent); }
.rating-spread-range { position: absolute; top: 50%; height: 10px; transform: translateY(-50%); border-radius: 999px; background: color-mix(in srgb, var(--action) 38%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--action) 18%, transparent); }
.rating-spread-average { position: absolute; top: 2px; bottom: 2px; width: 2px; transform: translateX(-50%); border-radius: 999px; background: var(--text); opacity: 0.72; z-index: 2; }
.rating-spread-member { position: absolute; top: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; z-index: 3; background: var(--member-color); color: #fff; border: 2px solid color-mix(in srgb, var(--card-bg, #fff) 84%, var(--text)); box-shadow: 0 2px 6px rgba(0,0,0,0.18); font-size: 0.58rem; font-weight: 800; line-height: 1; letter-spacing: 0; }
.rating-spread-endpoint { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.68rem; font-weight: 700; line-height: 1; }
.rating-spread-endpoint--left { right: calc(100% + 6px); }
.rating-spread-endpoint--right { left: calc(100% + 6px); }
.scores-by-book-list { display: flex; flex-direction: column; gap: 1rem; }
.scores-by-book-row { display: flex; align-items: center; gap: 1rem; }
.scores-by-book-cover { width: 46px; height: 64px; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.22); flex-shrink: 0; }
.scores-by-book-cover-placeholder { width: 46px; height: 64px; background: var(--border); border-radius: 4px; flex-shrink: 0; }
.scores-by-book-content { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 0.35rem; }
.scores-by-book-title { font-size: 0.8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scores-by-book-avg { font-size: 0.75rem; font-weight: 400; color: var(--muted); margin-left: 0.25rem; }
@media (max-width: 760px) {
    .stats-mobile-table-wrap { display: none; }
    .stats-mobile-list { display: grid; gap: 0; }
    .stats-mobile-card-top strong { white-space: normal; }
    .glaze-table-wrap { display: none; }
    .glaze-mobile-list { display: grid; gap: 0; }
    .divisive-table-wrap { display: none; }
    .divisive-mobile-list { display: grid; gap: 0; }
    .divisive-mobile-card-top strong { white-space: normal; }
}
.reading-ask-list {
    display: grid;
    gap: 0.8rem;
    align-content: center;
    justify-items: center;
    height: 100%;
}
.reading-ask-row {
    display: flex;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.9rem 1rem;
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
    width: min(100%, 540px);
}
.reading-ask-row:last-child { border-bottom: none; padding-bottom: 0; }
.reading-ask-row span { color: var(--muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; }
.reading-ask-row strong { color: var(--action); font-size: 1.35rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.reading-ask-row small { color: var(--text); font-size: 0.95rem; font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.reading-ask-row em { color: var(--muted); font-size: 0.82rem; font-style: normal; }
.reading-ask-row--muted strong { color: var(--muted); }
.reading-ask-row-main { display: grid; gap: 0.14rem; min-width: 0; }
.reading-ask-row-side { display: flex; align-items: center; gap: 0.75rem; justify-self: end; min-width: 0; }

[data-theme="black"] .glaze-positive,
[data-theme="black"] .glaze-negative,
[data-theme="very-dark-blue"] .glaze-positive,
[data-theme="very-dark-blue"] .glaze-negative {
    color: var(--text);
}
.reading-ask-cover-lg,
.reading-ask-cover-lg-placeholder { width: 48px; height: 72px; border-radius: 4px; flex-shrink: 0; }
.reading-ask-cover-lg { object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.reading-ask-cover-lg-placeholder { background: var(--border); }
.reading-ask-row-side-meta { display: grid; gap: 0.08rem; min-width: 0; }
.reading-ask-row-side-label { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.reading-ask-row-side-host { color: var(--text); font-size: 0.92rem; line-height: 1.2; white-space: nowrap; }
.reading-pace-grid { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 700px) { .reading-pace-grid { grid-template-columns: 1fr; } }
.reading-ask-host-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.reading-ask-host { border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem; background: color-mix(in srgb, var(--surface) 86%, transparent); min-width: 0; }
.reading-ask-host summary { list-style: none; }
.reading-ask-host summary::-webkit-details-marker { display: none; }
.reading-ask-host-summary { margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.35rem; }
.reading-ask-host:not([open]) .reading-ask-host-summary { margin-bottom: 0; }
.reading-ask-host-summary .collapse-toggle { transition: transform 0.2s ease; }
.reading-ask-host[open] .reading-ask-host-summary .collapse-toggle { transform: rotate(180deg); }
.reading-ask-host-name { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.reading-ask-host-avg-inline { font-size: 0.82rem; color: var(--muted); margin-left: auto; margin-right: 0.5rem; white-space: nowrap; }
.reading-ask-host-metrics { display: grid; gap: 0.55rem; }
.reading-ask-metric { display: grid; grid-template-columns: 2.2rem max-content minmax(0, 1fr); align-items: center; gap: 0.6rem; }
.reading-ask-metric-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--muted); min-width: 2.2rem; flex-shrink: 0; }
.reading-ask-metric-value { font-size: 1.05rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.reading-ask-metric-book { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.reading-ask-cover-sm { width: 30px; height: 42px; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,0.22); flex-shrink: 0; }
.reading-ask-cover-sm-placeholder { width: 30px; height: 42px; background: var(--border); border-radius: 3px; flex-shrink: 0; }
.reading-ask-metric-title { font-size: 0.82rem; font-weight: 600; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.reading-ask-metric-avg-note { font-size: 0.82rem; color: var(--muted); font-style: normal; }
@media (max-width: 900px) {
    .reading-pace-grid { grid-template-columns: 1fr; }
    .reading-ask-list { align-content: start; justify-items: stretch; }
    .reading-ask-row { grid-template-columns: 1fr; }
    .reading-ask-row { width: 100%; }
    .reading-ask-row-side { justify-self: start; }
    .reading-ask-host-list { grid-template-columns: 1fr; }
    .reading-ask-metric { grid-template-columns: 2.2rem minmax(0, 1fr); }
    .reading-ask-metric-book,
    .reading-ask-metric-avg-note { grid-column: 2; }
}

/* Top nav */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }
.topnav { display: flex; align-items: center; padding: 0 2rem; height: 56px; width: 100%; max-width: calc(var(--app-content-max-width) - var(--app-content-shell-inline-gap)); margin-inline: auto; box-sizing: border-box; border-radius: var(--app-layout-radius); background: var(--primary-alt); color: #fff; }
.brand { font-weight: 700; font-size: 1.1rem; color: #fff; white-space: nowrap; flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; gap: 1rem; flex: 1 1 auto; justify-content: center; align-items: stretch; min-height: 100%; min-width: 0; }
.nav-links a { color: var(--nav-text, #f1fff6); text-decoration: none; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; padding: 0 0.65rem; border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s; }
.nav-links a:hover,
.nav-links a.active { color: #fff; }
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; font-size: 0.9rem; color: #cde8d8; }
.nav-signout { background: transparent; color: #cde8d8; border: 1px solid #cde8d8; padding: 0.25rem 0.7rem; font-size: 0.85rem; border-radius: 4px; cursor: pointer; margin-top: 0; transition: background 0.15s, color 0.15s; }
.nav-signout:hover { background: rgba(255,255,255,0.12); color: #fff; }
.main-content { flex: 1; width: 100%; max-width: var(--app-content-max-width); box-sizing: border-box; margin-inline: auto; padding: 1rem 2rem 2rem; }

/* Btn icon */
.btn-icon { background: transparent; border: none; cursor: pointer; padding: 0.2rem 0.4rem; font-size: 1rem; color: var(--action); margin-top: 0; border-radius: 4px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: var(--bg); }

/* Open Library search results */
.ol-results { border: 1px solid var(--border); border-radius: 6px; max-height: 280px; overflow-y: auto; background: var(--surface); margin-top: 0.25rem; }
.ol-result-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
button.ol-result-item { width: 100%; text-align: left; background: transparent; border: none; margin-top: 0; }
button.ol-result-item:disabled { cursor: not-allowed; opacity: 0.7; }
.ol-result-item:last-child { border-bottom: none; }
.ol-result-item:hover { background: color-mix(in srgb, var(--action) 16%, var(--surface)); }
button.ol-result-item:disabled:hover { background: transparent; }
.ol-cover { height: 48px; width: auto; border-radius: 3px; flex-shrink: 0; }

/* Notes bubbles */
.notes-bubbles { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; }
.note-bubble { position: relative; background: #fff; border: 1.5px solid var(--action); border-radius: 18px 18px 18px 4px; padding: 0.6rem 0.9rem; font-size: 0.92rem; color: var(--text); max-width: 100%; box-shadow: 0 1px 4px rgba(43,66,51,0.07); }
.note-bubble::before { content: ""; position: absolute; bottom: -1px; left: -10px; border-width: 0 0 10px 10px; border-style: solid; border-color: transparent transparent var(--action) transparent; }
.note-bubble::after  { content: ""; position: absolute; bottom: 1px; left: -7px; border-width: 0 0 9px 9px; border-style: solid; border-color: transparent transparent #fff transparent; }
.note-bubble .note-author { font-weight: 700; color: var(--action); margin-right: 0.35rem; }
.note-bubble-remove { background: transparent; color: #c0392b; border: none; padding: 0 0.3rem; font-size: 0.85rem; cursor: pointer; float: right; margin-top: 0; line-height: 1; }
.note-bubble-remove:hover { background: #fde8e6; border-radius: 4px; }

/* Slider + text input combo */
.slider-combo { display: flex; flex-direction: column-reverse; align-items: center; gap: 0.25rem; margin-top: 0.25rem; }
.slider-combo input[type="range"] { width: 100%; margin: 0; }
.slider-text-input { width: 56px !important; min-width: 56px !important; max-width: 56px !important; padding: 0.2rem 0.3rem !important; font-size: 0.88rem !important; text-align: center; display: inline-block !important; margin: 0 !important; }

/* Timeline tab */
.timeline-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.timeline-header h2 { margin: 0; }
.timeline-year-panel { margin-bottom: 2rem; }
.timeline-year-panel h2 { margin-bottom: 1rem; }

.timeline-layout { display: flex; gap: 1rem; align-items: flex-start; overflow-x: auto; }

.timeline-cover-list { flex: 0 0 120px; display: flex; flex-direction: column; gap: 0; }
.timeline-cover-item { display: flex; flex-direction: column; align-items: center; height: 72px; justify-content: center; gap: 0.25rem; padding: 0 0.25rem; box-sizing: border-box; }
.timeline-cover-img { height: 44px; width: auto; max-width: 36px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.timeline-cover-placeholder { width: 36px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--accent); border-radius: 3px; font-size: 1.2rem; flex-shrink: 0; }
.timeline-cover-title { font-size: 0.68rem; color: var(--muted); text-align: center; line-height: 1.2; max-width: 110px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.timeline-chart { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; position: relative; }

.timeline-swimlane { height: 72px; position: relative; display: flex; align-items: center; border-bottom: 1px dashed var(--border); }
.timeline-swimlane--collapsed { height: 66px; align-items: flex-start; padding-top: 6px; }
.timeline-swimlane--collapsed + .timeline-axis { margin-top: 0; }

.timeline-bar-track { position: relative; width: 100%; height: 8px; }
.timeline-bar { position: absolute; height: 8px; border-radius: 4px; background: var(--action); opacity: 0.55; top: 0; }
.timeline-bar--open-ended { border-radius: 4px 0 0 4px; }
.timeline-bar--open-ended::after { content: ""; position: absolute; right: -8px; top: 50%; transform: translateY(-50%); width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 10px solid var(--action); }
.timeline-bar--date-change { opacity: 1; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--action) 78%, transparent) 0 8px, transparent 8px 13px); }

.timeline-dot { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 14px; height: 14px; border-radius: 50%; z-index: 2; }
.timeline-dot-start { background: #fff; border: 3px solid var(--action); top: 4px; }
.timeline-dot-end   { color: var(--muted); background: currentColor; border: 2px solid currentColor; top: 4px; }
.timeline-change-marker { position: absolute; top: 4px; transform: translate(-50%, -50%); width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; z-index: 3; box-sizing: border-box; box-shadow: 0 2px 6px rgba(0,0,0,0.18); }
.timeline-change-marker .theme-icon { width: 11px; height: 11px; stroke-width: 2.6; }
.timeline-change-marker--reschedule {
    border-radius: 50%;
    background: var(--bg);
    color: var(--surface);
    border: 2px solid color-mix(in srgb, var(--surface) 86%, #fff);
}
.timeline-change-marker--extension { border-radius: 50%; background: var(--timeline-member-color); color: var(--text); border: 2px solid color-mix(in srgb, var(--surface) 86%, #fff); }
.timeline-change-marker--extension span { font-size: 0.68rem; font-weight: 800; line-height: 1; letter-spacing: 0; }

.timeline-date-label { position: absolute; font-size: 0.68rem; white-space: nowrap; color: var(--timeline-date-color, var(--primary)); font-weight: 600; left: 50%; transform: translateX(-50%); }
.timeline-label-start { bottom: 18px; }
.timeline-label-end   { top: 18px; }

.timeline-axis { position: relative; height: 36px; margin-top: 0.25rem; border-top: 2px solid var(--border); }
.timeline-month-tick { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.timeline-month-tick::before { content: ""; display: block; width: 1px; height: 6px; background: var(--muted); }
.timeline-month-label { font-size: 0.72rem; color: var(--muted); margin-top: 2px; white-space: nowrap; }

/* Collapsed cover-dot marker */
.timeline-cover-dot { position: absolute; top: 0; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.timeline-cover-dot img,
.timeline-cover-dot .timeline-cover-placeholder { height: 44px; width: auto; max-width: 32px; object-fit: cover; border-radius: 3px; flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,0.18); }
.timeline-cover-dot .timeline-cover-placeholder { width: 32px; display: flex; align-items: center; justify-content: center; background: var(--accent); font-size: 1rem; }
.timeline-cover-dot .timeline-date-label { position: static; transform: none; font-size: 0.65rem; color: var(--timeline-date-color, var(--primary)); font-weight: 600; white-space: nowrap; text-align: center; margin-top: 2px; }

/* Timeline dot tooltip */
.timeline-dot-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    max-width: 220px;
    white-space: normal;
    text-align: center;
}
.timeline-dot-tooltip strong { display: block; }
.timeline-cover-dot:hover .timeline-dot-tooltip { opacity: 1; }
@media (min-width: 761px) {
    .timeline-dot-tooltip {
        box-sizing: border-box;
        width: 150px;
        min-width: 150px;
        max-width: 150px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .timeline-dot-tooltip { transition: none; }
}

/* ── SignalR Real-time: Floating Reactions ─────────────────────────────── */
@keyframes floatUp {
    0%   { transform: translateY(0) scale(1);   opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(-220px) scale(1.6); opacity: 0; }
}

.floating-emoji-layer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.floating-emoji {
    position: absolute;
    bottom: 80px;
    font-family: "Segoe UI Emoji", "Segoe Fluent Icons", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 2.5rem;
    animation: floatUp 3s ease-out forwards;
    pointer-events: none;
    user-select: none;
}

/* ── Reaction bar ──────────────────────────────────────────────────────── */
.live-layout {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-top: 0.75rem;
}

.live-discussion-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.live-discussion-popup {
    width: min(1180px, var(--app-popup-max-width));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.32);
    padding: 1rem;
    animation: summary-pop-in 0.45s cubic-bezier(.34,1.56,.64,1) both;
    position: relative;
}

.live-discussion-popup-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.live-discussion-popup-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    justify-self: start;
}

.live-discussion-popup-header .live-popup-progress-btn,
.live-discussion-popup-header .live-popup-progress-spacer {
    justify-self: center;
}

.live-discussion-popup-header > .disc-summary-close-btn {
    justify-self: end;
}

.live-discussion-popup .live-layout {
    margin-top: 0;
}

.live-discussion-popup .live-chat-panel {
    background: var(--surface);
    color: var(--text);
}

.live-discussion-col {
    flex: 1 1 0;
    min-width: 0;
}

.live-chat-column {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reaction-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.reaction-btn {
    font-size: 1.6rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 2.8rem;
    height: 2.8rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.1s, box-shadow 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction-btn:hover {
    transform: scale(1.25);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.reaction-glyph {
    font-family: "Segoe UI Emoji", "Segoe Fluent Icons", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    line-height: 1;
}

.reaction-status {
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
}

/* ── Live Chat panel ───────────────────────────────────────────────────── */
.live-chat-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.live-chat-panel {
    height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    background: #f8fff9;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-message {
    font-size: 0.88rem;
    line-height: 1.4;
    display: flex;
    align-items: baseline;
    gap: 0;
    position: relative;
}

.chat-delete-btn {
    display: none;
    margin-left: auto;
    padding: 0 0.3rem;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1;
    border-radius: 4px;
    flex-shrink: 0;
}

.chat-delete-btn:hover {
    color: #c0392b;
    background: #fdecea;
}

.chat-message-own:hover .chat-delete-btn {
    display: inline-flex;
    align-items: center;
}

.chat-author {
    font-weight: 600;
    color: var(--text);
    margin-right: 0.3rem;
}

.chat-time {
    color: var(--muted);
    font-size: 0.75rem;
    margin-left: 0.3rem;
}

.chat-input-row {
    display: flex;
    gap: 0.5rem;
}

.chat-input-row input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.chat-input-row button {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

[data-theme="black"] .reaction-btn,
[data-theme="very-dark-black"] .reaction-btn,
[data-theme="very-dark-red"] .reaction-btn,
[data-theme="very-dark-gold"] .reaction-btn,
[data-theme="very-dark-pink"] .reaction-btn,
[data-theme="very-dark-brown"] .reaction-btn,
[data-theme="very-dark-blue"] .reaction-btn,
[data-theme="very-dark-green"] .reaction-btn {
    background: var(--surface);
}

[data-theme="black"] .live-chat-panel,
[data-theme="very-dark-black"] .live-chat-panel,
[data-theme="very-dark-red"] .live-chat-panel,
[data-theme="very-dark-gold"] .live-chat-panel,
[data-theme="very-dark-pink"] .live-chat-panel,
[data-theme="very-dark-brown"] .live-chat-panel,
[data-theme="very-dark-blue"] .live-chat-panel,
[data-theme="very-dark-green"] .live-chat-panel {
    background: var(--surface);
}

[data-theme="black"] .note-bubble,
[data-theme="very-dark-black"] .note-bubble,
[data-theme="very-dark-red"] .note-bubble,
[data-theme="very-dark-gold"] .note-bubble,
[data-theme="very-dark-pink"] .note-bubble,
[data-theme="very-dark-brown"] .note-bubble,
[data-theme="very-dark-blue"] .note-bubble,
[data-theme="very-dark-green"] .note-bubble {
    background: var(--surface);
}

[data-theme="black"] .note-bubble::after,
[data-theme="very-dark-black"] .note-bubble::after,
[data-theme="very-dark-red"] .note-bubble::after,
[data-theme="very-dark-gold"] .note-bubble::after,
[data-theme="very-dark-pink"] .note-bubble::after,
[data-theme="very-dark-brown"] .note-bubble::after,
[data-theme="very-dark-blue"] .note-bubble::after,
[data-theme="very-dark-green"] .note-bubble::after {
    border-color: transparent transparent var(--surface) transparent;
}

@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--action) 50%, transparent); }
    50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--action) 0%, transparent); }
}

.live-signalr-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.5rem;
    user-select: none;
}

.live-signalr-status.connected {
    border-color: var(--action);
    color: var(--action);
    animation: live-pulse 1.8s ease-in-out infinite;
}

.live-signalr-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}

.live-signalr-status.connected .live-signalr-dot {
    background: var(--action);
}

/* ── Discussion Summary Overlay ── */
@keyframes summary-pop-in {
    0%   { opacity: 0; transform: scale(0.6) translateY(40px); }
    70%  { transform: scale(1.04) translateY(-4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

.disc-summary-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.disc-summary-card {
    background: var(--surface, #fff);
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(43,66,51,0.28);
    padding: 2.5rem 2.5rem 2rem;
    max-width: min(420px, var(--app-popup-max-width));
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    animation: summary-pop-in 0.55s cubic-bezier(.34,1.56,.64,1) both;
    position: relative;
    z-index: 1001;
}

.disc-summary-badge {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--action);
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
}

.disc-summary-cover {
    width: 110px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.18);
}

.disc-summary-cover-placeholder {
    width: 110px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: var(--bg);
    border-radius: 8px;
}

.disc-summary-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin: 0.3rem 0 0;
    text-align: center;
}

.disc-summary-author {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0;
}

.disc-summary-duration {
    font-size: 0.95rem;
    color: var(--muted);
    background: var(--bg);
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.disc-summary-rating-form {
    width: 100%;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.disc-summary-rating-prompt {
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.disc-summary-rating-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.disc-summary-rating-row label {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    gap: 0.25rem;
}

.disc-summary-input {
    width: 80px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.3rem 0.4rem;
    color: var(--text);
    background: var(--surface, #fff);
}

.disc-summary-input:focus { border-color: var(--action); outline: none; }

.disc-summary-scale {
    font-size: 0.8rem;
    color: var(--muted);
}

.disc-summary-submit {
    margin-top: 0.3rem;
    padding: 0.55rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--action);
    color: var(--action-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.disc-summary-submit:hover:not(:disabled) { background: var(--primary); }
.disc-summary-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.disc-summary-submitted {
    font-size: 1rem;
    font-weight: 700;
    color: var(--action);
    margin-top: 0.3rem;
}

.disc-summary-close {
    margin-top: 0.5rem;
    width: 100%;
}

.completion-summary-card {
    max-width: 440px;
}

.completion-summary-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 0.2rem;
}

.completion-summary-actions .secondary {
    margin-top: 0.3rem;
    padding: 0.55rem 1.35rem;
}

.completion-summary-error {
    margin: 0;
    font-size: 0.85rem;
    text-align: center;
}

/* ── Multi-phase discussion summary ── */
.disc-summary-waiting-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.disc-summary-waiting-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    background: var(--surface);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.disc-summary-waiting-item--done {
    background: var(--surface);
    color: var(--action);
}

.disc-summary-waiting-item--pending {
    background: var(--surface);
    color: var(--muted);
}

.disc-summary-waiting-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.disc-summary-waiting-dot--done { background: var(--action); }
.disc-summary-waiting-dot--pending {
    background: var(--border);
    animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.disc-summary-reveal-btn {
    margin-top: 0.5rem;
    padding: 0.55rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--action);
    color: var(--action-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    width: 100%;
}

.disc-summary-reveal-btn:hover:not(:disabled) { background: var(--primary); }
.disc-summary-reveal-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Waiting-Room Overlay ── */
@keyframes waiting-room-pop-in {
    0%   { opacity: 0; transform: scale(0.6) translateY(40px); }
    70%  { transform: scale(1.04) translateY(-4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes waiting-room-pop-out {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.7) translateY(30px); }
}

.waiting-room-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.waiting-room-card {
    background: var(--surface, #fff);
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(43,66,51,0.28);
    padding: 2.5rem 2.5rem 2rem;
    max-width: min(420px, var(--app-popup-max-width));
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    animation: waiting-room-pop-in 0.55s cubic-bezier(.34,1.56,.64,1) both;
    position: relative;
    z-index: 1001;
}

.waiting-room-card.closing {
    animation: waiting-room-pop-out 0.5s cubic-bezier(.55,0,.1,1) both;
}

.waiting-room-prompt {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0.2rem 0 0;
    text-align: center;
}

.waiting-room-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.waiting-room-status-dot--active {
    background: var(--action);
    box-shadow: 0 0 0 3px rgba(97,159,120,0.25);
    animation: waiting-room-active-pulse 1.6s ease-in-out infinite;
}

.waiting-room-status-dot--inactive {
    background: var(--border);
}

@keyframes waiting-room-active-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(97,159,120,0.55); }
    50%       { box-shadow: 0 0 0 7px rgba(97,159,120,0); }
}

.waiting-room-status-label {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}

.disc-summary-waiting-item--done .waiting-room-status-label {
    color: var(--action);
}

.waiting-room-waiting-msg {
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
    margin-top: 0.5rem;
}

.live-session-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.live-session-loading-card {
    width: min(360px, var(--app-popup-max-width));
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    padding: 1.35rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.live-session-loading-spinner {
    width: 2.4rem;
    height: 2.4rem;
    border: 3px solid color-mix(in srgb, var(--action) 22%, var(--border));
    border-top-color: var(--action);
    border-radius: 50%;
    animation: live-session-spin 0.7s linear infinite;
}

.live-session-loading-title {
    margin: 0;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

@keyframes live-session-spin {
    to { transform: rotate(360deg); }
}

/* Rating reveal animation */
@keyframes rating-pop {
    0% { opacity: 0; transform: scale(0.4); }
    70% { transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}

.disc-summary-ratings-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.disc-summary-rating-row-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    background: var(--bg);
    font-size: 0.9rem;
}

.disc-summary-rating-row-item .member-name {
    flex: 1;
    font-weight: 600;
    color: var(--text);
}

.disc-summary-rating-val {
    font-weight: 700;
    color: var(--action);
    min-width: 40px;
    text-align: right;
}

[data-theme="very-dark-blue"] .disc-summary-rating-val,
[data-theme="very-dark-black"] .disc-summary-rating-val,
[data-theme="very-dark-red"] .disc-summary-rating-val,
[data-theme="very-dark-gold"] .disc-summary-rating-val,
[data-theme="very-dark-pink"] .disc-summary-rating-val,
[data-theme="very-dark-brown"] .disc-summary-rating-val,
[data-theme="black"] .disc-summary-rating-val,
[data-theme="very-dark-green"] .disc-summary-rating-val {
    color: var(--text);
}

.disc-summary-rating-val--animated {
    animation: rating-pop 0.45s cubic-bezier(.34,1.56,.64,1) both;
}

.disc-summary-avg-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg);
    border-radius: 10px;
    border: 2px solid var(--action);
}

.disc-summary-avg-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.disc-summary-avg-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

.disc-summary-avg-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.disc-summary-avg-value--animated {
    animation: rating-pop 0.6s cubic-bezier(.34,1.56,.64,1) 0.3s both;
}

.disc-summary-avg-item--overall .disc-summary-avg-label {
    font-size: 0.98rem;
}

.disc-summary-avg-item--overall .disc-summary-avg-value {
    font-size: 1.7rem;
}

/* Next pick announcement */
.disc-summary-next-pick-announce {
    width: 100%;
    background: var(--bg);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    text-align: center;
    border: 2px solid var(--action);
    margin-top: 0.5rem;
}

.disc-summary-next-pick-announce p {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.5rem;
}

.disc-summary-reveal-pick-btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    background: var(--action);
    color: var(--action-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.disc-summary-reveal-pick-btn:hover { background: var(--primary); }
.disc-summary-reveal-pick-btn:disabled { opacity: 0.5; cursor: default; }

/* Next pick reveal popup overlay */
.disc-next-pick-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.disc-next-pick-card {
    background: var(--surface, #fff);
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(43,66,51,0.32);
    padding: 2rem 2.5rem 1.75rem;
    max-width: min(440px, var(--app-popup-max-width));
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    animation: summary-pop-in 0.55s cubic-bezier(.34,1.56,.64,1) both;
    position: relative;
    z-index: 1101;
}

.disc-next-pick-cover {
    width: 160px;
    height: 230px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.25);
    animation: rating-pop 0.6s cubic-bezier(.34,1.56,.64,1) 0.1s both;
}

.disc-next-pick-cover-placeholder {
    width: 160px;
    height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: var(--bg);
    border-radius: 10px;
}

.disc-next-pick-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin: 0.2rem 0 0;
}

.disc-next-pick-author {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0;
}

.disc-next-pick-pages {
    font-size: 0.9rem;
    color: var(--muted);
    background: var(--bg);
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
}

.disc-next-pick-date-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.3rem;
}

.disc-next-pick-date-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.disc-next-pick-date-input {
    width: auto;
    max-width: 200px;
    text-align: center;
    padding: 0.45rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.disc-next-pick-date-input:focus { border-color: var(--action); outline: none; }

.disc-next-pick-date-display {
    min-width: 12rem;
    text-align: center;
    padding: 0.45rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-weight: 700;
}

.disc-next-pick-close-btn {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--action);
    color: var(--action-text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.disc-next-pick-close-btn:hover:not(:disabled) { background: var(--primary); }
.disc-next-pick-close-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Next host placeholder in sessions-row */
.sessions-row-next-host-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.4rem;
}

.sessions-row-next-host-card h2 { margin: 0 0 0.5rem; }


.home-bc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 700px) {
    .home-bc-layout { grid-template-columns: 1fr; }
}

.home-next-pick-card h2,
.home-history-card h2 { margin-top: 0; }

.home-personal-editor-card {
    --home-personal-editor-cover-width: 93px;
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    position: relative;
}

.home-personal-editor-card--compact {
    grid-template-columns: max-content;
    width: max-content;
    min-width: 0;
}

.home-personal-editor-sidebar {
    display: grid;
    gap: 0.9rem;
    justify-items: center;
    min-width: 0;
}

.home-personal-editor-cover-wrap,
.home-personal-editor-cover,
.home-personal-editor-cover-placeholder {
    width: var(--home-personal-editor-cover-width);
    height: 140px;
}

.home-personal-editor-cover,
.home-personal-editor-cover-placeholder {
    border-radius: 10px;
}

.home-personal-editor-cover {
    object-fit: cover;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.home-personal-editor-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    font-size: 2.5rem;
}

.home-personal-editor-summary h2,
.home-personal-editor-summary p {
    margin: 0;
}

.home-personal-editor-summary {
    display: grid;
    gap: 0.35rem;
    justify-items: center;
    text-align: center;
}

.home-personal-editor-overall {
    display: grid;
    justify-items: center;
    gap: 0.05rem;
    min-width: calc(var(--home-personal-editor-cover-width) * 0.4);
    width: max-content;
    line-height: 1;
}

.home-personal-editor-overall strong {
    color: var(--muted);
    font-size: calc(var(--home-personal-editor-cover-width) * 0.26);
    font-weight: 800;
    letter-spacing: 0;
}

.home-personal-editor-overall span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 400;
}

.home-personal-editor-save-state {
    min-height: 1.25rem;
    font-size: 0.84rem;
}

.home-personal-editor-main {
    min-width: 0;
    display: flex;
}

.home-personal-editor-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    align-content: start;
}

.home-personal-editor-field {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0;
}

.home-personal-editor-field-label {
    font-weight: 700;
    line-height: 1.2;
}

.home-personal-editor-field--full {
    grid-column: 1 / -1;
}

.home-personal-editor-field--status {
    justify-self: start;
    width: min(16rem, 100%);
}

.home-personal-editor-slider {
    align-items: stretch;
    flex-direction: column;
    gap: 0.45rem;
}

.home-personal-editor-field input,
.home-personal-editor-field select {
    width: 100%;
    margin-top: 0.35rem;
}

.home-personal-book-card {
    --home-personal-editor-cover-width: 164px;
    grid-template-columns: minmax(176px, 196px) minmax(0, 1fr);
    gap: 1.45rem;
    align-items: stretch;
}

.home-personal-book-card .home-personal-editor-sidebar {
    align-content: start;
    gap: 0.85rem;
    justify-items: stretch;
    padding-right: 1rem;
    border-right: 1px solid var(--border);
}

.home-personal-book-card .home-personal-editor-cover-wrap,
.home-personal-book-card .home-personal-editor-cover,
.home-personal-book-card .home-personal-editor-cover-placeholder {
    width: var(--home-personal-editor-cover-width);
    height: 240px;
}

.home-personal-book-card .home-personal-editor-cover,
.home-personal-book-card .home-personal-editor-cover-placeholder {
    border-radius: 8px;
}

.home-personal-editor-badge-stack {
    display: grid;
    gap: 0.55rem;
    width: var(--home-personal-editor-cover-width);
}

.home-personal-editor-badge,
.home-personal-editor-status-badge,
.home-personal-editor-badge-input {
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
}

.home-personal-editor-badge {
    display: inline-flex;
    align-items: center;
    width: 100%;
    padding: 0.32rem 0.7rem;
    color: var(--text);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-personal-editor-badge--genre {
    color: var(--action);
    justify-content: center;
    text-align: center;
}

.home-personal-editor-badge-input-wrap {
    position: relative;
    display: block;
    margin: 0;
}

.home-personal-editor-badge-input-wrap .home-personal-editor-field-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.home-personal-editor-badge-input {
    width: 100%;
    margin: 0;
    padding: 0.32rem 0.7rem;
    color: var(--text);
    font-weight: 700;
}

.home-personal-editor-status-badge {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
    padding: 0 0.45rem 0 0.7rem;
    color: var(--action);
}

.home-personal-editor-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.home-personal-editor-status-badge select {
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 700;
    padding: 0.32rem 0;
}

.home-personal-book-card .home-personal-editor-main {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.8rem;
}

.home-personal-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    min-width: 0;
}

.home-personal-book-card .home-personal-editor-summary {
    justify-items: start;
    text-align: left;
    min-width: 0;
}

.home-personal-book-card .home-personal-editor-summary h2 {
    font-size: 1.8rem;
    line-height: 1.12;
}

.home-personal-book-card .home-personal-editor-summary .muted {
    margin-top: 0.35rem;
    color: var(--action);
    font-weight: 700;
}

.home-personal-editor-title-field {
    display: grid;
    gap: 0.25rem;
    width: min(420px, 100%);
}

.home-personal-editor-title-field input {
    width: 100%;
    margin: 0;
}

.home-personal-book-card .home-personal-editor-save-state {
    min-width: 7rem;
    text-align: right;
}

.home-personal-book-card .home-personal-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    align-self: start;
}

.home-personal-book-card .home-personal-editor-grid > .home-personal-editor-field {
    min-width: 0;
    min-height: 64px;
    padding: 0.72rem 0;
    border-top: 1px solid var(--border);
}

.home-personal-book-card .home-personal-editor-grid > .home-personal-editor-field:nth-child(even) {
    padding-left: 1rem;
    border-left: 1px solid var(--border);
}

.home-personal-book-card .home-personal-editor-grid > .home-personal-editor-field:nth-child(odd) {
    padding-right: 1rem;
}

.home-personal-book-card .home-personal-editor-field-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.home-personal-book-card .home-personal-editor-stat strong,
.home-personal-book-card .home-personal-editor-overall strong {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.2;
}

.home-personal-book-card .home-personal-editor-overall strong {
    color: var(--action);
    font-size: 1.15rem;
}

.home-personal-book-card .home-personal-editor-field input {
    margin-top: 0.15rem;
}

.home-personal-book-card .home-personal-editor-field--rating {
    display: grid;
    align-content: center;
    gap: 0.35rem;
}

.home-personal-book-card .home-personal-editor-field--rating .home-personal-editor-slider {
    margin-top: 0;
}

.home-personal-book-card .home-personal-editor-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    accent-color: var(--action);
    background: transparent;
}

.home-personal-book-card .home-personal-editor-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 0.38rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--action) 34%, var(--border));
    background: color-mix(in srgb, var(--action) 24%, var(--surface));
}

.home-personal-book-card .home-personal-editor-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    margin-top: -0.36rem;
    border-radius: 50%;
    border: 2px solid var(--surface);
    background: var(--action);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--action) 46%, transparent);
}

.home-personal-book-card .home-personal-editor-slider input[type="range"]::-moz-range-track {
    height: 0.38rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--action) 34%, var(--border));
    background: color-mix(in srgb, var(--action) 24%, var(--surface));
}

.home-personal-book-card .home-personal-editor-slider input[type="range"]::-moz-range-progress {
    height: 0.38rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--action) 58%, var(--surface));
}

.home-personal-book-card .home-personal-editor-slider input[type="range"]::-moz-range-thumb {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 2px solid var(--surface);
    background: var(--action);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--action) 46%, transparent);
}

.home-personal-editor-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem;
    padding-top: 0.2rem;
}

.home-bookclub-rating-card {
    align-items: center;
}

.home-bookclub-ratings-main {
    align-items: center;
}

.home-bookclub-ratings-fields {
    --home-bookclub-rating-input-width: 56px;
    --home-bookclub-rating-slider-gap: 0.6rem;
    flex: 0 1 auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: min(100%, calc(var(--home-bookclub-rating-input-width) + var(--home-bookclub-rating-slider-gap) + 300px));
}

.home-bookclub-ratings-fields .home-personal-editor-field {
    min-width: 0;
}

.home-bookclub-ratings-fields .home-personal-editor-field--rating .home-personal-editor-slider {
    flex-direction: row;
    align-items: center;
    gap: var(--home-bookclub-rating-slider-gap);
    margin-top: 0.25rem;
    max-width: 100%;
    width: 100%;
}

.home-bookclub-ratings-fields .home-personal-editor-slider .slider-text-input {
    flex: 0 0 var(--home-bookclub-rating-input-width);
    margin-top: 0;
}

.home-bookclub-ratings-fields .home-personal-editor-slider input[type="range"] {
    flex: 0 1 300px;
    min-width: 0;
    max-width: calc(100% - var(--home-bookclub-rating-input-width) - var(--home-bookclub-rating-slider-gap));
    margin-top: 0;
    accent-color: var(--muted);
    width: min(300px, calc(100% - var(--home-bookclub-rating-input-width) - var(--home-bookclub-rating-slider-gap)));
}

.home-personal-stats-card {
    margin-top: 1.1rem;
}

.home-personal-stats-card h2 {
    margin-top: 0;
}

.home-personal-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.home-user-dashboard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.home-user-dashboard-column {
    display: grid;
    gap: 1rem;
    align-content: start;
    min-width: 0;
}

.home-user-dashboard-column--primary {
    order: 1;
}

.home-user-dashboard-column--secondary {
    order: 2;
}

.home-user-dashboard-column > .card {
    margin-bottom: 0;
}

.home-user-dashboard .home-personal-stats-card {
    margin-top: 0;
}

.home-user-dashboard .home-personal-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-dashboard-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.home-dashboard-card-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.home-dashboard-card-summary-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.45rem;
    font-weight: 800;
}

.home-dashboard-card-summary-title .theme-icon,
.home-dashboard-card-summary-title .theme-icon svg {
    flex-shrink: 0;
}

.home-dashboard-card-summary-meta {
    flex: 0 1 auto;
    min-width: 0;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: right;
}

.home-dashboard-card-summary-meta em {
    font-style: italic;
}

.home-dashboard-card-summary .collapse-toggle {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.home-dashboard-card:not(.is-collapsed) .home-dashboard-card-summary .collapse-toggle {
    transform: rotate(180deg);
}

.home-dashboard-card-content {
    padding-top: 0.75rem;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.home-dashboard-card.is-collapsed .home-dashboard-card-content {
    padding-top: 0;
}

.home-history-card--stacked .home-history-legend-row {
    flex-direction: column;
    align-items: flex-start;
}

.home-history-card--stacked .home-history-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem 0.85rem;
}

.home-history-card--stacked .home-history-chart-wrap {
    grid-column: 1 / -1;
    margin-left: 0;
    width: auto;
    flex-basis: auto;
    min-width: 0;
    max-width: none;
}

.home-mini-stat-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    background: color-mix(in oklab, var(--surface) 90%, var(--bg) 10%);
    min-width: 0;
}

.home-mini-stat-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
}

.home-mini-stat-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.home-mini-stat-list li {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.home-mini-stat-list span {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.2;
}

.home-mini-stat-list strong {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

@media (max-width: 1300px) {
    .home-personal-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .home-user-dashboard {
        grid-template-columns: 1fr;
    }

    .home-user-dashboard .home-personal-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-personal-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .home-dashboard-card-summary {
        gap: 0.6rem;
    }

    .home-dashboard-card-summary-title {
        font-size: 1.2rem;
    }

    .home-dashboard-card-summary-meta {
        font-size: 0.84rem;
    }

    .home-user-dashboard .home-personal-stats-grid {
        grid-template-columns: 1fr;
    }

    .home-personal-stats-grid {
        grid-template-columns: 1fr;
    }
}

.home-sealed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.15rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.danger-outline {
    color: var(--danger, #c0392b);
    border-color: var(--danger, #c0392b);
}

.danger-outline:hover {
    background: var(--danger-bg);
}

.themed-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.55);
}

.themed-confirm-card {
    width: min(420px, var(--app-popup-max-width));
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

.themed-confirm-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.themed-confirm-card p {
    margin: 0.5rem 0 0;
    color: var(--muted);
}

.themed-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1rem;
}

.home-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.home-history-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.45rem 0;
}

.home-history-main {
    min-width: 0;
    flex: 1 1 auto;
}

.home-history-main > strong,
.home-history-title {
    display: block;
    font-size: 1.2rem;
    line-height: 1.25;
    font-weight: 700;
}

.home-history-main > .muted,
.home-history-date {
    font-size: 1rem;
    line-height: 1.3;
    margin-top: 0.2rem;
}

.home-history-legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.45rem 0 0.8rem;
}

.home-history-legend-row .all-books-legend {
    justify-content: flex-start;
}

.home-history-chart-wrap {
    margin-left: auto;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 3.8rem;
    align-items: center;
    gap: 0.8rem;
    flex: 0 0 clamp(15rem, 48vw, 25rem);
    width: clamp(15rem, 48vw, 25rem);
    min-width: 15rem;
    max-width: 25rem;
}

.home-history-chart-wrap .all-books-overall {
    justify-items: center;
}

.home-history-cover-wrap,
.home-history-cover-placeholder {
    width: 56px;
    height: 78px;
    flex-shrink: 0;
}

.home-history-cover-placeholder {
    font-size: 1.65rem;
}

.home-history-cover {
    width: 56px;
    height: 78px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

/* ── Host Queue card ──────────────────────────────── */
@media (max-width: 700px) {
    .home-personal-editor-card {
        --home-personal-editor-cover-width: 93px;
        grid-template-columns: 1fr;
    }

    .home-personal-book-card .home-personal-editor-sidebar,
    .home-personal-book-card .home-personal-editor-main {
        display: contents;
    }

    .home-personal-book-card .home-personal-editor-sidebar {
        justify-items: center;
        padding-right: 0;
        border-right: 0;
    }

    .home-personal-book-card .home-personal-editor-cover-wrap,
    .home-personal-book-card .home-personal-editor-cover-placeholder {
        order: 1;
        justify-self: center;
    }

    .home-personal-book-card .home-personal-editor-cover-wrap,
    .home-personal-book-card .home-personal-editor-cover,
    .home-personal-book-card .home-personal-editor-cover-placeholder {
        height: 140px;
    }

    .home-personal-book-card .home-personal-editor-badge-stack {
        order: 4;
        justify-self: center;
        width: min(220px, 100%);
    }

    .home-personal-book-card .home-personal-editor-header {
        order: 2;
        width: 100%;
        gap: 0;
        justify-self: stretch;
    }

    .home-personal-editor-header {
        display: grid;
        justify-items: center;
        text-align: center;
    }

    .home-personal-book-card .home-personal-editor-summary {
        justify-items: center;
        text-align: center;
        width: 100%;
    }

    .home-personal-book-card .home-personal-editor-summary h2,
    .home-personal-book-card .home-personal-editor-summary p {
        width: 100%;
        text-align: center;
    }

    .home-personal-book-card .home-personal-editor-summary .icon-text {
        justify-content: center;
    }

    .home-personal-book-card .home-personal-editor-save-state {
        min-width: 0;
        min-height: 0;
        text-align: center;
    }

    .home-personal-book-card .home-personal-editor-save-state:empty {
        display: none;
    }

    .home-personal-editor-summary {
        gap: 0.25rem;
    }

    .home-personal-editor-overall strong {
        font-size: 2rem;
    }

    .home-personal-editor-overall span {
        font-size: 0.88rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .home-personal-editor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem 0.75rem;
        align-items: start;
    }

    .home-personal-book-card .home-personal-editor-grid {
        order: 3;
        gap: 0;
        border-top: 1px solid var(--border);
    }

    .home-personal-book-card .home-personal-editor-grid > .home-personal-editor-field {
        padding: 0.62rem 0;
        border-left: 0;
    }

    .home-personal-book-card .home-personal-editor-grid > .home-personal-editor-field:nth-child(even) {
        padding-left: 0;
        border-left: 0;
    }

    .home-personal-book-card .home-personal-editor-grid > .home-personal-editor-field:nth-child(odd) {
        padding-right: 0.7rem;
    }

    .home-personal-book-card .home-personal-editor-overall {
        grid-column: 1;
        grid-row: 1;
        width: auto;
        justify-self: stretch;
        justify-items: start;
        padding-right: 0.7rem;
        border-top: 0;
    }

    .home-personal-book-card .home-personal-editor-field--goodreads {
        grid-column: 2;
        grid-row: 1;
        padding-left: 0.7rem;
        padding-right: 0;
        border-top: 0;
        border-left: 1px solid var(--border);
    }

    .home-personal-book-card .home-personal-editor-field--quality,
    .home-personal-book-card .home-personal-editor-field--complete,
    .home-personal-book-card .home-personal-editor-field--pages {
        padding-left: 0.7rem;
        padding-right: 0;
        border-left: 1px solid var(--border);
    }

    .home-personal-book-card .home-personal-editor-actions {
        order: 5;
    }

    .home-personal-book-card .home-personal-editor-actions .secondary .theme-icon {
        color: var(--action);
    }

    .home-bookclub-ratings-fields {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.85rem;
        width: min(100%, calc(56px + 0.6rem + 300px));
    }

    .home-personal-editor-field--rating {
        display: grid;
        gap: 0.4rem;
        align-content: start;
    }

    .home-personal-editor-field--rating .home-personal-editor-field-label,
    .home-personal-editor-field--date .home-personal-editor-field-label {
        font-size: 0.8rem;
    }

    .home-personal-editor-field--rating .home-personal-editor-slider {
        gap: 0.35rem;
    }

    .home-personal-editor-field--date {
        display: grid;
        gap: 0.35rem;
    }

    .home-personal-editor-field--date input[type="date"] {
        min-width: 0;
        padding: 0.28rem 0.35rem;
        font-size: 0.78rem;
    }

    .home-personal-editor-field input,
    .home-personal-editor-field select {
        margin-top: 0;
    }

    .home-personal-editor-field--full {
        justify-self: center;
        justify-items: center;
        text-align: center;
        width: min(170px, 100%);
    }

    .home-history-legend-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-history-item {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        align-items: center;
        gap: 0.7rem 0.85rem;
    }

    .home-history-chart-wrap {
        grid-column: 1 / -1;
        margin-left: 0;
        width: auto;
        flex-basis: auto;
        min-width: 0;
        max-width: none;
    }
}

.host-queue-card h2 { margin-top: 0; }

/* Host queue mobile toggle — next host preview */
.host-queue-toggle-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    width: 100%;
}

.host-queue-toggle-next {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: var(--muted);
    margin-left: auto;
    min-width: 0;
}

.host-queue-toggle-avatar {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--avatar-color, var(--action));
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    line-height: 1;
}

.host-queue-toggle-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.host-queue-toggle-avatar-fallback {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.host-queue-toggle-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
    white-space: nowrap;
}

.host-queue-toggle-status {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    min-height: 1.55rem;
    padding: 0.18rem 0.48rem;
    border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
    border-radius: 7px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.host-queue-toggle-status--complete {
    color: #2fe093;
    border-color: color-mix(in srgb, #2fe093 38%, var(--border));
    background: color-mix(in srgb, #2fe093 9%, transparent);
}

.host-queue-status-icon {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

.host-queue-status-icon--complete {
    color: #2fe093 !important;
    fill: color-mix(in srgb, #2fe093 18%, transparent) !important;
}

.host-queue-status-icon--incomplete {
    color: var(--muted) !important;
    opacity: 0.45;
}

.host-queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.75rem;
}

.host-queue-list .host-queue-item:first-child {
    display: none;
}

.host-queue-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    min-height: 52px;
    padding: 0.55rem 0.65rem 0.55rem 0.75rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
    box-shadow: none;
    color: var(--text);
}

.host-queue-item--next {
    font-weight: 700;
}

.host-queue-position {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px color-mix(in srgb, #fff 9%, transparent), 0 8px 16px rgba(0, 0, 0, 0.22);
}

.host-queue-person {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.host-queue-avatar {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.35rem;
    border-radius: 50%;
    overflow: hidden;
    background: var(--host-avatar-color, var(--action));
    color: #fff;
    border: 1px solid color-mix(in srgb, #fff 16%, var(--host-avatar-color, var(--action)));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--host-avatar-color, var(--action)) 20%, transparent);
}

.host-queue-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.host-queue-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1;
}

.host-queue-name {
    min-width: 0;
    color: var(--text);
    font-size: 1.125rem;
    font-weight: 800;
    overflow-wrap: anywhere;
    white-space: nowrap;
}

.host-queue-badge {
    font-size: 0.75rem;
    background: var(--action);
    color: #fff;
    border-radius: 10px;
    padding: 0.1rem 0.55rem;
    white-space: nowrap;
}

.host-queue-position-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.5rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.host-queue-position-badge .theme-icon {
    color: currentColor;
}

.host-queue-requirements {
    display: flex;
    flex-direction: row;
    gap: 0.4rem;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
}

.host-queue-requirement {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 7.6rem;
    min-height: 1.65rem;
    padding: 0.18rem 0.48rem;
    border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
    border-radius: 7px;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
}

.host-queue-requirement--complete {
    color: #2fe093;
    border-color: color-mix(in srgb, #2fe093 38%, var(--border));
    background: color-mix(in srgb, #2fe093 10%, transparent);
}

.host-queue-requirement .theme-icon,
.host-queue-requirement .theme-icon svg {
    width: 0.88rem;
    height: 0.88rem;
    color: currentColor;
}

.host-queue-start-errors {
    position: relative;
    margin-top: 0.75rem;
    padding: 0.75rem 2rem 0.75rem 0.85rem;
    border: 1px solid var(--danger);
    border-radius: 8px;
    background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.host-queue-start-errors ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.host-queue-start-errors-close {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
}

/* ── Punching Bag tab ─────────────────────────────── */
.punching-bag-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 800px) {
    .punching-bag-layout { grid-template-columns: 1fr; }
}

.punching-bag-stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.punching-bag-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 0 auto;
    width: fit-content;
    position: relative;
}

.punching-bag-chain {
    width: 4px;
    height: 36px;
    background: repeating-linear-gradient(
        to bottom,
        #8a6a40 0px,
        #8a6a40 6px,
        #c49a5c 6px,
        #c49a5c 12px
    );
    border-radius: 2px 2px 0 0;
    /* Pinned at the top-center of the wrapper; stretches and rotates to follow the bag */
    position: absolute;
    top: 0;
    left: 50%;
    transform-origin: top center;
    transform: translateX(-50%);
    z-index: 1;
}

.punching-bag-container {
    width: 150px;
    height: 290px;
    /* Push the bag down by the natural rope length so it sits below the anchor */
    margin-top: 36px;
    background:
        /* Cylindrical shading: dark on left/right edges, highlight in center */
        linear-gradient(to right,
            rgba(0,0,0,0.55) 0%,
            rgba(0,0,0,0.08) 25%,
            rgba(255,180,140,0.12) 50%,
            rgba(0,0,0,0.08) 75%,
            rgba(0,0,0,0.55) 100%
        ),
        /* Horizontal band stripes */
        repeating-linear-gradient(
            to bottom,
            transparent 0px,
            transparent 34px,
            rgba(0,0,0,0.18) 34px,
            rgba(0,0,0,0.18) 40px
        ),
        /* Base vertical color — brighter at top, darker toward bottom */
        linear-gradient(to bottom, #d43010 0%, #c02000 45%, #8a1600 100%);
    /* Straight sides (cylinder), gentle dome top, slight curve at bottom */
    border-radius: 75px 75px 75px 75px / 25px 25px 18px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 10px 32px rgba(0,0,0,0.5),
                inset 0 -12px 20px rgba(0,0,0,0.3),
                inset 0 4px 8px rgba(255,255,255,0.1);
    transition: box-shadow 0.12s ease, filter 0.08s ease;
    user-select: none;
    position: relative;
}

.punching-bag-container:hover {
    box-shadow: 0 12px 36px rgba(0,0,0,0.55),
                inset 0 -12px 20px rgba(0,0,0,0.3),
                inset 0 4px 8px rgba(255,255,255,0.1);
}

.punching-bag-container:active {
    filter: brightness(1.05) saturate(1.1);
}

.punching-bag-cover {
    width: 88px;
    height: 112px;
    object-fit: cover;
    border-radius: 3px;
    /* White border simulating tape holding the cover to the bag */
    border: 5px solid rgba(255,255,255,0.88);
    box-shadow: 0 4px 14px rgba(0,0,0,0.65), 0 0 0 1px rgba(0,0,0,0.25);
    z-index: 2;
    position: relative;
}

.punching-bag-cover-placeholder {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.punching-bag-label {
    text-align: center;
    font-size: 0.9rem;
    max-width: 180px;
}

/* Punch leaderboard */
.punch-leaderboard-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    border-left: 4px solid var(--action);
    padding: 1rem;
}

.punch-leaderboard-section h3 { margin-top: 0; }

.punch-leaderboard {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.punch-leaderboard-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--action) 12%, var(--surface));
    border: 1px solid var(--border);
}

.punch-leaderboard-row--me {
    background: color-mix(in srgb, var(--action) 24%, var(--surface));
    border-color: var(--action);
    font-weight: 700;
}

.punch-medal { font-size: 1.1rem; width: 2rem; text-align: center; display: inline-flex; justify-content: center; color: var(--action); }
.punch-name  { flex: 1; color: var(--text); }
.punch-count { font-weight: 700; color: var(--action); white-space: nowrap; }

/* Punch notifications */
.punch-notifications {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.punch-notification {
    background: #2b4233;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: punchNotifyIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.punch-notification--fade {
    animation: punchNotifyFade 0.4s ease-out forwards;
}

@keyframes punchNotifyIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes punchNotifyFade {
    from { opacity: 1; }
    to   { opacity: 0; transform: translateY(-10px); }
}

/* ── Online presence indicators ─────────────────────────────────────────── */
.online-presence {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.online-avatar {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--avatar-color, #4caf82);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    flex-shrink: 0;
    animation: avatarIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.online-avatar--entering {
    animation: avatarIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.online-avatar--leaving {
    animation: avatarOut 0.45s ease-in forwards;
}

@keyframes avatarIn {
    from { opacity: 0; transform: scale(0.4); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes avatarOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.3); }
}

.online-avatar-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--avatar-color, #4caf82);
    opacity: 0.7;
    animation: onlinePulse 2.2s ease-out infinite;
}

@keyframes onlinePulse {
    0%   { transform: scale(1);    opacity: 0.7; }
    70%  { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}

.online-avatar-initials {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
    user-select: none;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.online-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    display: block;
}

/* ── Waiting room leave / return banner ─────────────────────────────────── */
.waiting-room-return-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--action);
    color: var(--action-text);
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: none;
    animation: bannerIn 0.25s ease;
}

.waiting-room-return-banner:hover { background: var(--primary); }

@keyframes bannerIn {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Waiting room leave button */
.waiting-room-leave-btn {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    padding: 0.4rem 1rem;
    margin-top: 1rem;
}

.waiting-room-leave-btn:hover {
    background: var(--bg);
    color: var(--text);
}

/* Waiting room close button for host */
.waiting-room-close-btn {
    display: inline-block;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.1rem 0.3rem;
    margin: 0;
    line-height: 1;
    border-radius: 4px;
}
.waiting-room-close-btn:hover {
    background: rgba(0,0,0,0.08);
    color: var(--text);
}

/* Discussion summary close button */
.disc-summary-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.1rem 0.4rem;
    margin: 0;
    line-height: 1;
    border-radius: 4px;
    z-index: 10;
}
.disc-summary-close-btn:hover {
    background: rgba(0,0,0,0.08);
    color: var(--text);
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-swatch-preview {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
    transition: background 0.2s;
}

input[type="color"] {
    -webkit-appearance: none;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 6px;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 6px;
}

/* ── GoodReads Comparison grid layout ─────────────────── */
.goodreads-comparison-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 1.25rem;
    margin-top: 0.75rem;
    align-items: stretch;
}

.goodreads-comparison-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
    align-items: stretch;
}

.goodreads-comparison-extremes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.goodreads-comparison-summary-grid > .stat-card,
.goodreads-comparison-extremes .stat-card { margin-bottom: 0; }
.goodreads-comparison-tables { min-width: 0; display: grid; gap: 1rem; align-content: start; }
.goodreads-book-details-scroll {
    max-height: 24rem;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.goodreads-book-details-scroll .stats-table {
    margin: 0;
    border: 0;
}
.goodreads-book-details-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface, #fff);
}
.goodreads-comparison-scatter { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.goodreads-comparison-scatter > div:last-child { flex: 0 0 auto; align-items: center !important; }
.goodreads-comparison-scatter svg { width: 100%; min-height: 0; }

.stats-plot-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

@media (max-width: 768px) {
    .goodreads-comparison-grid {
        grid-template-columns: 1fr;
    }
    .goodreads-comparison-summary-grid {
        grid-template-columns: 1fr;
    }
    .goodreads-comparison-extremes {
        grid-template-columns: 1fr;
    }
    .goodreads-comparison-scatter svg {
        height: auto;
    }
}

/* ── Reschedule / Extension Panel ───────────────────── */
.reschedule-panel {
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.32);
    padding: 1.5rem 1.75rem 1.25rem;
    width: min(420px, calc(100vw - 2rem));
    position: relative;
    animation: summary-pop-in 0.35s cubic-bezier(.34,1.56,.64,1) both;
}

.reschedule-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.25rem;
    padding-right: 2rem;
}

.reschedule-panel-book {
    font-size: 0.875rem;
    margin: 0 0 1rem;
}

.reschedule-panel-form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.reschedule-panel-mode-group {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.25rem;
}

.reschedule-panel-mode-group legend {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.35rem;
    float: left;
    width: 100%;
}

.reschedule-panel-mode-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.reschedule-panel-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.reschedule-panel-field > span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}

.reschedule-panel-field input[type="date"],
.reschedule-panel-field select {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg, #fff);
    color: var(--text);
    font-size: 0.95rem;
}

.reschedule-panel-error {
    font-size: 0.85rem;
    margin: 0;
}

.reschedule-panel-actions {
    display: flex;
    gap: 0.625rem;
    margin-top: 0.25rem;
}

/* Change Date trigger next to the date display */
.next-discussion-date-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.next-discussion-change-date-btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}

.next-discussion-change-date-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ── Feed Tab ────────────────────────────────────────── */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.feed-entry {
    padding: 0.75rem 1rem;
}

.feed-entry-text {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    color: var(--text);
}

.feed-entry-time {
    margin: 0;
    font-size: 0.8rem;
}

/* ── Historical Punches Chart ─────────────────────── */
.historical-punches-card {
    margin-top: 1.5rem;
}

.historical-punches-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.historical-punches-header h3 {
    margin: 0;
}

.historical-punches-header select {
    max-width: 160px;
}

.historical-punches-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.historical-punches-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text);
}

.historical-punches-legend-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    border: 2px solid color-mix(in srgb, var(--card-bg, #fff) 84%, var(--text));
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    flex-shrink: 0;
}

.historical-punches-legend-name {
    font-weight: 600;
}

.historical-punches-chart-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}
