/* ==========================================================================
   StudyVerse - Leaderboard (public landing page + student panel)
   Theme: primary #0f79f3, white rounded-10 card, light table rows.
   ========================================================================== */

.lb.card {
    border: 1px solid #e6ebf2 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.05);
}
[data-theme=dark] .lb.card { border-color: #172341 !important; }
.lb {
    --lb-primary: #0f79f3;
    --lb-primary-soft: #eef4fe;
    --lb-primary-line: #cfe0fb;
    --lb-text: #1e293b;
    --lb-text-2: #475569;
    --lb-muted: #64748b;
    --lb-faint: #94a3b8;
    --lb-border: #eef1f6;
    --lb-head-bg: #f8fafc;
    --lb-gold: #d99a00;
    --lb-gold-soft: #fff6db;
    --lb-silver: #64748b;
    --lb-silver-soft: #eef1f5;
    --lb-bronze: #c2622d;
    --lb-bronze-soft: #fcefe6;
    color: var(--lb-text);
    overflow: hidden;
}

/* Shared buttons (also used in popover + modal, outside .lb) */
.lb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lb-btn:hover { border-color: #0f79f3; color: #0f79f3; }
.lb-btn.is-primary { background: #0f79f3; border-color: #0f79f3; color: #fff; }
.lb-btn.is-primary:hover { background: #0b6ad8; border-color: #0b6ad8; color: #fff; }
.lb-btn.is-disabled { background: #f3f5f9; color: #94a3b8; border-color: #eef1f6; cursor: not-allowed; }

/* ─── Header: tabs (rank by) + period, then title ──── */
.lb-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 0 20px;
    border-bottom: 1px solid var(--lb-border);
}
.lb-tabs { display: flex; gap: 4px; }
.lb-tabs a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px 13px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--lb-muted);
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}
.lb-tabs a i { font-size: 20px; color: var(--lb-faint); }
.lb-tabs a span { display: flex; flex-direction: column; line-height: 1.25; }
.lb-tabs a b { font-size: 14px; font-weight: 600; color: var(--lb-text-2); }
.lb-tabs a small { font-size: 11.5px; color: var(--lb-faint); }
.lb-tabs a:hover b, .lb-tabs a:hover i { color: var(--lb-primary); }
.lb-tabs a.active { border-bottom-color: var(--lb-primary); }
.lb-tabs a.active i, .lb-tabs a.active b { color: var(--lb-primary); }

.lb-period { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.lb-segment {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border-radius: 8px;
    background: #f1f5f9;
}
.lb-segment a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 6px;
    color: var(--lb-muted);
    font-weight: 500;
    font-size: 12.5px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.lb-segment a:hover { color: var(--lb-text); }
.lb-segment a.active { background: #fff; color: var(--lb-text); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1); }

.lb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 4px; }
.lb-head-copy { min-width: 0; }
.lb-share-btn { flex-shrink: 0; height: 36px; padding: 0 14px; }
.lb-title { font-size: 17px; font-weight: 700; color: var(--lb-text); margin: 0 0 6px; }
.lb-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--lb-muted); }
.lb-meta span { display: inline-flex; align-items: center; gap: 5px; }
.lb-meta i { font-size: 15px; color: var(--lb-faint); }

[data-theme=dark] .lb-segment { background: #111c34; }
[data-theme=dark] .lb-segment a.active { background: #1e2a47; color: #e2e8f0; }

/* ─── Your rank strip ───────────────────────────────── */
.lb-me {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 20px 4px;
    padding: 10px 16px;
    border: 1px solid var(--lb-primary-line);
    border-radius: 10px;
    background: var(--lb-primary-soft);
    cursor: pointer;
}
.lb-me:focus-visible { outline: 2px solid var(--lb-primary); outline-offset: 2px; }
.lb-me .lb-who { flex: 1; }
.lb-me-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--lb-primary);
}
.lb-me.is-note { cursor: default; background: #fff; border-style: dashed; border-color: #dbe3ee; }
.lb-me-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--lb-primary-soft);
    color: var(--lb-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}
.lb-me-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lb-me-copy strong { font-size: 14px; font-weight: 600; color: var(--lb-text); }
.lb-me-copy span { font-size: 13px; color: var(--lb-muted); }

/* ─── Avatars ───────────────────────────────────────── */
.lb-avatar {
    --size: 36px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
}
.lb-avatar-xl { --size: 76px; }
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-avatar b { display: none; font-weight: 600; font-size: calc(var(--size) * 0.38); color: #fff; }
.lb-avatar.is-initials, .lb-avatar.is-fallback { background: var(--av, #0f79f3); }
.lb-avatar.is-initials b, .lb-avatar.is-fallback b { display: inline; }
.lb-avatar.is-blurred { background: #e2e8f0; color: #94a3b8; }
.lb-avatar.is-blurred i { font-size: calc(var(--size) * 0.5); filter: blur(1.5px); }

/* ─── Rank badge ────────────────────────────────────── */
.lb-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--lb-text-2);
    font-variant-numeric: tabular-nums;
}
.lb-rank i { font-size: 14px; }
.lb-rank.place-1 { background: var(--lb-gold-soft); color: var(--lb-gold); }
.lb-rank.place-2 { background: var(--lb-silver-soft); color: var(--lb-silver); }
.lb-rank.place-3 { background: var(--lb-bronze-soft); color: var(--lb-bronze); }
.lb-me .lb-rank { background: var(--lb-primary); color: #fff; }

/* ─── Table ─────────────────────────────────────────── */
.lb-table-wrap { padding: 12px 20px 0; }
.lb-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.lb-table th {
    padding: 10px 14px;
    background: var(--lb-head-bg);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--lb-muted);
    border-bottom: 1px solid var(--lb-border);
    white-space: nowrap;
}
.lb-table th:first-child { border-top-left-radius: 8px; }
.lb-table th:last-child { border-top-right-radius: 8px; }
.lb-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--lb-border);
    vertical-align: middle;
}
.lb-table tbody tr { cursor: pointer; transition: background 0.12s; }
.lb-table tbody tr:hover, .lb-table tbody tr:focus-visible { background: #f8fafc; outline: none; }
.lb-table tbody tr.is-me { background: var(--lb-primary-soft); }
.lb-table tbody tr.is-me td:first-child { box-shadow: inset 3px 0 0 var(--lb-primary); }
.lb-table tbody tr:last-child td { border-bottom: 0; }
.lb-col-rank { width: 80px; }
.lb-col-score { width: 130px; text-align: right; white-space: nowrap; }

.lb-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--lb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-name em { font-style: normal; font-weight: 500; color: var(--lb-primary); font-size: 0.9em; }
.lb-name.is-blurred { color: var(--lb-muted); letter-spacing: 0.5px; }
.lb-score { font-weight: 600; font-size: 14px; color: var(--lb-text); font-variant-numeric: tabular-nums; }
.lb-table tr.lb-gap { cursor: default; }
.lb-table tr.lb-gap:hover { background: none; }
.lb-table tr.lb-gap td { text-align: center; color: var(--lb-faint); padding: 2px; font-size: 16px; line-height: 1; }

/* ─── Empty + footnote ──────────────────────────────── */
.lb-empty { text-align: center; padding: 48px 20px 32px; }
.lb-empty h5 { font-weight: 600; font-size: 16px; margin: 12px 0 4px; }
.lb-empty p { color: var(--lb-muted); margin: 0; font-size: 14px; }
.lb-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border-radius: 12px;
    background: var(--lb-primary-soft);
    color: var(--lb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.lb-footnote {
    display: flex;
    gap: 6px;
    margin: 12px 0 0;
    padding: 14px 20px;
    border-top: 1px solid var(--lb-border);
    font-size: 12.5px;
    color: var(--lb-muted);
}
.lb-footnote i { font-size: 14px; margin-top: 1px; color: var(--lb-faint); }

/* ─── Guest popover ─────────────────────────────────── */
.lb-popover { --bs-popover-max-width: 270px; --bs-popover-border-color: #e5e9f2; border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); }
.lb-popover .popover-body { padding: 16px; }
.lb-pop { text-align: center; }
.lb-pop-icon {
    width: 38px;
    height: 38px;
    margin: 0 auto 8px;
    border-radius: 8px;
    background: #eef4fe;
    color: #0f79f3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}
.lb-pop-title { font-weight: 600; color: #1e293b; font-size: 0.9rem; }
.lb-pop-text { color: #64748b; font-size: 0.8rem; margin: 4px 0 12px; }
.lb-pop-actions { display: flex; gap: 8px; justify-content: center; }
.lb-pop-actions .lb-btn { height: 34px; padding: 0 14px; font-size: 0.8rem; }

/* ─── Details modal (compact student card) ───────────── */
.lb-modal .modal-dialog { max-width: 400px; }
.lb-modal .modal-content { border: 0; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 25px 60px rgba(0, 0, 0, .15); }
.lb-modal-close {
    position: absolute; top: 12px; right: 12px; z-index: 2; width: 28px; height: 28px; padding: 0; border-radius: 50%;
    background-color: rgba(255, 255, 255, .8); background-size: 10px; opacity: .9;
}
.lb-modal-body { padding: 0; }
.lb-modal-loading { padding: 40px 0; text-align: center; color: #64748b; font-size: 0.9rem; }

.lbu-cover { height: 96px; background: linear-gradient(135deg, #0f79f3 0%, #4b92f7 55%, #796df6 100%); }
.lbu-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lbu-main { padding: 0 22px 20px; text-align: center; }
.lbu-avatar { --size: 76px; margin-top: -38px; box-shadow: 0 0 0 4px #fff, 0 6px 16px rgba(15, 23, 42, .12); }
.lbu-main h5 { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; font-size: 18px; font-weight: 700; color: #1e293b; }
.lbu-you { font-size: 11px; font-weight: 600; color: #0f79f3; background: #eef4fe; border-radius: 4px; padding: 1px 7px; }
.lbu-sub { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 2px; font-size: 13px; color: #64748b; }
.lbu-handle { color: #0f79f3; font-weight: 500; }
.lbu-sep { width: 3px; height: 3px; border-radius: 50%; background: #cbd5e1; }
.lbu-bio {
    margin: 10px auto 0; max-width: 320px; font-size: 13px; line-height: 1.5; color: #64748b;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}

.lbu-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; padding: 12px 0; border-radius: 12px; background: #f8fafc; }
.lbu-stats > div + div { border-left: 1px solid #e9eef5; }
.lbu-stats strong { display: block; font-size: 17px; font-weight: 700; color: #1e293b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lbu-stats small { font-size: 12px; font-weight: 600; color: #94a3b8; margin-left: 1px; }
.lbu-stats span { font-size: 11.5px; color: #64748b; }

.lbu-badges { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lbu-badges .bstack { justify-content: center; padding-top: 2px; }
.lbu-badges small { font-size: 12px; color: #94a3b8; }

.lbu-ranks { margin-top: 16px; }
.lbu-ranks-head { font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: #94a3b8; margin-bottom: 8px; }
.lbu-ranks-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lbu-rank { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #eef1f6; border-radius: 10px; font-size: 13px; color: #475569; }
.lbu-rank i { font-size: 16px; color: #94a3b8; }
.lbu-rank b { margin-left: auto; font-size: 15px; font-weight: 700; color: #cbd5e1; }
.lbu-rank b:not(:empty) { color: #1e293b; }
.lbu-rank.is-top { border-color: #cfe0fb; background: #f5f9ff; }
.lbu-rank.is-top i, .lbu-rank.is-top b { color: #0f79f3; }

.lbu-foot { margin-top: 18px; }
.lbu-foot .lb-btn { width: 100%; height: 42px; gap: 6px; }
.lbu-private { display: flex; align-items: center; justify-content: center; gap: 6px; height: 42px; border-radius: 8px; background: #f8fafc; color: #94a3b8; font-size: 13px; }

[data-theme=dark] .lb-modal .modal-content { background: #0c1427; }
[data-theme=dark] .lbu-avatar { box-shadow: 0 0 0 4px #0c1427; }
[data-theme=dark] .lbu-main h5, [data-theme=dark] .lbu-stats strong, [data-theme=dark] .lbu-rank b:not(:empty) { color: #e2e8f0; }
[data-theme=dark] .lbu-stats, [data-theme=dark] .lbu-private { background: #111c34; }
[data-theme=dark] .lbu-stats > div + div, [data-theme=dark] .lbu-rank { border-color: #172341; }
[data-theme=dark] .lbu-rank.is-top { background: rgba(15, 121, 243, .1); border-color: rgba(15, 121, 243, .35); }
[data-theme=dark] .lbu-you { background: rgba(15, 121, 243, .15); }

/* ─── Share modal (same look as the badge share modal) ─── */
#lbShare .modal-content { border: 0; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 25px 60px rgba(0, 0, 0, .15), 0 8px 24px rgba(0, 0, 0, .12); }
.lbs-dialog { max-width: 560px; transition: max-width .2s; }
.lbs-dialog.is-square { max-width: 480px; }
.lbs-dialog.is-portrait { max-width: 440px; }
.lbs-dialog.is-link { max-width: 500px; }
.lbs-header { position: relative; padding: 1.5rem; background: linear-gradient(135deg, #0f79f3 0%, #4b92f7 100%); }
.lbs-header h5 { color: #fff; }
.lbs-header p { color: rgba(255, 255, 255, .85); font-size: .82rem; }
.lbs-close {
    position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .2); color: #fff; font-size: 16px;
}
.lbs-close:hover { background: rgba(255, 255, 255, .35); }
.lbs-icon-ring { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lbs-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .25); display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; }
.lbs-label { display: block; margin-bottom: 6px; font-size: .65rem; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: #64748b; }
.lbs-formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.lbs-formats button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 8px;
    border: 1.5px solid #e2e8f0; border-radius: 10px; background: #fff; transition: all .15s ease;
}
.lbs-formats button b { font-size: 13px; font-weight: 600; color: #334155; }
.lbs-formats button small { font-size: 11px; color: #64748b; text-align: center; line-height: 1.3; }
.lbs-formats button:hover { border-color: #cbd5e1; background: #f8fafc; }
.lbs-formats button.is-active { border-color: #0f79f3; background: #eff6ff; }
.lbs-formats button.is-active b { color: #0f79f3; }
.lbs-fmt { display: block; border: 2px solid #94a3b8; border-radius: 4px; margin-bottom: 4px; }
.lbs-fmt.is-landscape { width: 26px; height: 14px; }
.lbs-fmt.is-square { width: 18px; height: 18px; }
.lbs-fmt.is-portrait { width: 16px; height: 20px; }
.lbs-formats button.is-active .lbs-fmt { border-color: #0f79f3; }
.lbs-preview { border-radius: 12px; overflow: hidden; background: #0b1b3a; border: 1px solid #e2e8f0; box-shadow: 0 10px 25px -5px rgba(15, 23, 42, .12); }
.lbs-preview canvas { display: block; width: 100%; height: auto; }
.lbs-actions { display: flex; gap: 10px; margin-top: 1.25rem; }
.lbs-actions .lbs-btn { flex: 1; }
.lbs-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
    border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #64748b; font-size: .85rem; font-weight: 600;
    white-space: nowrap; transition: all .15s ease;
}
.lbs-btn:hover { background: #f8fafc; color: #1e293b; border-color: #cbd5e1; }
.lbs-btn.is-primary { background: #0f79f3; border-color: #0f79f3; color: #fff; }
.lbs-btn.is-primary:hover { background: #0b6ad8; border-color: #0b6ad8; color: #fff; }
.lbs-actions .lbs-btn[hidden] { display: none; }
.lbs-btn.is-done { background: #16a34a !important; border-color: #16a34a !important; color: #fff !important; }
.lbs-tip { display: flex; gap: 6px; margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: #64748b; }
.lbs-tip i { color: #94a3b8; font-size: 14px; margin-top: 1px; }
/* shorter than the screen: the body scrolls inside */
#lbShare .modal-dialog-scrollable { height: auto; max-height: none; }
#lbShare .modal-dialog-scrollable .modal-content { max-height: min(640px, calc(100vh - 120px)); max-height: min(640px, calc(100dvh - 120px)); }
@media (max-width: 575.98px) {
    #lbShare .modal-dialog { margin: 0 12px; min-height: 100%; }
    #lbShare .modal-dialog-scrollable .modal-content { max-height: calc(100dvh - 96px); }
    .lbs-header { padding: 1rem 1.25rem; }
    .lbs-icon-ring { width: 44px; height: 44px; }
    .lbs-icon { width: 32px; height: 32px; font-size: 16px; }
}
#lbShare .modal-body { overflow-y: auto; }
.lbs-header { flex-shrink: 0; }
.lbs-note { display: block; margin: 8px 2px 0; font-size: 12px; line-height: 1.5; color: #64748b; }
.lbs-note a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; color: #0f79f3; font-weight: 500; text-decoration: none; }
.lbs-note a:hover { text-decoration: underline; }
.lbs-note a i { font-size: 12px; margin-left: 3px; vertical-align: -1px; }
.lbs-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; font-size: 12px; color: #94a3b8; }
.lbs-or::before, .lbs-or::after { content: ""; flex: 1; height: 1px; background: #eef1f6; }
.lbs-link { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.lbs-link i { color: #94a3b8; font-size: 16px; }
.lbs-link input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 13px; color: #475569; outline: none; }
.lbs-link .lbs-btn { height: 34px; padding: 0 14px; }
.lbs-via { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.lbs-via a {
    display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; font-weight: 500; color: #475569; text-decoration: none; transition: all .15s ease;
}
.lbs-via a i { font-size: 16px; }
.lbs-via a.is-wa i { color: #16a34a; }
.lbs-via a.is-x i { color: #0f172a; }
.lbs-via a.is-in i { color: #0a66c2; }
.lbs-via a.is-tg i { color: #229ed9; }
.lbs-via a:hover { border-color: #cfe0fb; background: #f8fbff; color: #0f79f3; }
@media (max-width: 575.98px) {
    .lbs-formats button small { display: none; }
    .lbs-via { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lb-share-btn { padding: 0 10px; }
}
[data-theme=dark] #lbShare .modal-content { background: #0c1427; }
[data-theme=dark] .lbs-formats button, [data-theme=dark] .lbs-btn:not(.is-primary), [data-theme=dark] .lbs-via a { background: #0c1427; border-color: #172341; color: #cbd5e1; }
[data-theme=dark] .lbs-formats button b { color: #e2e8f0; }
[data-theme=dark] .lbs-formats button.is-active { background: rgba(15, 121, 243, .12); border-color: #0f79f3; }
[data-theme=dark] .lbs-link { background: #111c34; border-color: #172341; }
[data-theme=dark] .lbs-link input { color: #cbd5e1; }
[data-theme=dark] .lbs-via a.is-x i { color: #e2e8f0; }
[data-theme=dark] .lbs-or::before, [data-theme=dark] .lbs-or::after { background: #172341; }

/* Public page */
.lb-public-head h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.lb-public .lb { max-width: 960px; margin: 0 auto; box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06); }

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 991.98px) {
}

@media (max-width: 767.98px) {
    .lb-bar { padding: 0 16px; gap: 0; }
    .lb-tabs { width: 100%; }
    .lb-tabs a { flex: 1; padding: 13px 6px 11px; gap: 8px; }
    .lb-tabs a small { display: none; }
    .lb-period { width: 100%; }
    .lb-segment { flex: 1; }
    .lb-segment a { flex: 1; padding: 6px 4px; }
    .lb-head { padding: 16px 16px 2px; }
    .lb-title { font-size: 16px; }

    .lb-me { margin: 14px 16px 2px; padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
    .lb-me-label { width: 100%; }
    .lb-me.is-note .lb-btn { width: 100%; }

    .lb-table-wrap { padding: 10px 16px 0; }
    .lb-table th, .lb-table td { padding: 9px 8px; }
    .lb-col-rank { width: 56px; }
    .lb-col-score { width: 92px; }
    .lb-rank { min-width: 28px; height: 26px; padding: 0 6px; font-size: 13px; }
    .lb-avatar { --size: 32px; }
    .lb-avatar-xl { --size: 68px; }
    .lbu-avatar { --size: 72px; }
    .lb-who { gap: 10px; }
    .lb-name, .lb-score { font-size: 13.5px; }

    .lb-footnote { padding: 12px 16px; }

    .lb-modal-body { padding: 24px 16px 18px; }
    .lb-modal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lb-modal-stats > div:nth-child(3) { border-left: 0; }
    .lb-modal-stats > div:nth-child(n + 3) { border-top: 1px solid #eef1f6; }
    .lb-rank-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lb-rank-chip { border-right: 0 !important; border-bottom: 1px solid #eef1f6 !important; }
    .lb-rank-chip:nth-child(odd) { border-right: 1px solid #eef1f6 !important; }
    .lb-rank-chip:nth-last-child(-n + 2) { border-bottom: 0 !important; }
}
