/* ═══════════════════════════════════════════════════════════════
   The Clinical Lighthouse — Article Page Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ── Article layout ── */
.article-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* ── Article header ── */
.article-header {
    margin-bottom: 32px;
}

.article-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.article-meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
}

.article-meta-info .meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--muted);
    display: inline-block;
    vertical-align: middle;
}

.article-title {
    font-size: 36px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--fg);
    margin-bottom: 12px;
}

.article-dek {
    font-size: 18px;
    line-height: 1.6;
    color: var(--muted);
}

/* ── Hero image ── */
.article-hero {
    margin: 0 0 40px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.article-hero .hero-img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Article content typography ── */
.article-content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--fg);
}

.article-content h2 {
    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 48px;
    margin-bottom: 16px;
    color: var(--fg);
}

.article-content h3 {
    font-size: 21px;
    line-height: 1.4;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--fg);
}

.article-content p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.article-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.article-content a:hover {
    border-bottom-color: var(--accent);
}

/* Override link styles inside study-info-card */
.article-content .study-info-card a {
    color: #fff;
    border-bottom-color: transparent;
}

.article-content .study-info-card a:hover {
    color: #fff;
    border-bottom-color: transparent;
}

.article-content .study-info-card a.study-title-link {
    color: #fff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 4px;
}

.article-content .study-info-card a.study-title-link:hover {
    color: #fff;
    border-bottom-color: #fff;
    opacity: 0.9;
}

.article-content strong {
    font-weight: 700;
    color: var(--fg);
}

.article-content ul,
.article-content ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.article-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

/* ── "For Doctors in a Hurry" summary box ── */
.paper-summary {
    background: var(--card);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 8px 0 40px;
    box-shadow: 0 2px 8px var(--shadow);
}

.paper-summary-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 16px;
}

.paper-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.paper-summary li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--fg);
}

.paper-summary li:last-child {
    margin-bottom: 0;
}

.paper-summary li::before {
    content: "\2192";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* ── Study Info card ── */
.study-info-card {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius);
    padding: 32px;
    margin: 48px 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.study-info-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.9);
}

.study-title-link {
    font-size: 19px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    display: block;
    margin-bottom: 16px;
    line-height: 1.4;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 4px;
    transition: all 0.2s ease;
}

.study-title-link:hover {
    color: #fff;
    border-bottom-color: #fff;
}

.study-authors {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 16px;
}

.study-authors .inst {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
}

.study-meta-row {
    display: flex;
    gap: 24px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.study-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.study-meta-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.75);
}

.study-meta-value {
    font-size: 14px;
    color: white;
    font-weight: 500;
}

/* ── References section ── */
.article-content h2#references {
    font-size: 22px;
    margin-top: 32px;
}

/* ── Subscribe gate ── */
.subscribe-gate {
    position: relative;
    margin-top: 0;
}

/* Teaser: shows beginning of article content with fade-out */
.gate-teaser {
    position: relative;
    max-height: 180px;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}
.gate-teaser__content {
    font-size: 17px;
    line-height: 1.8;
    color: var(--fg);
}
.gate-teaser__content h2,
.gate-teaser__content h3 {
    font-weight: 700;
    color: var(--fg);
}
.gate-teaser__content .paper-summary {
    background: var(--card);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 8px 0 40px;
}
.gate-teaser__fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to bottom, transparent, var(--bg));
}

.gate-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    align-items: start;
}

.gate-login h3,
.gate-signup h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--fg);
}

.gate-login p,
.gate-signup p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.gate-login form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gate-login input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg);
    color: var(--fg);
}

.gate-login input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.gate-divider {
    display: flex;
    align-items: center;
    writing-mode: vertical-lr;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 0;
}

.pro-kicker {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 8px;
}

.paywall-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.paywall-features li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--fg);
    line-height: 1.5;
}

.paywall-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.upgrade-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.upgrade-btn:hover {
    background: var(--accent-hover);
}

.gate-login-btn {
    width: 100%;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .article-title {
        font-size: 28px;
    }

    .article-dek {
        font-size: 16px;
    }

    .article-content h2 {
        font-size: 24px;
    }

    .article-content h3 {
        font-size: 19px;
    }

    .article-content {
        font-size: 16px;
    }

    .study-info-card {
        padding: 24px;
    }

    .study-meta-row {
        flex-direction: column;
        gap: 12px;
    }

    .gate-box {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .gate-divider {
        writing-mode: horizontal-tb;
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .article-page {
        padding: 24px 16px 60px;
    }

    .article-title {
        font-size: 24px;
    }

    .paper-summary {
        padding: 20px;
    }
}


/* ═══════════════════════════════════════════════════════════════════════
   THE LIGHTHOUSE TAKE — public box (admin-curated expert opinion)
   ═══════════════════════════════════════════════════════════════════════ */
.lh-take {
    position: relative;
    background:
        radial-gradient(ellipse 600px 200px at 100% 0%, rgba(197, 165, 90, 0.10), transparent 70%),
        var(--card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius);
    padding: 22px 26px 20px;
    margin: 8px 0 40px;
    box-shadow: 0 2px 10px var(--shadow);
}

.lh-take::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(197, 165, 90, 0.18);
}

.lh-take__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--gold);
}

.lh-take__beacon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(197, 165, 90, 0.14);
    color: var(--gold);
    flex-shrink: 0;
}

.lh-take__kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--gold);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.lh-take__badge {
    margin-left: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(27, 42, 74, 0.10);
    padding: 2px 8px;
    border-radius: 999px;
}

[data-theme="dark"] .lh-take__badge {
    color: var(--gold);
    background: rgba(212, 183, 106, 0.12);
}

.lh-take__body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16.5px;
    line-height: 1.65;
    color: var(--fg);
}

.lh-take__body p {
    margin: 0 0 10px;
}

.lh-take__body p:last-child {
    margin-bottom: 0;
}

.lh-take__body strong {
    color: var(--accent);
}

[data-theme="dark"] .lh-take__body strong {
    color: var(--gold);
}

.lh-take__sig {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--muted);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (max-width: 480px) {
    .lh-take { padding: 18px 18px 16px; }
    .lh-take__body { font-size: 15.5px; }
}


/* ═══════════════════════════════════════════════════════════════════════
   ARTICLE ACCESS — inline admin control (Free vs Pro), admin-only
   ═══════════════════════════════════════════════════════════════════════ */
.lh-access {
    margin: 8px 0 14px;
    padding: 14px 18px 12px;
    background: var(--bg);
    border: 1px dashed rgba(27, 42, 74, 0.45);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px var(--shadow);
}

[data-theme="dark"] .lh-access {
    border-color: rgba(212, 183, 106, 0.40);
}

.lh-access__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.lh-access__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(27, 42, 74, 0.10);
    color: var(--accent);
    flex-shrink: 0;
}

[data-theme="dark"] .lh-access__icon {
    background: rgba(212, 183, 106, 0.14);
    color: var(--gold);
}

.lh-access__title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--accent);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] .lh-access__title {
    color: var(--gold);
}

.lh-access__chip {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
}

.lh-access__chip--free,
.lh-access__chip--open {
    background: rgba(34, 139, 87, 0.14);
    color: #1f7a4a;
}

[data-theme="dark"] .lh-access__chip--free,
[data-theme="dark"] .lh-access__chip--open {
    background: rgba(94, 214, 152, 0.18);
    color: #7dd6a4;
}

.lh-access__chip--member {
    background: rgba(38, 102, 178, 0.14);
    color: #1f5b9c;
}

[data-theme="dark"] .lh-access__chip--member {
    background: rgba(126, 178, 247, 0.18);
    color: #9ec5f5;
}

.lh-access__chip--pro,
.lh-access__chip--premium {
    background: rgba(27, 42, 74, 0.10);
    color: var(--accent);
}

[data-theme="dark"] .lh-access__chip--pro,
[data-theme="dark"] .lh-access__chip--premium {
    background: rgba(212, 183, 106, 0.18);
    color: var(--gold);
}

.lh-access__lock {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(212, 168, 0, 0.14);
    color: #b88a00;
    border: 1px dashed rgba(212, 168, 0, 0.4);
}

[data-theme="dark"] .lh-access__lock {
    background: rgba(212, 183, 106, 0.10);
    color: var(--gold);
    border-color: rgba(212, 183, 106, 0.35);
}

.lh-access__row--tiers {
    align-items: stretch;
}

.lh-tier-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.lh-tier-opt {
    position: relative;
    cursor: pointer;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--bg);
    transition: border-color 0.15s ease, background 0.15s ease;
    display: block;
}

.lh-tier-opt:hover {
    border-color: var(--accent);
}

.lh-tier-opt input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lh-tier-opt:has(input:checked) {
    border-color: var(--accent);
    background: rgba(27, 42, 74, 0.05);
}

[data-theme="dark"] .lh-tier-opt:has(input:checked) {
    border-color: var(--gold);
    background: rgba(212, 183, 106, 0.08);
}

.lh-tier-opt__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lh-tier-opt__label strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--fg);
}

.lh-tier-opt__label small {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.3;
}

@media (max-width: 600px) {
    .lh-tier-picker { grid-template-columns: 1fr; }
}

.pro-kicker--free {
    color: #1f7a4a !important;
}

[data-theme="dark"] .pro-kicker--free {
    color: #7dd6a4 !important;
}

.lh-access__admin-tag {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 999px;
}

.lh-access__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.lh-access__check {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: var(--fg);
    flex: 1 1 auto;
    min-width: 0;
}

.lh-access__check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.15s ease;
    position: relative;
}

.lh-access__check input[type="checkbox"]:hover {
    border-color: var(--accent);
}

.lh-access__check input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

[data-theme="dark"] .lh-access__check input[type="checkbox"]:checked {
    background: var(--gold);
    border-color: var(--gold);
}

.lh-access__check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

[data-theme="dark"] .lh-access__check input[type="checkbox"]:checked::after {
    border-color: #0a0a0a;
}

.lh-access__check input[type="checkbox"]:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.lh-access__error {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(194, 76, 76, 0.08);
    border: 1px solid rgba(194, 76, 76, 0.35);
    color: #c24c4c;
    border-radius: 6px;
    font-size: 13px;
}

@media (max-width: 480px) {
    .lh-access { padding: 14px; }
    .lh-access__row { flex-direction: column; align-items: stretch; }
    .lh-access__row .lh-btn { width: 100%; justify-content: center; }
    .lh-access__admin-tag { margin-left: 0; }
}


/* ═══════════════════════════════════════════════════════════════════════
   LIGHTHOUSE TAKE — inline admin composer (admin-only on article page)
   ═══════════════════════════════════════════════════════════════════════ */
.lh-composer {
    position: relative;
    margin: 8px 0 40px;
    padding: 18px 20px 16px;
    background:
        linear-gradient(180deg, rgba(197, 165, 90, 0.04), transparent 80%),
        var(--bg);
    border: 1px dashed rgba(197, 165, 90, 0.55);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px var(--shadow);
}

.lh-composer__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.lh-composer__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(197, 165, 90, 0.14);
    color: var(--gold);
    flex-shrink: 0;
}

.lh-composer__title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--gold);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.lh-composer__chip {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
}

.lh-composer__chip--published {
    background: rgba(34, 139, 87, 0.14);
    color: #1f7a4a;
}

[data-theme="dark"] .lh-composer__chip--published {
    background: rgba(94, 214, 152, 0.18);
    color: #7dd6a4;
}

.lh-composer__chip--draft {
    background: rgba(197, 165, 90, 0.18);
    color: #8a6e2a;
}

[data-theme="dark"] .lh-composer__chip--draft {
    background: rgba(212, 183, 106, 0.18);
    color: var(--gold);
}

.lh-composer__chip--none {
    background: var(--card);
    color: var(--muted);
}

.lh-composer__admin-tag {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 999px;
}

.lh-composer__step {
    padding: 0;
}

.lh-composer__hint {
    margin: 0 0 12px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--muted);
}

.lh-composer__textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--fg);
    font: inherit;
    font-size: 15px;
    line-height: 1.55;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lh-composer__textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(197, 165, 90, 0.18);
}

.lh-composer__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.lh-composer__meta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.lh-counter {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.lh-composer__buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.lh-composer__error {
    margin-top: 14px;
    padding: 10px 12px;
    background: rgba(194, 76, 76, 0.08);
    border: 1px solid rgba(194, 76, 76, 0.35);
    color: #c24c4c;
    border-radius: 6px;
    font-size: 13px;
}

.lh-btn {
    position: relative;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 16px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lh-btn--ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}

.lh-btn--ghost:hover {
    color: var(--fg);
    border-color: var(--fg);
}

.lh-btn--secondary {
    background: var(--card);
    color: var(--fg);
    border-color: var(--border);
}

.lh-btn--secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="dark"] .lh-btn--secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.lh-btn--primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.lh-btn--primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.lh-btn__spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: lhSpin 0.7s linear infinite;
}

.lh-btn.is-loading .lh-btn__spinner {
    display: inline-block;
}

.lh-btn.is-loading .lh-btn__label {
    opacity: 0.85;
}

@keyframes lhSpin {
    to { transform: rotate(360deg); }
}

.lh-preview-frame {
    border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: 8px;
    background: var(--card);
    padding: 16px 18px;
}

.lh-preview-frame__kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
}

.lh-preview {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--fg);
    min-height: 80px;
    outline: none;
}

.lh-preview:focus {
    box-shadow: 0 0 0 0;
}

.lh-preview p {
    margin: 0 0 10px;
}

.lh-preview p:last-child {
    margin-bottom: 0;
}

.lh-preview strong {
    color: var(--accent);
}

[data-theme="dark"] .lh-preview strong {
    color: var(--gold);
}

@media (max-width: 480px) {
    .lh-composer { padding: 16px; }
    .lh-composer__row { flex-direction: column; align-items: stretch; }
    .lh-composer__buttons { margin-left: 0; flex-wrap: wrap; }
    .lh-composer__admin-tag { margin-left: 0; }
}


/* ── Voice input (Web Speech API) ─────────────────────────────────────── */
.lh-input-wrap {
    position: relative;
}

.lh-input-wrap .lh-composer__textarea {
    padding-right: 52px;
    min-height: 110px;
}

.lh-input-wrap--compact .lh-composer__textarea {
    min-height: 70px;
}

.lh-mic {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    /* Disable touch gestures (long-press menu, pinch-zoom) so push-to-talk
       feels native on mobile. */
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.lh-mic:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

[data-theme="dark"] .lh-mic:hover {
    color: var(--gold);
    border-color: var(--gold);
}

.lh-mic__icon {
    position: relative;
    z-index: 2;
    display: inline-flex;
    line-height: 0;
}

.lh-mic__pulse {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    pointer-events: none;
}

.lh-mic--on {
    color: #fff;
    background: #c24c4c;
    border-color: #c24c4c;
}

.lh-mic--on:hover {
    color: #fff;
    background: #b53d3d;
    border-color: #b53d3d;
}

.lh-mic--held {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(194, 76, 76, 0.35);
}

.lh-mic--on .lh-mic__pulse {
    box-shadow: 0 0 0 0 rgba(194, 76, 76, 0.65);
    animation: lhMicPulse 1.4s infinite;
}

@keyframes lhMicPulse {
    0%   { box-shadow: 0 0 0 0 rgba(194, 76, 76, 0.55); }
    70%  { box-shadow: 0 0 0 12px rgba(194, 76, 76, 0); }
    100% { box-shadow: 0 0 0 0 rgba(194, 76, 76, 0); }
}

.lh-mic-hint {
    font-size: 12px;
    font-weight: 600;
    color: #c24c4c;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* The HTML `hidden` attribute should win over the explicit `display` set on
   .lh-mic and .lh-mic-hint above; without these overrides, those elements
   stay visible even with hidden=true (the listening pill was always on). */
.lh-mic[hidden],
.lh-mic-hint[hidden] {
    display: none !important;
}

.lh-mic-hint::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c24c4c;
    animation: lhDot 1s infinite;
}

@keyframes lhDot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}


/* ── Refine sub-panel inside the preview step ──────────────────────────── */
.lh-refine {
    margin-top: 18px;
    padding: 14px 16px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
}

.lh-refine__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
}

[data-theme="dark"] .lh-refine__title {
    color: var(--gold);
}

.lh-refine__hint {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--muted);
}

.lh-refine__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.lh-refine__actions .lh-btn {
    margin-left: auto;
}

/* ════════════════════════════════════════════════════════════════════
   Admin in-place tools (image redo, tier cycle, tag editor)
   ════════════════════════════════════════════════════════════════════ */
.admin-only-control {
    /* Slim outline so it's clear these are admin-only superpowers */
    outline: 1px dashed rgba(212, 168, 0, 0.45);
    outline-offset: 2px;
}

/* — View-as persona switcher (admin only) — */
.view-as-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 20px;
    padding: 8px 12px;
    background: rgba(212, 168, 0, 0.06);
    border: 1px dashed rgba(212, 168, 0, 0.45);
    border-radius: 10px;
    font-size: 12px;
    flex-wrap: wrap;
}
.view-as-bar__icon {
    color: #b88a00;
    display: inline-flex;
}
[data-theme="dark"] .view-as-bar__icon { color: var(--gold); }
.view-as-bar__label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-size: 11px;
}
.view-as-bar__hint {
    font-size: 11px;
    color: var(--muted);
    margin-left: auto;
    font-style: italic;
}
.view-as-picker {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.view-as-opt {
    padding: 5px 14px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: background .15s, color .15s;
}
.view-as-opt:hover {
    background: var(--bg2, rgba(0, 0, 0, 0.04));
    color: var(--fg);
}
.view-as-opt.is-active {
    background: var(--accent);
    color: #fff;
}
[data-theme="dark"] .view-as-opt.is-active {
    background: var(--gold);
    color: #0a0a0a;
}

/* — Tier cycle button next to date — */
.article-tier-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.article-tier-btn:hover {
    border-color: var(--accent);
}
.article-tier-btn__label {
    color: var(--fg);
    letter-spacing: .3px;
    font-weight: 700;
}
.article-tier-btn--open    { background: rgba(34, 139, 87, .14); color: #1f7a4a; }
.article-tier-btn--member  { background: rgba(38, 102, 178, .14); color: #1f5b9c; }
.article-tier-btn--premium { background: rgba(27, 42, 74, .10); color: var(--accent); }

[data-theme="dark"] .article-tier-btn--open    { background: rgba(94, 214, 152, .18); color: #7dd6a4; }
[data-theme="dark"] .article-tier-btn--member  { background: rgba(126, 178, 247, .18); color: #9ec5f5; }
[data-theme="dark"] .article-tier-btn--premium { background: rgba(212, 183, 106, .18); color: var(--gold); }

.article-tier-btn:disabled { opacity: 0.55; cursor: wait; }

/* — Edit tags pencil chip — */
.badge--edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent !important;
    color: var(--muted) !important;
    border: 1px dashed var(--border) !important;
    cursor: pointer;
    font-size: 11px;
    padding: 3px 9px !important;
}
.badge--edit:hover {
    border-color: var(--accent) !important;
    color: var(--fg) !important;
}

/* — Hero image redo button — */
.article-hero { position: relative; }
.hero-redo-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background .15s, transform .15s;
}
.hero-redo-btn:hover {
    background: rgba(0, 0, 0, .8);
    transform: translateY(-1px);
}
.hero-redo-btn:disabled { opacity: 0.6; cursor: wait; }
.hero-redo-btn svg { display: block; }

/* — Modal shared by image redo + tag editor — */
.admin-tool-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-tool-modal[hidden] { display: none; }
.admin-tool-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
}
.admin-tool-modal__panel {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: min(560px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
}
.admin-tool-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.admin-tool-modal__head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.admin-tool-modal__close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.admin-tool-modal__close:hover { color: var(--fg); }
#admin-tool-modal-body {
    padding: 20px;
    overflow-y: auto;
}
.admin-tool-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

/* — Image redo style options — */
.img-redo-opt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin: 4px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.img-redo-opt:hover { border-color: var(--accent); }
.img-redo-opt:has(input:checked) {
    border-color: var(--accent);
    background: rgba(27, 42, 74, .05);
}
[data-theme="dark"] .img-redo-opt:has(input:checked) {
    background: rgba(212, 183, 106, .08);
}
.img-redo-opt input { margin-top: 4px; flex-shrink: 0; }
.img-redo-opt strong { display: block; font-size: 13px; }
.img-redo-opt small {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.4;
}
.img-redo-opt.is-default {
    border-color: var(--accent);
    background: rgba(27, 42, 74, .05);
}
[data-theme="dark"] .img-redo-opt.is-default {
    background: rgba(212, 183, 106, .08);
}
