/* Lingkar Reader: komentar, ikuti kategori, modal login Google, kartu ajakan, berita premium. */
:root {
    --lr-accent: var(--scheme-color, #d32f2f);
    --lr-bg: #fff;
    --lr-bg-soft: #f8fafc;
    --lr-text: #111827;
    --lr-text-2: #374151;
    --lr-muted: #6b7280;
    --lr-border: rgba(0, 0, 0, 0.08);
    --lr-border-strong: rgba(0, 0, 0, 0.15);
    --lr-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
html.theme-dark {
    --lr-bg: #111827;
    --lr-bg-soft: #1f2937;
    --lr-text: #f3f4f6;
    --lr-text-2: #d1d5db;
    --lr-muted: #9ca3af;
    --lr-border: rgba(255, 255, 255, 0.1);
    --lr-border-strong: rgba(255, 255, 255, 0.2);
    --lr-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
html.lr-no-scroll { overflow: hidden; }

.lr-section {
    margin: 2rem 0;
    padding: 1.25rem;
    border: 1px solid var(--lr-border);
    border-radius: 12px;
    background: var(--lr-bg);
    color: var(--lr-text);
}
.lr-section__title {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin: 0 0 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}
.lr-section__title [data-count] {
    color: var(--lr-muted);
    font-weight: 500;
    font-size: 0.95rem;
}
.lr-follow-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: var(--lr-bg-soft);
    font-size: 0.9rem;
    color: var(--lr-text-2);
}
.lr-follow-row p {
    margin: 0;
    flex: 1 1 14rem;
}
.lr-follow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--lr-accent);
    border-radius: 999px;
    background: var(--lr-accent);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.lr-follow:hover { opacity: 0.9; }
.lr-follow:disabled { opacity: 0.6; cursor: wait; }
.lr-follow--on {
    background: var(--lr-bg);
    color: var(--lr-accent);
}
.lr-me {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.875rem;
    color: var(--lr-text-2);
}
.lr-me .lr-link { margin-left: auto; }
.lr-login-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px dashed var(--lr-border-strong);
    border-radius: 10px;
}
.lr-login-cta p { margin: 0; flex: 1 1 14rem; font-size: 0.9rem; color: var(--lr-text-2); }
.lr-gbtn { min-height: 44px; }
.lr-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--lr-border-strong);
    border-radius: 10px;
    background: var(--lr-bg);
    color: var(--lr-text);
    font: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 4.5rem;
}
.lr-form--compact textarea { min-height: 3rem; }
.lr-form textarea:focus {
    outline: 2px solid var(--lr-accent);
    outline-offset: 1px;
    border-color: transparent;
}
.lr-form__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.lr-counter { margin-right: auto; font-size: 0.75rem; color: var(--lr-muted); }
.lr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border: 0;
    border-radius: 999px;
    background: var(--lr-accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.lr-btn:hover { opacity: 0.92; }
.lr-btn:active { transform: scale(0.98); }
.lr-btn:disabled { opacity: 0.6; cursor: wait; }
.lr-btn--lg {
    padding: 0.75rem 1.4rem;
    font-size: 0.95rem;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--lr-accent) 30%, transparent);
}
.lr-btn--ghost {
    background: transparent;
    color: var(--lr-accent);
    border: 1px solid currentColor;
    box-shadow: none;
}
.lr-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--lr-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.lr-link:hover { color: var(--lr-accent); }
.lr-link--danger:hover { color: #b91c1c; }
.lr-list { margin-top: 1.25rem; }
.lr-comment {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--lr-border);
}
.lr-comment--reply {
    padding: 0.75rem 0 0;
    border-top: 0;
}
.lr-comment__main { flex: 1; min-width: 0; }
.lr-comment__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.875rem;
}
.lr-comment__head time { color: var(--lr-muted); font-size: 0.75rem; }
.lr-comment__body {
    margin: 0.25rem 0 0.35rem;
    font-size: 0.95rem;
    line-height: 1.55;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.lr-comment__actions { display: flex; gap: 1rem; }
.lr-replies { padding-left: 0.25rem; }
.lr-reply-slot:not(:empty) { margin-top: 0.6rem; }
.lr-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}
.lr-comment--reply .lr-avatar { flex-basis: 28px; width: 28px; height: 28px; }
.lr-avatar--initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    background: var(--lr-accent);
}
.lr-muted { color: var(--lr-muted); font-size: 0.875rem; }
.lr-more { display: block; margin: 1rem auto 0; }
.lr-more[hidden] { display: none; }

/* ---------- Identitas & daftar manfaat ---------- */
.lr-brand-mark {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--lr-accent), color-mix(in srgb, var(--lr-accent) 65%, #000));
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--lr-accent) 35%, transparent);
}
.lr-benefits {
    display: grid;
    gap: 0.65rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    text-align: left;
}
.lr-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    background: var(--lr-bg-soft);
}
.lr-benefits__icon {
    flex: 0 0 auto;
    font-size: 1.25rem;
    line-height: 1.2;
}
.lr-benefits strong {
    display: block;
    color: var(--lr-text);
    font-size: 0.9rem;
}
.lr-benefits small {
    display: block;
    margin-top: 0.1rem;
    color: var(--lr-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}
.lr-benefits--inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}
.lr-benefits--inline li {
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    color: var(--lr-text-2);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---------- Modal login ---------- */
.lr-modal {
    position: fixed;
    inset: 0;
    z-index: 10005;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.lr-modal--open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}
.lr-modal__box {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 1.75rem 1.5rem 1.25rem;
    border-radius: 20px;
    background: var(--lr-bg);
    color: var(--lr-text);
    text-align: center;
    box-shadow: var(--lr-shadow);
    transform: translateY(12px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lr-modal--open .lr-modal__box { transform: none; }
.lr-modal__close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--lr-bg-soft);
    color: var(--lr-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.lr-modal__close:hover { color: var(--lr-text); }
.lr-modal__hero { margin-bottom: 1.1rem; }
.lr-modal__hero .lr-brand-mark { margin-bottom: 0.85rem; }
.lr-modal__title { margin: 0 0 0.4rem; font-size: 1.3rem; font-weight: 800; line-height: 1.25; color: var(--lr-text); }
.lr-modal__reason { margin: 0; color: var(--lr-text-2); font-size: 0.9rem; line-height: 1.5; }
.lr-modal__gbtn { display: flex; justify-content: center; min-height: 44px; }
.lr-modal__note { margin: 1rem 0 0; color: var(--lr-muted); font-size: 0.72rem; line-height: 1.45; }

/* ---------- Kartu bawah (ajakan masuk & notifikasi) ---------- */
.lr-sheet {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9990;
    width: min(390px, calc(100vw - 2rem));
    box-sizing: border-box;
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid var(--lr-border);
    border-radius: 18px;
    background: var(--lr-bg);
    color: var(--lr-text);
    box-shadow: var(--lr-shadow);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lr-sheet--open { opacity: 1; transform: none; }
.lr-sheet__close {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--lr-muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}
.lr-sheet__close:hover { background: var(--lr-bg-soft); color: var(--lr-text); }
.lr-sheet__head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-right: 1.75rem;
    margin-bottom: 0.65rem;
}
.lr-sheet__head .lr-brand-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 1.25rem; }
.lr-sheet__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: color-mix(in srgb, var(--lr-accent) 12%, var(--lr-bg));
    font-size: 1.35rem;
}
.lr-sheet__eyebrow {
    margin: 0;
    color: var(--lr-accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.lr-sheet__title { margin: 0.1rem 0 0; font-size: 1.05rem; font-weight: 800; line-height: 1.3; color: var(--lr-text); }
.lr-sheet__text { margin: 0 0 0.9rem; color: var(--lr-text-2); font-size: 0.875rem; line-height: 1.5; }
.lr-sheet__gbtn { display: flex; justify-content: center; min-height: 44px; }
.lr-sheet__later { display: block; margin: 0.65rem auto 0; }
.lr-sheet__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.lr-sheet__actions .lr-btn { flex: 1; }
.lr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    max-height: 9.5rem;
    overflow-y: auto;
    margin: 0 0 1rem;
}
.lr-chip {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--lr-border-strong);
    border-radius: 999px;
    background: var(--lr-bg);
    color: var(--lr-text-2);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lr-chip[aria-pressed="true"] {
    border-color: var(--lr-accent);
    background: var(--lr-accent);
    color: #fff;
}
.lr-chip[aria-pressed="true"]::before { content: "✓ "; }

/* ---------- Berita premium ---------- */
.lr-premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.6rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.lr-premium-locked {
    position: relative;
    margin: 0 0 1.5rem;
    transition: opacity 0.3s ease;
}
.lr-premium-locked--open { opacity: 0; }
.lr-premium-fade {
    position: relative;
    height: 7rem;
    margin-top: -7rem;
    background: linear-gradient(to bottom, transparent, var(--lr-bg) 88%);
    pointer-events: none;
}
.lr-premium-card {
    padding: 1.5rem 1.25rem;
    border: 1px solid color-mix(in srgb, var(--lr-accent) 25%, var(--lr-border));
    border-radius: 18px;
    background:
        radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--lr-accent) 9%, transparent), transparent 70%),
        var(--lr-bg);
    color: var(--lr-text);
    text-align: center;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.1);
}
.lr-premium-card__eyebrow {
    display: inline-flex;
    gap: 0.35rem;
    color: #d97706;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.lr-premium-card__title {
    margin: 0.35rem 0 0.5rem;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--lr-text);
}
.lr-premium-card__text {
    max-width: 30rem;
    margin: 0 auto 1rem;
    color: var(--lr-text-2);
    font-size: 0.95rem;
    line-height: 1.55;
}
.lr-premium-card .lr-benefits--inline { margin-bottom: 1.25rem; }
.lr-premium-card__action {
    display: flex;
    justify-content: center;
    min-height: 44px;
}
.lr-premium-card__busy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--lr-muted);
    font-size: 0.9rem;
}
.lr-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--lr-border-strong);
    border-top-color: var(--lr-accent);
    border-radius: 50%;
    animation: lr-spin 0.8s linear infinite;
}
@keyframes lr-spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.lr-toast {
    position: fixed;
    left: 50%;
    bottom: 5.5rem;
    z-index: 10010;
    max-width: min(92vw, 420px);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.lr-toast--show { opacity: 1; transform: translate(-50%, 0); }
.lr-toast--error { background: #b91c1c; }
.lr-taxonomy-follow { margin: 0.5rem 0 1rem; }

@media (max-width: 600px) {
    .lr-modal { align-items: flex-end; padding: 0; }
    .lr-modal__box {
        max-width: none;
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
        transform: translateY(40px);
    }
    .lr-sheet {
        right: 0;
        bottom: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        border-width: 1px 0 0;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
    .lr-premium-card { padding: 1.25rem 1rem; }
    .lr-premium-card__title { font-size: 1.15rem; }
}

/* Kartu ajakan duduk di atas navigasi bawah (tema klasik, layar < 992px). */
@media (max-width: 991px) {
    body.tenant-skin-classic .lr-sheet { bottom: calc(56px + 0.75rem + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 600px) {
    body.tenant-skin-classic .lr-sheet {
        bottom: calc(52px + env(safe-area-inset-bottom, 0px));
        padding-bottom: 1rem;
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.14);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lr-modal, .lr-modal__box, .lr-sheet, .lr-premium-locked { transition: none; }
}

/* Tombol akun pembaca di header */
.reader-account-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 4px;
    border-radius: 50%;
    color: inherit;
    text-decoration: none;
}

.reader-account-btn img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.reader-account-btn.is-signed-in { box-shadow: 0 0 0 2px #16a34a; }
