﻿/* ── CSS custom properties ────────────────────────── */
:root {
    --primary:    #2b4233;
    --primary-alt:#2e4738;
    --action:     #619f78;
    --accent:     #86ba98;
    --bg:         #f1fff6;
    --text:       #1a2e22;
    --muted:      #4d7a60;
    --border:     #c4dece;
    --warning:    #b7701a;
    --surface:    #ffffff;
    --nav-text:   #f1fff6;
    --nav-link:   #86ba98;
    --table-hover: color-mix(in srgb, var(--action) 20%, var(--surface, #fff));
    --icon-fill:  var(--action);
    --danger-bg:  #fde8e6;
}

/* ── Theme: Light Blue ─────────────────────────────── */
[data-theme="light-blue"] {
    --primary:    #1b3a4b;
    --primary-alt:#1e4457;
    --action:     #2980b9;
    --accent:     #5aabdb;
    --bg:         #eef6fd;
    --text:       #0d2233;
    --muted:      #3a6a8a;
    --border:     #a8d4ea;
    --warning:    #b7701a;
    --surface:    #ffffff;
    --nav-text:   #e8f6ff;
    --nav-link:   #7abde0;
}

/* ── Theme: Dark Blue ──────────────────────────────── */
[data-theme="dark-blue"] {
    --primary:    #0d1b2a;
    --primary-alt:#122236;
    --action:     #1a6ca8;
    --accent:     #3d8fc4;
    --bg:         #e8f1fa;
    --text:       #081828;
    --muted:      #1a4a6e;
    --border:     #8cbddc;
    --warning:    #b7701a;
    --surface:    #ffffff;
    --nav-text:   #d8f0ff;
    --nav-link:   #6aadd8;
}

/* ── Theme: Brown ──────────────────────────────────── */
[data-theme="brown"] {
    --primary:    #3d2b1f;
    --primary-alt:#4a3226;
    --action:     #8b5e3c;
    --accent:     #b07850;
    --bg:         #fdf7f2;
    --text:       #2a1c12;
    --muted:      #6e4c33;
    --border:     #d4b89a;
    --warning:    #b7701a;
    --surface:    #ffffff;
    --nav-text:   #fdf0e8;
    --nav-link:   #d4a882;
}

/* ── Theme: Gold ───────────────────────────────────── */
[data-theme="gold"] {
    --primary:    #3a2900;
    --primary-alt:#453200;
    --action:     #c09010;
    --accent:     #d4a820;
    --bg:         #fffdf0;
    --text:       #281e00;
    --muted:      #7a6200;
    --border:     #e8cc70;
    --warning:    #c05010;
    --surface:    #ffffff;
    --nav-text:   #fff8e0;
    --nav-link:   #e8c84a;
}

/* ── Theme: Dark Red ───────────────────────────────── */
[data-theme="dark-red"] {
    --primary:    #3d0808;
    --primary-alt:#4a1010;
    --action:     #9a2020;
    --accent:     #c04040;
    --bg:         #fff5f5;
    --text:       #280808;
    --muted:      #6e1818;
    --border:     #e8a0a0;
    --warning:    #b07010;
    --surface:    #ffffff;
    --nav-text:   #fff0f0;
    --nav-link:   #e88080;
}

/* ── Theme: Gray ───────────────────────────────────── */
[data-theme="gray"] {
    --primary:    #3a3a3a;
    --primary-alt:#444444;
    --action:     #666666;
    --accent:     #888888;
    --bg:         #f7f7f7;
    --text:       #1a1a1a;
    --muted:      #555555;
    --border:     #c8c8c8;
    --warning:    #b07010;
    --surface:    #ffffff;
    --nav-text:   #f5f5f5;
    --nav-link:   #cccccc;
}

/* ── Theme: Black (dark mode) ──────────────────────── */
[data-theme="black"] {
    --primary:    #0a0a0a;
    --primary-alt:#141414;
    --action:     #585858;
    --accent:     #787878;
    --bg:         #202020;
    --text:       #e8e8e8;
    --muted:      #aaaaaa;
    --border:     #444444;
    --warning:    #d0801a;
    --surface:    #2a2a2a;
    --nav-text:   #f0f0f0;
    --nav-link:   #cccccc;
    --timeline-date-color: #ffffff;
}

/* ── Theme: Very Dark Blue (dark mode) ─────────────── */
[data-theme="very-dark-blue"] {
    --primary:    #050d18;
    --primary-alt:#0a1628;
    --action:     #1d4e8f;
    --accent:     #2a6abf;
    --bg:         #0f1f35;
    --text:       #d0e4f8;
    --muted:      #6890c0;
    --border:     #1a3a60;
    --warning:    #d0801a;
    --surface:    #162840;
    --nav-text:   #d0e8ff;
    --nav-link:   #6aabef;
    --timeline-date-color: #ffffff;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--primary);
}

h1 { margin-top: 0; font-size: 1.6rem; }
h1:focus { outline: none; }

/* Page wrapper */
.page-wrapper {
    background: var(--bg);
    border-radius: 12px;
    padding: 1.75rem 2rem;
    min-height: calc(100vh - 56px - 4rem);
}

.panel {
    background: var(--surface, #fff);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.panel h2 { margin-top: 0; }
.panel h3 { margin-top: 0; }

/* Cards */
.card {
    background: var(--surface, #fff);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--action);
}
.card h2 { margin-top: 0; }
.card h3 { margin-top: 0; }

/* Book grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}
.book-card {
    background: var(--surface, #fff);
    border-radius: 10px;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.book-card .cover-placeholder,
.book-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.85rem;
}
/* Book-card cover load wrapper for the full-width 160px cover area */
.book-card-cover-wrap {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}
.book-card-cover-wrap .cover-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border: none;
    border-radius: 0;
}
.book-card-cover-wrap .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;
}
.book-card-cover-wrap.img-loaded .cover-spinner { display: none; }
.book-card-cover-wrap img { width: 100%; height: 160px; object-fit: cover; display: block; }
.book-card-cover-wrap .cover-placeholder { width: 100%; height: 160px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 0.85rem; }
.book-card .book-info { padding: 0.9rem 1rem; }
.book-card h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.book-card .author {
    color: var(--action);
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem;
}
.meta-separator { color: var(--muted); font-weight: 400; }
.card-header-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.15rem; }
.current-pick-badge {
    position: absolute;
    top: 0; right: 0;
    background: var(--action);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-bottom-left-radius: 6px;
}

/* Tags */
.tag {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    margin-right: 0.35rem;
    margin-top: 0.3rem;
}
.genre-tag {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
}
.in-progress-tag {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--action);
    color: var(--text);
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

/* Buttons */
button {
    background: var(--action);
    color: #fff;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.93rem;
    font-weight: 500;
    margin-top: 0.5rem;
    transition: background 0.15s;
}
button:hover { background: var(--primary-alt); }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: var(--bg); }
button.danger { background: #c0392b; }
button.danger:hover { background: #a93226; }

/* Tabs */
.tabs-wrapper { position: relative; }
.tabs-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3rem;
    background: linear-gradient(to right, transparent, var(--bg));
    pointer-events: none;
    z-index: 1;
}
.tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 2px solid var(--border);
    padding: 12px 3rem 0.5rem 10px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: transparent; color: var(--text); border: 1px solid var(--border); margin-top: 0; border-radius: 6px; white-space: nowrap; flex-shrink: 0; }
.tabs button:hover { background: var(--surface, #fff);}
.tabs button.active { background: var(--action); color: #fff; border-color: var(--action); }
.tabs button .theme-icon { color: currentColor; }

/* Tab pane fade-in */
@keyframes tabFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.tab-pane { animation: tabFadeIn 0.15s ease; }
@media (prefers-reduced-motion: reduce) { .tab-pane { animation: none; } }

.tbd-label { font-size: 0.85rem; }
.live-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #fff;
    color: var(--action);
    border: 1.5px solid var(--action);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.3rem 1rem;
    margin-top: 0;
    animation: live-pulse 1.8s ease-in-out infinite;
    cursor: pointer;
}
.live-tab-btn:hover { background: var(--surface, #fff); }
.live-tab-btn-active {
    background: var(--action) !important;
    color: #fff !important;
    border-color: var(--action) !important;
}
.live-tab-btn-active .live-tab-dot { background: #fff !important; }
.live-tab-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--action);
    flex-shrink: 0;
}

/* Form controls */
input, select, textarea {
    display: block;
    width: 100%;
    max-width: 400px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    margin-top: 0.25rem;
    box-sizing: border-box;
    background: var(--surface, #fff);
    color: var(--text);
}
textarea { min-height: 80px; resize: vertical; }
label { display: block; margin-bottom: 0.75rem; font-weight: 500; }
.form-card { max-width: 500px; }

/* Page title row */
.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.page-title-row h1 { margin: 0; }

/* Stats row (MyBooks overview) */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Stat cards */
.stat-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    flex: 1 1 120px;
    text-align: center;
    min-width: 100px;
}
.stat-number { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-label  { font-size: 0.85rem; color: var(--text); margin-top: 0.25rem; }

/* Misc */
.cover-thumb { width: 100px; border-radius: 6px; }
.pick-summary { display: flex; gap: 1.5rem; align-items: flex-start; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.error   { color: #c0392b; }
.success { color: var(--action); }
.warning { color: var(--warning); }

.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-fill);
    fill: color-mix(in srgb, currentColor 18%, transparent);
    stroke: currentColor;
    line-height: 1;
    flex-shrink: 0;
}

.theme-icon svg {
    fill: inherit;
    stroke: currentColor;
}

.theme-icon--nav {
    color: var(--nav-text, #f1fff6);
}

.theme-icon--danger {
    color: #c0392b;
}

.theme-icon--success {
    color: var(--action);
}

.theme-icon--text {
    color: var(--text);
}

.theme-icon--muted {
    color: var(--muted);
}

.theme-icon--inline {
    margin-right: 0.35rem;
}

.icon-text {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.sort-icon {
    font-size: 0.75rem;
    margin-left: 0.2rem;
    vertical-align: middle;
}

table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { text-align: left; padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border); }
th { font-weight: 600; background: var(--bg); }
tbody tr:nth-child(even) { background-color: var(--bg); }
tbody tr:hover           { background-color: var(--bg); background-color: var(--table-hover); }

blockquote {
    border-left: 3px solid var(--action);
    margin: 0.75rem 0;
    padding: 0.5rem 1rem;
    color: var(--muted);
    font-style: italic;
}

/* Book Ratings grid table */
.ratings-grid-table { width: auto; margin-top: 0; white-space: nowrap; }
.ratings-grid-table th,
.ratings-grid-table td { padding: 0.35rem 0.65rem; border: 1px solid var(--border); text-align: center; vertical-align: middle; }
.ratings-grid-table .book-cell    { text-align: left; min-width: 160px; white-space: normal; }
.ratings-grid-table .date-cell    { white-space: nowrap; }
.ratings-grid-table .rating-cell  { min-width: 52px; }
.ratings-grid-table .member-header { background: var(--bg); font-weight: 700; color: var(--text); }
.ratings-grid-table .avg-header   { background: var(--bg); font-weight: 700; color: var(--text); }
.ratings-grid-table .sub-header   { background: var(--bg); font-size: 0.78rem; font-weight: 600; color: var(--text); }
.ratings-grid-table .avg-cell     { font-weight: 700; }
.ratings-grid-table .sortable-th  { cursor: pointer; user-select: none; white-space: nowrap; }
.ratings-grid-table .sortable-th:hover { background: var(--bg); background: var(--table-hover); }
.ratings-grid-table .rating-cell-edit  { padding: 0.15rem 0.3rem; }
@keyframes ratingFlash {
    0%   { background-color: #b3f0c8; }
    60%  { background-color: #d4f7e2; }
    100% { background-color: transparent; }
}
.rating-cell-updated { animation: ratingFlash 1.5s ease-out; }

.inline-rating-input {
    width: 58px; padding: 0.2rem 0.25rem; font-size: 0.85rem;
    text-align: center; border: 1px solid var(--border); border-radius: 4px; background: #fff;
}
.inline-book-select {
    margin-top: 0.25rem; font-size: 0.8rem; padding: 0.15rem 0.3rem;
    border: 1px solid var(--border); border-radius: 4px; background: var(--bg); max-width: 180px;
}
.missing-book { color: #c0392b; font-weight: 600; font-size: 0.85rem; }

.confirm-dialog { border: 2px solid #c0392b; background: #fff5f5; padding: 1rem 1.25rem; margin-bottom: 1rem; }

/* Danger button (smaller variant) */
.btn-danger { background: #c0392b; color: #fff; border: none; padding: 0.35rem 0.85rem; border-radius: 4px; cursor: pointer; }
.btn-danger:hover { background: #a93226; }

/* Collapsible header */
.collapsible-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
.collapsible-header h2,
.collapsible-header h3 { margin: 0; }
.collapse-toggle { font-size: 0.85rem; color: var(--muted); display: inline-flex; }

/* Validation */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--action); }
.invalid             { outline: 1px solid #c0392b; }
.validation-message  { color: #c0392b; }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbmsiPjwvc3ZnPg==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem; color: white;
}
.blazor-error-boundary::after { content: "An error has occurred." }

/* My Books table */
.section-header { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.section-header h2 { margin: 0; }
.table-wrapper { overflow-x: auto; margin-top: 0.5rem; }
.table-wrapper-auto { display: flex; justify-content: flex-start; }
.table-wrapper-auto .my-books-table { width: auto; }

.table-filter-bar { display: flex; align-items: center; gap: 0; margin: 0.5rem 0; max-width: 360px; position: relative; }
.table-filter-input { flex: 1; padding: 0.35rem 2rem 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; background: var(--surface, #fff); color: var(--text); }
.table-filter-input:focus { outline: 2px solid var(--action); }
.table-filter-clear { position: absolute; right: 0.4rem; background: none; border: none; cursor: pointer; font-size: 0.85rem; color: var(--muted); padding: 0 0.25rem; line-height: 1; }

.my-books-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; white-space: nowrap; }
.my-books-table th,
.my-books-table td { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; }
.my-books-table th { background: var(--bg); font-weight: 600; }
.my-books-table .sortable-th { cursor: pointer; user-select: none; }
.my-books-table .sortable-th:hover { background: var(--bg); background: var(--table-hover); }
.my-books-table .center-cell { text-align: center; }

.table-input { width: 100%; min-width: 80px; padding: 0.25rem 0.4rem; font-size: 0.88rem; border: 1px solid var(--border); border-radius: 4px; box-sizing: border-box; }
.table-input-sm { min-width: 60px; max-width: 80px; }

/* 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: #fff;
    border-color: var(--action);
}

.live-progress-btn:hover {
    background: var(--primary);
}

/* 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; }
.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); }

/* Discussion sections / sequential reveal */
.discussion-columns { display: flex; gap: 1rem; min-width: 0; }
.discussion-columns .discussion-section { flex: 1 1 0; 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 top-5 grid */
.stats-top5-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin-bottom: 1rem; }
.stats-top5-grid .card { margin-bottom: 0; }
.stats-top5-grid ol { margin: 0.5rem 0 0; padding-left: 1.4rem; }
.stats-top5-grid li { margin-bottom: 0.75rem; font-size: 0.93rem; }
.stats-top5-grid li .author { color: var(--muted); 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-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: 175px;
    margin: 1.1rem 0.5rem 0;
}

.reading-speed-axis {
    position: absolute;
    left: 0;
    right: 0;
    top: 76px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--border), var(--action));
}

.reading-speed-axis-label {
    position: absolute;
    top: 88px;
    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-plot-card {
        grid-column: 1 / -1;
    }
}

/* Cover thumbnails */
.table-cover-thumb { display: block; max-height: 40px; width: auto; border-radius: 3px; margin: 0 auto 0.25rem auto; }
.book-card img.book-cover-sm { height: auto; max-height: 100px; width: auto; object-fit: contain; margin: 4px auto; }

/* Discussion / table cover images */
.discussion-cover-100 { width: 100px; height: auto; border-radius: 6px; display: block; margin-bottom: 0.5rem; flex-shrink: 0; }
.table-cover-60 { height: 60px; width: auto; border-radius: 4px; display: block; margin: 0 auto 0.25rem auto; }

/* Cover placeholder */
.cover-placeholder-block { display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; color: var(--muted); }
.cover-placeholder-100   { width: 100px; height: 140px; margin-bottom: 0.5rem; flex-shrink: 0; font-size: 2rem; }
.cover-placeholder-60    { height: 60px; width: 45px; margin-bottom: 0.25rem; font-size: 1.4rem; }

/* Cover loading wrapper — shows a spinner until image loads */
@keyframes coverSpin { to { transform: rotate(360deg); } }
.cover-load-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cover-load-wrap .cover-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 4px;
    border: 1px solid var(--border);
}
.cover-load-wrap .cover-spinner::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--action);
    border-radius: 50%;
    animation: coverSpin 0.7s linear infinite;
}
.cover-load-wrap.img-loaded .cover-spinner { display: none; }
/* Named wrapper sizes */
.disc-summary-cover-wrap { width: 110px; height: 160px; border-radius: 8px; }
.disc-next-pick-cover-wrap { width: 160px; height: 230px; border-radius: 10px; }

/* Sessions row */
.sessions-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: stretch; }
.sessions-row > .card { flex: 2 1 280px; margin-bottom: 0; }
.sessions-row > .host-queue-card { flex: 1 1 140px; }

/* 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 .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 > p {
    margin: 0;
}

.session-summary-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.session-summary-metrics p {
    margin: 0;
}

.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;
}

.next-discussion-start-btn {
    margin-top: 0;
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--action);
    background: var(--action);
    color: #fff;
    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: #fff;
    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: #fff;
    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: 1rem; }
.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; }

.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; }
.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; }

/* 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: 1.25rem; 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-top-layout > .statistics-section-card { height: 100%; display: flex; flex-direction: column; }
.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: 0; }
@media (max-width: 700px) { .stats-two-col { grid-template-columns: 1fr; } }
.statistics-section-card { margin-bottom: 1rem; }
.statistics-section-card--rankings { border-top: none; }

.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; }
.podium-slot { display: flex; flex-direction: column; align-items: center; width: 100px; }
.podium-cover { width: 80px; height: 110px; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.25); flex-shrink: 0; }
.podium-cover-placeholder { width: 80px; height: 110px; background: var(--border); border-radius: 4px; }
.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: 100px; }
.podium-block { 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-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); }
.stat-badge { background: var(--action); color: #fff; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.stat-badge--low { background: var(--warning); }
.stat-hint { font-size: 0.83rem; color: var(--muted); margin: 0.1rem 0 0.1rem; }
.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); }

/* Top nav */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }
.topnav { display: flex; align-items: center; padding: 0.75rem 2rem; background: var(--primary); color: #fff; }
.brand { font-weight: 700; font-size: 1.1rem; color: #fff; white-space: nowrap; flex-shrink: 0; }
.nav-links { display: flex; gap: 1rem; flex: 1; justify-content: center; }
.nav-links a { color: #cde8d8; text-decoration: none; font-size: 0.95rem; padding-bottom: 2px; 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; padding: 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: #fff; 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; }
.ol-result-item:last-child { border-bottom: none; }
.ol-result-item:hover { background: var(--bg); }
.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: 90px; align-items: flex-start; padding-top: 6px; }

.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-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   { background: var(--primary); border: 2px solid var(--primary); top: 4px; }

.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; }

/* ── 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-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;
}

/* ── 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-blue"] .reaction-btn {
    background: var(--surface);
}

[data-theme="black"] .live-chat-panel,
[data-theme="very-dark-blue"] .live-chat-panel {
    background: var(--surface);
}

[data-theme="black"] .note-bubble,
[data-theme="very-dark-blue"] .note-bubble {
    background: var(--surface);
}

[data-theme="black"] .note-bubble::after,
[data-theme="very-dark-blue"] .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: 420px;
    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: #fff;
    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: #fff;
    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: 420px;
    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;
}

/* 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;
}

.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;
}

/* 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: #fff;
    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: 440px;
    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-close-btn {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--action);
    color: #fff;
    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;
}
@media (max-width: 700px) {
    .home-bc-layout { grid-template-columns: 1fr; }
}

.home-next-pick-card h2,
.home-history-card h2 { margin-top: 0; }

.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;
}

.home-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.home-history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.home-history-cover {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ── Host Queue card ──────────────────────────────── */
.host-queue-card h2 { margin-top: 0; }

.host-queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.host-queue-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.host-queue-item--next {
    background: var(--surface);
    border-color: var(--action);
    font-weight: 700;
    padding: 0.4rem 0.6rem;
}

.host-queue-position {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--action);
    color: #fff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.host-queue-name { flex: 1; }

.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;
}

[data-theme="black"] .host-queue-position-badge .theme-icon,
[data-theme="very-dark-blue"] .host-queue-position-badge .theme-icon {
    color: var(--text);
}

.host-queue-requirements {
    display: grid;
    grid-template-columns: 0.8rem max-content;
    column-gap: 0.24rem;
    row-gap: 0.16rem;
    justify-content: end;
    align-items: center;
}

.host-queue-requirement {
    display: contents;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
}

.host-queue-requirement--complete {
    color: var(--text);
}

.host-queue-checkbox {
    position: relative;
    width: 0.72rem;
    height: 0.72rem;
    border: 1.25px solid currentColor;
    border-radius: 3px;
    justify-self: center;
}

.host-queue-requirement--complete .host-queue-checkbox {
    background: var(--action);
    border-color: var(--action);
}

.host-queue-requirement--complete .host-queue-checkbox::after {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 0.05rem;
    width: 0.22rem;
    height: 0.42rem;
    border: solid #fff;
    border-width: 0 1.6px 1.6px 0;
    transform: rotate(45deg);
}

.host-queue-start-btn {
    opacity: 0;
    pointer-events: none;
    transform: translateX(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    padding: 0.25rem 0.55rem;
    font-size: 0.78rem;
    white-space: nowrap;
}

.host-queue-item--next:hover .host-queue-start-btn,
.host-queue-start-btn:focus {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.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;
}

.punching-bag-chain {
    width: 4px;
    height: 72px;
    background: repeating-linear-gradient(
        to bottom,
        #8a6a40 0px,
        #8a6a40 6px,
        #c49a5c 6px,
        #c49a5c 12px
    );
    border-radius: 2px 2px 0 0;
    margin: 0 auto -2px;
}

.punching-bag-container {
    width: 150px;
    height: 290px;
    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: transform 0.1s ease;
    user-select: none;
    position: relative;
}

.punching-bag-container:hover {
    transform: scale(1.04);
    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,
.punching-bag-container.bag-punch-anim {
    animation: bagPunch 0.35s ease-out;
}

@keyframes bagPunch {
    0%   { transform: scale(1) rotate(0deg); }
    15%  { transform: scale(0.93) rotate(-6deg) translateX(-8px); }
    35%  { transform: scale(1.07) rotate(4deg) translateX(6px); }
    55%  { transform: scale(0.97) rotate(-2deg) translateX(-3px); }
    75%  { transform: scale(1.02) rotate(1deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.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; }
.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);
}

/* ── Profile dropdown in nav ─────────────────────────────────────────────── */
.nav-profile {
    position: relative;
}

.nav-profile-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--nav-text, #f1fff6);
    fill: var(--nav-text, #f1fff6);
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.nav-profile-btn:hover {
    background: rgba(134,186,152,0.12);
    color: var(--nav-text, #f1fff6);
    fill: var(--nav-text, #f1fff6);
}

.nav-profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--profile-color, #4caf82);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.nav-profile-btn:hover .nav-profile-avatar {
    transform: scale(1.1);
}

.nav-profile-caret {
    font-size: 0.65rem;
    transition: transform 0.2s;
    opacity: 0.7;
    color: inherit;
    fill: currentColor;
}

.nav-profile-caret--open {
    transform: rotate(180deg);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--primary-alt);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden;
    z-index: 500;
    transform-origin: top right;
    animation: dropdownIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.nav-dropdown a,
.nav-dropdown button.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 1rem;
    color: var(--nav-link, #c8e6cc);
    font-size: 0.9rem;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
    box-sizing: border-box;
}

.nav-dropdown a:hover,
.nav-dropdown button.nav-dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    color: var(--nav-text, #f1fff6);
}

.nav-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0;
}

/* ── User Settings page ──────────────────────────────────────────────────── */
.settings-card {
    max-width: 560px;
}

.settings-field {
    margin-bottom: 1.25rem;
}

.settings-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.settings-field input[type="text"],
.settings-field input[type="url"],
.settings-field input[type="password"] {
    width: 100%;
    box-sizing: border-box;
}

/* Profile icon row in settings */
.profile-icon-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 0.25rem;
}

/* ── Theme Palette ───────────────────────────────────────────────────────── */
.theme-palette-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem;
    cursor: pointer;
    margin-top: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 72px;
}

.theme-swatch:hover {
    border-color: var(--action);
    background: transparent;
}

.theme-swatch--active {
    border-color: var(--action);
    box-shadow: 0 0 0 2px var(--action);
}

.theme-swatch-preview {
    width: 60px;
    height: 42px;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.15);
}

.theme-swatch-nav {
    height: 12px;
    flex-shrink: 0;
}

.theme-swatch-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}

.theme-swatch-btn {
    width: 28px;
    height: 10px;
    border-radius: 3px;
    display: block;
}

.theme-swatch-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* ── Waiting room leave / return banner ─────────────────────────────────── */
.waiting-room-return-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--action);
    color: #fff;
    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;
}
