/* ── Spark UI — Unified flame + lightning icons ── */

/* ── Flame button (replaces ✦) on list cards ── */
.spark-add-btn.spark-flame-btn {
    width: 26px;
    height: 26px;
    padding: 3px;
    color: #d97706;
}

.spark-add-btn.spark-flame-btn svg {
    width: 100%;
    height: 100%;
}

/* ── Detail page: Flame trigger button (metallic sheen) ── */
.spark-flame-trigger {
    width: 30px;
    height: 30px;
    padding: 3px;
    border: 1.5px solid rgba(184, 134, 11, 0.35);
    border-radius: 50%;
    background: linear-gradient(160deg, rgba(255,248,230,0.95) 0%, rgba(245,225,180,0.7) 40%, rgba(210,175,90,0.25) 70%, rgba(255,248,230,0.8) 100%);
    color: #b8860b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(184,134,11,0.12), inset 0 1px 0 rgba(255,255,255,0.6);
}

.spark-flame-trigger:hover {
    box-shadow: 0 2px 6px rgba(184,134,11,0.25), inset 0 1px 0 rgba(255,255,255,0.7);
    transform: scale(1.12);
}

.spark-flame-trigger svg {
    width: 20px;
    height: 20px;
}

/* ── Detail page: Lightning trigger button (metallic sheen) ── */
.spark-lightning-trigger {
    width: 30px;
    height: 30px;
    padding: 4px;
    border: 1.5px solid rgba(124, 92, 191, 0.3);
    border-radius: 50%;
    background: linear-gradient(160deg, rgba(245,240,255,0.95) 0%, rgba(220,210,245,0.7) 40%, rgba(160,130,210,0.2) 70%, rgba(245,240,255,0.8) 100%);
    color: #7c5cbf;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(124,92,191,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}

.spark-lightning-trigger:hover {
    box-shadow: 0 2px 6px rgba(124,92,191,0.2), inset 0 1px 0 rgba(255,255,255,0.7);
    transform: scale(1.12);
}

.spark-lightning-trigger svg {
    width: 18px;
    height: 18px;
}

/* ── Detail page: Journal trigger button (metallic sheen) ── */
.spark-journal-trigger {
    width: 30px;
    height: 30px;
    padding: 4px;
    border: 1.5px solid rgba(30, 136, 180, 0.3);
    border-radius: 50%;
    background: linear-gradient(160deg, rgba(235,248,255,0.95) 0%, rgba(200,230,245,0.7) 40%, rgba(100,180,210,0.2) 70%, rgba(235,248,255,0.8) 100%);
    color: #1a7a9e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(30,136,180,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}

.spark-journal-trigger:hover {
    box-shadow: 0 2px 6px rgba(30,136,180,0.2), inset 0 1px 0 rgba(255,255,255,0.7);
    transform: scale(1.12);
}

.spark-journal-trigger svg {
    width: 18px;
    height: 18px;
}

/* ── Detail page: TapasAI trigger button (metallic sheen) ── */
.spark-tapas-trigger {
    width: 30px;
    height: 30px;
    padding: 4px;
    border: 1.5px solid rgba(30, 136, 180, 0.3);
    border-radius: 50%;
    background: linear-gradient(160deg, rgba(235,248,255,0.95) 0%, rgba(200,230,245,0.7) 40%, rgba(100,180,210,0.2) 70%, rgba(235,248,255,0.8) 100%);
    color: #1a7a9e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(30,136,180,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}

.spark-tapas-trigger:hover {
    box-shadow: 0 2px 6px rgba(30,136,180,0.2), inset 0 1px 0 rgba(255,255,255,0.7);
    transform: scale(1.12);
}

.spark-tapas-trigger svg {
    width: 18px;
    height: 18px;
}

/* ── Detail page: SwamiGPT trigger button (metallic sheen) ── */
.spark-swami-trigger {
    width: 30px;
    height: 30px;
    padding: 4px;
    border: 1.5px solid rgba(196, 122, 26, 0.3);
    border-radius: 50%;
    background: linear-gradient(160deg, rgba(255,245,225,0.95) 0%, rgba(245,225,190,0.7) 40%, rgba(200,160,80,0.2) 70%, rgba(255,245,225,0.8) 100%);
    color: #b06a10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(196,122,26,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}

.spark-swami-trigger:hover {
    box-shadow: 0 2px 6px rgba(196,122,26,0.2), inset 0 1px 0 rgba(255,255,255,0.7);
    transform: scale(1.12);
}

.spark-swami-trigger svg {
    width: 18px;
    height: 18px;
}

/* ── Detail page: DharmaGPT trigger button (metallic sheen) ── */
.spark-dharma-trigger {
    width: 30px;
    height: 30px;
    padding: 4px;
    border: 1.5px solid rgba(90, 138, 94, 0.3);
    border-radius: 50%;
    background: linear-gradient(160deg, rgba(235,250,237,0.95) 0%, rgba(205,235,210,0.7) 40%, rgba(120,185,130,0.2) 70%, rgba(235,250,237,0.8) 100%);
    color: #4a7a4e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(90,138,94,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}

.spark-dharma-trigger:hover {
    box-shadow: 0 2px 6px rgba(90,138,94,0.2), inset 0 1px 0 rgba(255,255,255,0.7);
    transform: scale(1.12);
}

.spark-dharma-trigger svg {
    width: 18px;
    height: 18px;
}

/* ── Listen button restyled as Sparkbar icon (metallic sheen) ── */
/* Supports both #audioBtn.spark-listen-btn (verse/sutra pages) and standalone .spark-listen-btn (entry pages) */
.spark-listen-btn,
#audioBtn.spark-listen-btn {
    width: 30px;
    height: 30px;
    padding: 4px;
    border: 1.5px solid rgba(0, 150, 136, 0.3);
    border-radius: 50%;
    background: linear-gradient(160deg, rgba(230,250,248,0.95) 0%, rgba(195,235,230,0.7) 40%, rgba(80,190,175,0.2) 70%, rgba(230,250,248,0.8) 100%);
    color: #00796b;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    gap: 0;
    font-size: 0;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,150,136,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}
/* #audioBtn needs !important to override inline display:none from verse pages */
#audioBtn.spark-listen-btn { display: flex !important; }
/* Standalone .spark-listen-btn (entry pages): no !important so inline style.display="none" works */
.spark-listen-btn:not(#audioBtn) { display: flex; }

.spark-listen-btn:hover,
#audioBtn.spark-listen-btn:hover {
    box-shadow: 0 2px 6px rgba(0,150,136,0.2), inset 0 1px 0 rgba(255,255,255,0.7);
    transform: scale(1.12);
}

.spark-listen-btn svg,
#audioBtn.spark-listen-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: #00796b;
}

#audioBtn.spark-listen-btn #audioBtnLabel {
    display: none;
}

/* Listen pulse while audio is playing */
.spark-listen-btn.playing,
#audioBtn.spark-listen-btn.playing {
    animation: sparkListenPulse 1.2s ease-in-out infinite;
    border-color: rgba(0,150,136,0.5) !important;
    box-shadow: 0 2px 8px rgba(0,150,136,0.3), inset 0 1px 0 rgba(255,255,255,0.7) !important;
}

@keyframes sparkListenPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); box-shadow: 0 0 18px rgba(0, 150, 136, 0.5); }
}

/* ── Detail page: Voice Sparks trigger button (metallic sheen, coral) ── */
.spark-voice-trigger {
    width: 30px;
    height: 30px;
    padding: 4px;
    border: 1.5px solid rgba(224, 102, 102, 0.3);
    border-radius: 50%;
    background: linear-gradient(160deg, rgba(255,240,240,0.95) 0%, rgba(245,210,210,0.7) 40%, rgba(220,140,140,0.2) 70%, rgba(255,240,240,0.8) 100%);
    color: #d45555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(224,102,102,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}

.spark-voice-trigger:hover {
    box-shadow: 0 2px 6px rgba(224,102,102,0.2), inset 0 1px 0 rgba(255,255,255,0.7);
    transform: scale(1.12);
}

.spark-voice-trigger svg {
    width: 18px;
    height: 18px;
}

/* Dimmed state for Voice Sparks (Aspirant — visible but upgrade-gated) */
.spark-voice-trigger.spark-voice-dimmed {
    opacity: 0.45;
    cursor: pointer;
}

.spark-voice-trigger.spark-voice-dimmed:hover {
    opacity: 0.7;
    border-color: rgba(224, 102, 102, 0.5);
    box-shadow: none;
    transform: scale(1.02);
}

/* ── Sparkbar pill containers (metallic sheen) ── */
.spark-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 5px;
    border: 1px solid rgba(200,195,185,0.6);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(245,242,238,0.9) 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
}

/* ── Sparkbar layout wrapper (full-width, left/right spread) ── */
.sparkbar-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    margin-bottom: 0.5rem;
}

.sparkbar-side {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Voice Sparks panel ── */
.spark-panel--voice {
    border-color: rgba(224, 102, 102, 0.2);
}

.spark-panel-header--voice {
    color: #e06666;
}

.spark-panel-upgrade-link--voice {
    color: #e06666;
    border-color: #e06666;
}

.spark-panel-upgrade-link--voice:hover {
    background: #e06666;
    color: #fff;
}

.spark-panel-auth-icon--voice {
    color: #e06666;
}

/* ── Listen panel (signup prompt) ── */
.spark-panel--listen {
    border-color: rgba(0, 150, 136, 0.2);
}

.spark-panel-header--listen {
    color: #009688;
}

.spark-panel-upgrade-link--listen {
    color: #009688;
    border-color: #009688;
}

.spark-panel-upgrade-link--listen:hover {
    background: #009688;
    color: #fff;
}

.spark-panel-auth-icon--listen {
    color: #009688;
}

/* ── Companion buttons group (right-aligned in toolbar) ── */
.spark-companion-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* ── Center emoji pill (Sparkmark display, metallic sheen) ── */
.spark-pill-emojis {
    display: inline-flex;
    gap: 3px;
    padding: 3px 8px;
    border: 1px solid rgba(200,195,185,0.6);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(245,242,238,0.9) 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
    align-items: center;
    min-height: 34px;
}

.spark-emoji-badge {
    font-size: 16px;
    cursor: pointer;
    padding: 2px 3px;
    border-radius: 4px;
    transition: all 0.15s ease;
    line-height: 1;
    user-select: none;
}

.spark-emoji-badge:hover {
    background: rgba(217,119,6,0.15);
    transform: scale(1.2);
}

.spark-emoji-badge:active {
    transform: scale(0.9);
}

.spark-emoji-badge.removing {
    opacity: 0;
    transform: scale(0.3);
    transition: all 0.25s ease;
}

/* Legacy inline badges (hidden, replaced by center pill) */
.spark-inline-badges {
    display: none;
}

.spark-inline-badge {
    font-size: 0.85rem;
    line-height: 1;
}

/* ── Panel container ── */
.spark-panel-container {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.4rem;
    z-index: 100;
    display: none;
}

.spark-panel-container.open {
    display: block;
    animation: sparkPanelIn 0.2s ease;
}

@keyframes sparkPanelIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Panel ── */
.spark-panel {
    background: var(--color-white, #fff);
    border: 1px solid var(--color-border, #e0dbd3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    min-width: 280px;
    max-width: 360px;
    overflow: visible;
}

/* ── Panel header ── */
.spark-panel-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--color-border, #e0dbd3);
    background: var(--color-bg, #faf8f5);
    border-radius: 12px 12px 0 0;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.82rem;
    font-weight: 600;
    color: #d97706;
}

.spark-panel-header--ai {
    color: #7c5cbf;
}

.spark-panel-header-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.spark-panel-header-icon svg {
    width: 100%;
    height: 100%;
}

/* ── Panel body ── */
.spark-panel-body {
    padding: 0.6rem 0.75rem;
}

/* ── Current sparkmarks (show existing + remove) ── */
.spark-panel-current {
    margin-bottom: 0.4rem;
}

.spark-current-label {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-text-light, #958e85);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.spark-current-row {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.spark-current-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.45rem;
    border: 1px solid var(--color-border, #e0dbd3);
    border-radius: 6px;
    background: var(--color-bg, #faf8f5);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0;
}

.spark-current-chip:hover {
    border-color: #c0392b;
    background: rgba(192, 57, 43, 0.06);
}

.spark-current-emoji {
    font-size: 1.1rem;
    line-height: 1;
}

.spark-current-remove {
    font-size: 0.65rem;
    color: var(--color-text-light, #958e85);
    font-family: var(--font-sans, 'Inter', sans-serif);
    transition: color 0.15s ease;
}

.spark-current-chip:hover .spark-current-remove {
    color: #c0392b;
}

/* ── Categorized emoji picker ── */
.spark-panel-picker {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border, #e0dbd3) transparent;
}

.spark-panel-picker::-webkit-scrollbar {
    width: 4px;
}

.spark-panel-picker::-webkit-scrollbar-thumb {
    background: var(--color-border, #e0dbd3);
    border-radius: 2px;
}

.spark-cat {
    margin-bottom: 0.5rem;
}

.spark-cat:first-child {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border, #e0dbd3);
}

.spark-cat:first-child .spark-cat-label {
    color: var(--color-accent, #b8860b);
}

.spark-cat:first-child .spark-cat-emoji {
    font-size: 1.2rem;
}

.spark-cat:last-child {
    margin-bottom: 0;
}

.spark-cat-label {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--color-text-light, #958e85);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
    padding-left: 0.1rem;
}

.spark-cat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.spark-cat-emoji {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
    padding: 0;
}

.spark-cat-emoji:hover:not(.disabled) {
    background: rgba(251, 235, 207, 0.7);
    transform: scale(1.15);
}

.spark-cat-emoji.selected {
    background: rgba(251, 235, 207, 0.7);
    box-shadow: inset 0 0 0 1.5px #d97706;
}

.spark-cat-emoji.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ── Max sparks message ── */
.spark-panel-max-msg {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.72rem;
    color: var(--color-text-light, #958e85);
    text-align: center;
    padding: 0.4rem 0 0.2rem;
    font-style: italic;
}

/* ── Voice Spark section ── */
.spark-panel-voice {
    padding: 0.5rem 0.75rem 0.65rem;
    border-top: 1px solid var(--color-border, #e0dbd3);
    border-radius: 0 0 12px 12px;
    background: var(--color-white, #fff);
}

.spark-panel-voice-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid #d97706;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(251, 235, 207, 0.5) 0%, #fff 100%);
    color: #d97706;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.spark-panel-voice-btn:hover {
    background: #d97706;
    color: #fff;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}

.spark-panel-voice-btn:hover .spark-panel-voice-icon {
    color: #fff;
}

.spark-panel-voice-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── AI Sparks panel ── */
.spark-panel--ai {
    border-color: rgba(124, 92, 191, 0.2);
}

.spark-panel-upgrade {
    text-align: center;
    padding: 0.5rem 0.25rem;
}

.spark-panel-upgrade p {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.8rem;
    color: var(--color-text-muted, #6b6560);
    margin: 0 0 0.6rem;
    line-height: 1.5;
}

.spark-panel-upgrade-link {
    display: inline-block;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.78rem;
    font-weight: 500;
    color: #d97706;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border: 1px solid #d97706;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.spark-panel-upgrade-link:hover {
    background: #d97706;
    color: #fff;
}

.spark-panel-upgrade-link--ai {
    color: #7c5cbf;
    border-color: #7c5cbf;
}

.spark-panel-upgrade-link--ai:hover {
    background: #7c5cbf;
    color: #fff;
}

.spark-panel-ai-controls {
    padding: 0;
}

.spark-panel-ai-desc {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.78rem;
    color: var(--color-text-muted, #6b6560);
    margin: 0 0 0.6rem;
    line-height: 1.4;
}

.spark-panel-ai-btns {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ── Unified action button style (used in all panels) ── */
.spark-panel-action-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid;
    border-radius: 8px;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.spark-panel-action-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Gold variant (flame panel — Voice Spark uses .spark-panel-voice-btn) */

/* Purple variant (AI Sparks panel) */
.spark-panel-action-btn--ai {
    border-color: rgba(124, 92, 191, 0.3);
    background: linear-gradient(135deg, rgba(124, 92, 191, 0.06) 0%, #fff 100%);
    color: #7c5cbf;
}

.spark-panel-action-btn--ai:hover {
    background: #7c5cbf;
    color: #fff;
    border-color: #7c5cbf;
    box-shadow: 0 2px 8px rgba(124, 92, 191, 0.2);
}

.spark-panel-action-btn--ai:hover .spark-panel-action-icon {
    color: #fff;
}

/* Blue variant (Journal panel) */
.spark-panel-action-btn--journal {
    border-color: rgba(30, 136, 180, 0.3);
    background: linear-gradient(135deg, rgba(30, 136, 180, 0.06) 0%, #fff 100%);
    color: #1e88b4;
}

.spark-panel-action-btn--journal:hover {
    background: #1e88b4;
    color: #fff;
    border-color: #1e88b4;
    box-shadow: 0 2px 8px rgba(30, 136, 180, 0.2);
}

.spark-panel-action-btn--journal:hover .spark-panel-action-icon {
    color: #fff;
}

/* Coral variant (Voice Sparks panel) */
.spark-panel-action-btn--voice {
    border-color: rgba(224, 102, 102, 0.3);
    background: linear-gradient(135deg, rgba(224, 102, 102, 0.06) 0%, #fff 100%);
    color: #e06666;
}

.spark-panel-action-btn--voice:hover {
    background: #e06666;
    color: #fff;
    border-color: #e06666;
    box-shadow: 0 2px 8px rgba(224, 102, 102, 0.2);
}

.spark-panel-action-btn--voice:hover .spark-panel-action-icon {
    color: #fff;
}

.spark-panel-action-btn--voice:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* Voice Spark upgrade row (Create action for Aspirant) */
.spark-panel-action-upgrade .spark-panel-action-icon {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    vertical-align: -2px;
    margin-right: 2px;
    display: inline;
}

/* ── Toolbar spark slot ── */
.toolbar-spark-slot {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    width: 100%;
}

/* ── Auth prompt (logged-out users) ── */
.spark-panel-auth {
    padding: 1.25rem 1rem;
    text-align: center;
}

.spark-panel-auth-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 0.6rem;
    color: #d97706;
}

.spark-panel-auth-icon svg {
    width: 100%;
    height: 100%;
}

.spark-panel-auth-title {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text, #2c2a26);
    margin: 0 0 0.4rem;
}

.spark-panel-auth-desc {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.8rem;
    color: var(--color-text-muted, #6b6560);
    line-height: 1.5;
    margin: 0 0 0.8rem;
}
.spark-panel-auth-login {
    font-size: 0.72rem;
    color: var(--color-text-light, #958e85);
    margin-top: 0.5rem;
    text-align: center;
}
.spark-panel-auth-login a {
    color: var(--color-accent, #b8860b);
    text-decoration: none;
}
.spark-panel-auth-login a:hover {
    text-decoration: underline;
}
.spark-panel-auth-login--journal a { color: #1e88b4; }
.spark-panel-auth-login--listen a { color: #009688; }

/* ── Journal panel ── */
.spark-panel--journal {
    border-color: rgba(30, 136, 180, 0.2);
}

.spark-panel-header--journal {
    color: #1e88b4;
}

.spark-panel-action-upgrade {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.7rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.78rem;
    color: var(--color-text-light, #958e85);
    border: 1px solid var(--color-border, #e0dbd3);
    border-radius: 8px;
}

.spark-panel-upgrade-link--journal {
    color: #1e88b4;
    border-color: #1e88b4;
}

.spark-panel-upgrade-link--journal:hover {
    background: #1e88b4;
    color: #fff;
}

.spark-panel-auth-icon--journal {
    color: #1e88b4;
}

/* Action button spacing inside panel body */
.spark-panel-body .spark-panel-action-btn {
    margin-bottom: 0.4rem;
}

.spark-panel-body .spark-panel-action-btn:last-child {
    margin-bottom: 0;
}

/* ── AI Sparks loading: lightning pulse ── */
.spark-loading-pulse {
    animation: sparkLightningPulse 1.2s ease-in-out infinite;
    border-color: #7c5cbf !important;
    box-shadow: 0 0 12px rgba(124, 92, 191, 0.3) !important;
}

@keyframes sparkLightningPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); box-shadow: 0 0 18px rgba(124, 92, 191, 0.5); }
}

/* ── In-button loading state (replaces button content with "Generating X...") ── */
.spark-btn-loading {
    pointer-events: none;
    cursor: wait;
    justify-content: center;
}

.spark-btn-loading--ai {
    background: rgba(124, 92, 191, 0.08) !important;
    border-color: rgba(124, 92, 191, 0.3) !important;
    color: #7c5cbf !important;
    animation: sparkBtnLoadingPulse 2s ease-in-out infinite;
}

.spark-btn-loading--journal {
    background: rgba(30, 136, 180, 0.08) !important;
    border-color: rgba(30, 136, 180, 0.3) !important;
    color: #1e88b4 !important;
    animation: sparkBtnLoadingPulseJournal 2s ease-in-out infinite;
}

@keyframes sparkBtnLoadingPulse {
    0%, 100% { background: rgba(124, 92, 191, 0.06); }
    50% { background: rgba(124, 92, 191, 0.14); }
}

@keyframes sparkBtnLoadingPulseJournal {
    0%, 100% { background: rgba(30, 136, 180, 0.06); }
    50% { background: rgba(30, 136, 180, 0.14); }
}

.spark-btn-loading-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.spark-btn-loading-icon svg {
    width: 16px;
    height: 16px;
}

.spark-btn-loading-text {
    font-size: 0.8rem;
    font-weight: 500;
}

.spark-btn-loading-dots {
    display: inline-flex;
    gap: 1px;
    margin-left: -2px;
}

.spark-btn-loading-dots span {
    animation: sparkDotPulse 1.4s ease-in-out infinite;
    opacity: 0.3;
}

.spark-btn-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.spark-btn-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes sparkDotPulse {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* ── AI Sparks loading: translation text shimmer ── */
.spark-shimmer {
    position: relative;
    overflow: hidden;
}

.spark-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(124, 92, 191, 0.06) 25%,
        rgba(124, 92, 191, 0.12) 50%,
        rgba(124, 92, 191, 0.06) 75%,
        transparent 100%
    );
    animation: sparkShimmer 2s ease-in-out infinite;
    pointer-events: none;
    border-radius: 4px;
}

@keyframes sparkShimmer {
    0%   { left: -100%; }
    100% { left: 100%; }
}

/* ── Journal Prompt loading: pencil pulse (blue) ── */
.spark-journal-loading-pulse {
    animation: sparkJournalPulse 1.2s ease-in-out infinite;
    border-color: #1e88b4 !important;
    box-shadow: 0 0 12px rgba(30, 136, 180, 0.3) !important;
}

@keyframes sparkJournalPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); box-shadow: 0 0 18px rgba(30, 136, 180, 0.5); }
}

/* ── Journal Prompt loading: translation shimmer (blue) ── */
.spark-shimmer--journal {
    position: relative;
    overflow: hidden;
}

.spark-shimmer--journal::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(30, 136, 180, 0.06) 25%,
        rgba(30, 136, 180, 0.12) 50%,
        rgba(30, 136, 180, 0.06) 75%,
        transparent 100%
    );
    animation: sparkShimmer 2s ease-in-out infinite;
    pointer-events: none;
    border-radius: 4px;
}

/* ── Listen loading: translation shimmer (teal) ── */
/* Listen shimmer removed — shimmer represents AI analyzing text,
   which doesn't apply to audio playback. Listen button uses
   sparkListenPulse animation + teal glow instead. */

/* ══════════════════════════════════════════════
   TEMPORAL LENS — TapasAI entry page dropdown
   Three lenses: Smṛti / Sthiti / Saṅkalpa
   ══════════════════════════════════════════════ */

/* ── TapasAI shimmer (journal blue) ── */
.spark-shimmer--tapas::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(30, 136, 180, 0.08) 25%,
        rgba(30, 136, 180, 0.15) 50%,
        rgba(30, 136, 180, 0.08) 75%,
        transparent 100%
    ) !important;
}

/* ── TapasAI Panel (Chat + Temporal Lenses — entry pages) ── */
.spark-panel--tapas {
    border-color: rgba(30, 136, 180, 0.2);
}
.spark-panel-header--tapas {
    color: #1e88b4;
}
.spark-panel-container--tapas {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.4rem;
    z-index: 100;
    display: none;
}
.spark-panel-container--tapas.open {
    display: block;
    animation: sparkPanelIn 0.2s ease;
}

/* TapasAI chat action button — journal blue */
.spark-panel-action-btn--tapas {
    border: 1px solid rgba(30, 136, 180, 0.3);
    background: linear-gradient(135deg, rgba(30, 136, 180, 0.06) 0%, #fff 100%);
    color: #1e88b4;
}
.spark-panel-action-btn--tapas:hover {
    background: #1e88b4;
    color: #fff;
    border-color: #1e88b4;
    box-shadow: 0 2px 8px rgba(30, 136, 180, 0.2);
}
.spark-panel-action-btn--tapas:hover .spark-panel-action-icon {
    color: #fff;
}

/* Panel divider (reusable) */
.spark-panel-divider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.55rem 0 0.4rem;
}
.spark-panel-divider::before,
.spark-panel-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0dbd3;
}
.spark-panel-divider-text {
    font-size: 0.58rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #958e85;
}

/* Temporal Lens buttons inside panel — color-coded left border + descriptions */
.spark-panel-action-btn--lens {
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    color: #2c2a26;
    position: relative;
    padding: 0.6rem 0.75rem 0.6rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}
.spark-panel-action-btn--lens::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 2px;
    background: var(--lens-color);
    opacity: 0.35;
    transition: opacity 0.15s;
}
.spark-panel-action-btn--lens:hover {
    background: var(--lens-bg);
    border-color: var(--lens-color);
}
.spark-panel-action-btn--lens:hover::before {
    opacity: 1;
}

.spark-panel-lens-top {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    width: 100%;
}
.spark-panel-lens-sanskrit {
    font-family: 'Noto Sans Devanagari', serif;
    font-size: 0.75rem;
    color: var(--lens-color);
    opacity: 0.7;
}
.spark-panel-lens-name {
    font-weight: 600;
    font-size: 0.78rem;
    color: #2c2a26;
}
.spark-panel-lens-desc {
    font-size: 0.68rem;
    font-weight: 300;
    color: #6b6560;
    line-height: 1.45;
}

/* ── Dropdown (legacy temporal lens standalone) ── */
.temporal-lens-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border: 1px solid #e0dbd3;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
    padding: 0;
    min-width: 290px;
    max-width: 340px;
    overflow: visible;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 500;
}
.temporal-lens-dropdown::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 14px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-left: 1px solid #e0dbd3;
    border-top: 1px solid #e0dbd3;
    transform: rotate(45deg);
    z-index: 1;
}
.temporal-lens-dropdown.open {
    opacity: 1;
    transform: translateY(0);
}

/* Inner content clip — needed because dropdown has overflow:visible for the arrow */
.temporal-lens-dropdown > .tl-header,
.temporal-lens-dropdown > .tl-options {
    position: relative;
    z-index: 2;
    background: #fff;
}
.temporal-lens-dropdown > .tl-header {
    border-radius: 14px 14px 0 0;
}
.temporal-lens-dropdown > .tl-options {
    border-radius: 0 0 14px 14px;
}

.tl-header {
    padding: 0.85rem 1rem 0.6rem;
    border-bottom: 1px solid #f0ece6;
}
.tl-header-label {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: #2c2a26;
}
.tl-header-sub {
    display: block;
    font-size: 0.7rem;
    color: #958e85;
    font-weight: 300;
    margin-top: 0.15rem;
}

.tl-options {
    padding: 0.35rem;
}

.tl-option {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.2rem;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Inter', -apple-system, sans-serif;
}
.tl-option:last-child { margin-bottom: 0; }

.tl-option:hover {
    background: var(--lens-bg);
    border-color: var(--lens-color);
    border-left-width: 3px;
}

.tl-option-top {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}
.tl-option-sanskrit {
    font-family: 'Noto Sans Devanagari', serif;
    font-size: 0.85rem;
    color: var(--lens-color);
    opacity: 0.8;
}
.tl-option-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #2c2a26;
}
.tl-option-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    color: #958e85;
    opacity: 0;
    transition: opacity 0.15s;
}
.tl-option:hover .tl-option-arrow { opacity: 1; color: var(--lens-color); }

.tl-option-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--lens-color);
    margin-bottom: 0.2rem;
}
.tl-option-desc {
    display: block;
    font-size: 0.72rem;
    font-weight: 300;
    color: #6b6560;
    line-height: 1.5;
}

/* ── Results panel ── */
.temporal-lens-results {
    display: none;
    margin: 0.75rem 0 1rem;
    animation: tl-fadeIn 0.3s ease;
}
.temporal-lens-results.visible {
    display: block;
}

@keyframes tl-fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.tl-results-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-left: 3px solid #1e88b4;
    padding-left: 0.75rem;
    margin-bottom: 0.5rem;
}
.tl-results-sanskrit {
    font-family: 'Noto Sans Devanagari', serif;
    font-size: 0.9rem;
}
.tl-results-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 500;
    color: #2c2a26;
}
.tl-results-label {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #958e85;
    margin-left: 0.3rem;
}
.tl-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #958e85;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}
.tl-close:hover { color: #2c2a26; }

/* ── Loading dots ── */
.tl-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0 1rem 0.75rem;
}
.tl-loading-dots {
    display: flex;
    gap: 4px;
}
.tl-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1e88b4;
    animation: tl-dot 1.2s ease-in-out infinite;
}
.tl-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.tl-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes tl-dot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.1); }
}

.tl-loading-text {
    font-size: 0.78rem;
    font-weight: 300;
    color: #6b6560;
    font-style: italic;
}

/* ── Prompt cards ── */
.tl-prompt-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tl-prompt-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e0dbd3;
    border-left: 3px solid var(--lens-color, #1e88b4);
    border-radius: 0 8px 8px 0;
    padding: 0.85rem 1rem;
    transition: all 0.15s ease;
}
.tl-prompt-card:hover {
    border-color: var(--lens-color, #1e88b4);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.tl-prompt-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
    font-weight: 500;
    color: #2c2a26;
    margin-bottom: 0.3rem;
}
.tl-prompt-text {
    font-size: 0.8rem;
    font-weight: 300;
    color: #6b6560;
    line-height: 1.6;
    margin-bottom: 0.4rem;
}
.tl-prompt-cta {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--lens-color, #1e88b4);
}

/* ── Upgrade / Error ── */
.tl-upgrade, .tl-error {
    padding: 0.75rem;
    font-size: 0.8rem;
    font-weight: 300;
    color: #6b6560;
    line-height: 1.6;
}
.tl-upgrade-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #1e88b4;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.78rem;
}
.tl-upgrade-link:hover { text-decoration: underline; }
.tl-error { color: #c0392b; }

/* ── Mobile ── */
@media (max-width: 600px) {
    .temporal-lens-dropdown {
        min-width: 240px;
        max-width: calc(100vw - 2rem);
    }
    .tl-option { padding: 0.6rem 0.7rem; }
}

/* ── Mobile adjustments ── */
@media (max-width: 768px) {
    .spark-panel {
        min-width: 260px;
        max-width: calc(100vw - 2rem);
    }

    .spark-panel-container {
        left: -0.5rem;
    }

    .spark-cat-emoji {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }

    .spark-panel-picker {
        max-height: 180px;
    }

    .sparkbar-layout {
        gap: 4px;
    }

    .spark-pill {
        gap: 2px;
        padding: 2px 4px;
    }

    .spark-pill-emojis {
        padding: 2px 6px;
    }

    .spark-emoji-badge {
        font-size: 14px;
    }
}

/* ── Touch device: WCAG tap targets ── */
@media (pointer: coarse) {
    .spark-flame-trigger,
    .spark-lightning-trigger,
    .spark-journal-trigger,
    .spark-tapas-trigger,
    .spark-swami-trigger,
    .spark-dharma-trigger,
    .spark-listen-btn,
    #audioBtn.spark-listen-btn,
    .spark-voice-trigger {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .spark-flame-trigger svg { width: 22px; height: 22px; }
    .spark-lightning-trigger svg,
    .spark-journal-trigger svg,
    .spark-tapas-trigger svg,
    .spark-swami-trigger svg,
    .spark-dharma-trigger svg,
    .spark-listen-btn svg,
    #audioBtn.spark-listen-btn svg,
    .spark-voice-trigger svg { width: 20px; height: 20px; }

    .spark-pill {
        gap: 2px;
        padding: 2px 4px;
    }

    .spark-cat-emoji {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
}

/* ── Small phones: compact Sparkbar to fit single row ── */
@media (pointer: coarse) and (max-width: 430px) {
    .spark-flame-trigger,
    .spark-lightning-trigger,
    .spark-journal-trigger,
    .spark-tapas-trigger,
    .spark-swami-trigger,
    .spark-dharma-trigger,
    .spark-listen-btn,
    #audioBtn.spark-listen-btn,
    .spark-voice-trigger {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
    }

    .spark-flame-trigger svg { width: 19px; height: 19px; }
    .spark-lightning-trigger svg,
    .spark-journal-trigger svg,
    .spark-tapas-trigger svg,
    .spark-swami-trigger svg,
    .spark-dharma-trigger svg,
    .spark-listen-btn svg,
    #audioBtn.spark-listen-btn svg,
    .spark-voice-trigger svg { width: 18px; height: 18px; }

    .spark-pill {
        gap: 1px;
        padding: 2px 3px;
    }

    .sparkbar-layout {
        gap: 3px;
    }
}

/* ═══════════════════════════════════════════
   LIST-PAGE ACTION BUTTONS — Sparkbar-matched
   Overrides for play/pencil buttons on chapter,
   pāda, and glossary list pages.
   ═══════════════════════════════════════════ */

/* ── Journal pencil (blue, matches Sparkbar pencil) ── */
.verse-journal-btn,
.sutra-journal-btn,
.glossary-journal-btn {
    width: 30px !important;
    height: 30px !important;
    padding: 4px !important;
    border: 1px solid rgba(30, 136, 180, 0.3) !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, rgba(30, 136, 180, 0.06) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(30, 136, 180, 0.06) 100%) !important;
    color: #1e88b4 !important;
    transition: all 0.2s ease;
}
.verse-journal-btn:hover,
.sutra-journal-btn:hover,
.glossary-journal-btn:hover {
    border-color: #1e88b4 !important;
    color: #1e88b4 !important;
    background: linear-gradient(135deg, rgba(30, 136, 180, 0.12) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(30, 136, 180, 0.12) 100%) !important;
    box-shadow: 0 0 8px rgba(30, 136, 180, 0.2) !important;
}
.verse-journal-btn svg,
.sutra-journal-btn svg,
.glossary-journal-btn svg {
    width: 15px !important;
    height: 15px !important;
    stroke: currentColor !important;
    fill: none !important;
}

/* ── Audio play (teal, matches Sparkbar Listen) ── */
.verse-audio-btn,
.term-audio-btn {
    width: 30px !important;
    height: 30px !important;
    padding: 4px !important;
    border: 1px solid rgba(0, 150, 136, 0.3) !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.06) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(0, 150, 136, 0.06) 100%) !important;
    color: #009688 !important;
    transition: all 0.2s ease;
}
.verse-audio-btn:hover,
.term-audio-btn:hover {
    border-color: #009688 !important;
    color: #009688 !important;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.12) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(0, 150, 136, 0.12) 100%) !important;
    box-shadow: 0 0 8px rgba(0, 150, 136, 0.2) !important;
}
.verse-audio-btn.playing,
.term-audio-btn.playing {
    border-color: #009688 !important;
    color: #009688 !important;
    background: linear-gradient(135deg, rgba(0, 150, 136, 0.12) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(0, 150, 136, 0.12) 100%) !important;
    box-shadow: 0 0 12px rgba(0, 150, 136, 0.3) !important;
    animation: sparkListenPulse 1.2s ease-in-out infinite;
}
.verse-audio-btn svg,
.term-audio-btn svg {
    width: 14px !important;
    height: 14px !important;
    fill: currentColor !important;
}

/* ── Karma Sparks (hearts/likes) ── */
.karma-heart {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--color-text-light, #958e85);
    font-family: var(--font-sans, 'Inter', -apple-system, sans-serif);
    font-size: 0.75rem;
    line-height: 1;
    transition: all 0.2s ease;
    vertical-align: middle;
}
.karma-heart:hover {
    color: #1e88b4;
    background: rgba(30, 136, 180, 0.06);
}
.karma-heart--liked {
    color: #1e88b4;
}
.karma-heart--liked:hover {
    color: #1879a0;
    background: rgba(30, 136, 180, 0.1);
}
.karma-heart svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.karma-count {
    font-size: 0.72rem;
    font-weight: 500;
    min-width: 0;
}
/* Large variant for entry detail page */
.karma-heart--large {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 8px;
    gap: 6px;
}
.karma-heart--large svg {
    width: 20px;
    height: 20px;
}
.karma-heart--large .karma-count {
    font-size: 0.82rem;
}

/* ═══════════════════════════════════════════
   UPGRADE PILL — iOS/visionOS-inspired
   Compact, fully-rounded upgrade buttons
   for panel upgrade rows.
   ═══════════════════════════════════════════ */
.spark-panel-upgrade-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.spark-panel-upgrade-pill--journal {
    color: #1e88b4;
    background: rgba(30,136,180,0.07);
    border: 1px solid rgba(30,136,180,0.18);
}
.spark-panel-upgrade-pill--journal:hover {
    background: rgba(30,136,180,0.12);
    border-color: rgba(30,136,180,0.35);
    color: #1e88b4;
}
.spark-panel-upgrade-pill--purple {
    color: #7c5cbf;
    background: rgba(124,92,191,0.07);
    border: 1px solid rgba(124,92,191,0.18);
}
.spark-panel-upgrade-pill--purple:hover {
    background: rgba(124,92,191,0.12);
    border-color: rgba(124,92,191,0.35);
    color: #7c5cbf;
}
.spark-panel-upgrade-pill svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   INLINE SMART PROMPT RESULTS PANEL
   Appears below verse/sutra/term on list pages
   after Generate Smart Prompt completes.
   ═══════════════════════════════════════════ */
.spark-results-panel {
    margin-top: 0.5rem;
    padding: 0.8rem 1rem;
    background: var(--color-white, #ffffff);
    border: 1px solid #d0e8f2;
    border-radius: 8px;
    animation: sparkResultsFadeIn 0.3s ease-out;
}
@keyframes sparkResultsFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.spark-results-title {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 0.92rem;
    color: #1e88b4;
    font-weight: 600;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.spark-results-title-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #1e88b4;
}
.spark-results-title-icon svg {
    width: 100%;
    height: 100%;
}
.spark-results-card {
    background: var(--color-white, #ffffff);
    border: 1px solid #d0e8f2;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.spark-results-card:hover {
    border-color: #1e88b4;
    box-shadow: 0 2px 10px rgba(30, 136, 180, 0.12);
}
.spark-results-card-title {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text, #2c2a26);
    margin-bottom: 0.25rem;
}
.spark-results-card-text {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.8rem;
    color: var(--color-text-muted, #6b6560);
    line-height: 1.55;
}
.spark-results-card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.55rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.7rem;
    font-weight: 500;
    color: #1e88b4;
    text-decoration: none;
    padding: 0.25rem 0.55rem;
    border: 1px solid rgba(30,136,180,0.25);
    border-radius: 6px;
    background: rgba(30,136,180,0.03);
    transition: all 0.2s;
}
.spark-results-card-action:hover {
    background: rgba(30,136,180,0.08);
    border-color: rgba(30,136,180,0.5);
}
.spark-results-card-action svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    stroke: #1e88b4;
    fill: none;
}

/* ── Generate Smart Prompt: animated dots ── */
.spark-gen-dot {
    font-weight: 700;
    animation: sparkGenDotPulse 1.4s ease-in-out infinite;
}
.spark-gen-dot:nth-child(2) { animation-delay: 0.2s; }
.spark-gen-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes sparkGenDotPulse {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* ── Sparklights (text highlighting via emoji picker) ── */
/* Highlight marks in text */
mark.sparklight {
    cursor: pointer;
    transition: background-color 0.2s ease, outline 0.15s ease;
    border-radius: 2px;
}
mark.sparklight:hover {
    filter: brightness(0.88);
    outline: 1.5px solid rgba(0,0,0,0.12);
    outline-offset: 1px;
}
mark.sparklight:hover::after {
    content: 'click to remove';
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.62rem;
    font-style: normal;
    color: #958e85;
    background: #fff;
    border: 1px solid #e0dbd3;
    border-radius: 6px;
    padding: 3px 8px;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    z-index: 100;
}
/* Touch active state — visible feedback on tap */
mark.sparklight:active {
    filter: brightness(0.8);
    outline: 2px solid rgba(0,0,0,0.2);
    outline-offset: 1px;
}
/* Tap flash animation for touch devices */
mark.sparklight.sparklight-tap {
    animation: sparklightTap 0.35s ease-out;
}
@keyframes sparklightTap {
    0% { outline: 2px solid rgba(0,0,0,0.3); outline-offset: 0; }
    100% { outline: 2px solid transparent; outline-offset: 4px; }
}
/* ═══════════════════════════════════════════════════
   SPARKLIGHTS — Floating Flame + Color Picker
   Select text → flame materializes → click → picker opens
   ═══════════════════════════════════════════════════ */

/* The floating flame button — SparkUI metallic sheen */
.sparklight-float-flame {
    position: absolute;
    z-index: 500;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(184,134,11,0.25);
    background: linear-gradient(145deg,
        rgba(255,249,240,0.95) 0%,
        rgba(255,255,255,0.98) 50%,
        rgba(254,243,224,0.9) 100%);
    box-shadow:
        0 2px 8px rgba(184,134,11,0.15),
        0 0 0 1px rgba(255,255,255,0.8) inset,
        0 1px 2px rgba(0,0,0,0.06);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #b8860b;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    animation: sparklightFlameIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sparklight-float-flame.visible {
    display: flex;
}
.sparklight-float-flame:hover {
    transform: scale(1.1);
    box-shadow:
        0 3px 12px rgba(184,134,11,0.22),
        0 0 0 1px rgba(255,255,255,0.9) inset,
        0 1px 3px rgba(0,0,0,0.08);
    border-color: rgba(184,134,11,0.4);
}
.sparklight-float-flame:active {
    transform: scale(0.95);
}
.sparklight-float-flame svg {
    width: 18px;
    height: 18px;
    stroke: #b8860b;
    fill: none;
    filter: drop-shadow(0 1px 1px rgba(184,134,11,0.15));
}
@keyframes sparklightFlameIn {
    from { opacity: 0; transform: scale(0.5) translateY(4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* The floating color picker — drops open from flame */
.sparklight-float-picker {
    position: absolute;
    z-index: 501;
    background: #fff;
    border: 1px solid #e0dbd3;
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.10),
        0 2px 8px rgba(0,0,0,0.05);
    display: none;
    flex-direction: column;
    gap: 6px;
    animation: sparklightPickerIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sparklight-float-picker.visible {
    display: flex;
}
@keyframes sparklightPickerIn {
    from { opacity: 0; transform: scale(0.85) translateY(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Picker label — micro SparkUI branding */
.sparklight-float-label {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #958e85;
    padding: 0 2px 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sparklight-float-label svg {
    width: 10px;
    height: 10px;
    stroke: #b8860b;
    fill: none;
}

/* Color button row */
.sparklight-float-colors {
    display: flex;
    gap: 4px;
}
.sparklight-float-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: none;
    padding: 0;
    transition: all 0.12s ease;
}
.sparklight-float-color:hover {
    transform: scale(1.15);
    border-color: rgba(0,0,0,0.1);
}
.sparklight-float-color:active {
    transform: scale(0.92);
}

/* Ripple feedback after picking a color */
.sparklight-float-picked {
    animation: sparklightPickRipple 0.4s ease-out;
}
@keyframes sparklightPickRipple {
    0% { box-shadow: 0 0 0 0 rgba(184,134,11,0.25); }
    100% { box-shadow: 0 0 0 12px rgba(184,134,11,0); }
}

/* Selection color — warm gold tint when selecting text */
.verse-translation::selection,
.sutra-translation::selection,
.glossary-definition::selection,
.term-content::selection,
.entry-body::selection {
    background: rgba(184,134,11,0.18);
}


/* ═══════════════════════════════════════════════════
   TENSION ANALYSIS — Inline Results (list pages)
   ═══════════════════════════════════════════════════ */

.tst-results-panel {
    margin-top: 0.6rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(160deg, rgba(245,240,255,0.6) 0%, rgba(255,255,255,0.95) 40%, rgba(245,240,255,0.3) 100%);
    border: 1px solid rgba(124,92,191,0.25);
    border-radius: 10px;
    animation: sparkResultsFadeIn 0.3s ease-out;
}

/* Header row: title + save */
.tst-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.tst-title {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 0.92rem;
    color: #7c5cbf;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.tst-title-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #7c5cbf;
}
.tst-title-icon svg { width: 100%; height: 100%; }

/* Save pill */
.tst-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.65rem;
    font-weight: 600;
    color: #7c5cbf;
    background: rgba(124,92,191,0.06);
    border: 1px solid rgba(124,92,191,0.2);
    border-radius: 100px;
    padding: 0.25rem 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
}
.tst-save-btn:hover {
    background: rgba(124,92,191,0.12);
    border-color: rgba(124,92,191,0.35);
    box-shadow: 0 1px 4px rgba(124,92,191,0.15);
}
.tst-save-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.tst-save-btn--saved {
    color: #fff;
    background: #7c5cbf;
    border-color: #7c5cbf;
}
.tst-save-btn--saved:hover {
    background: #6a4dab;
    border-color: #6a4dab;
    box-shadow: 0 1px 4px rgba(124,92,191,0.25);
}
@keyframes tstCheckPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.tst-save-btn--saved svg { animation: tstCheckPop 0.3s ease-out; }
@keyframes sparkResultsFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Highlight spans on definition text */
.tst-hl {
    cursor: pointer;
    padding: 0 1px;
    border-radius: 2px;
    transition: all 0.15s;
}
.tst-hl--convergence {
    background: rgba(184, 134, 11, 0.12);
    border-bottom: 2px solid rgba(184, 134, 11, 0.5);
}
.tst-hl--convergence:hover {
    background: rgba(184, 134, 11, 0.2);
}
.tst-hl--tension {
    background: rgba(192, 57, 43, 0.10);
    border-bottom: 2px solid rgba(192, 57, 43, 0.5);
}
.tst-hl--tension:hover {
    background: rgba(192, 57, 43, 0.18);
}

/* Legend */
.tst-legend {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.62rem;
    color: var(--color-text-muted, #6b6560);
}
.tst-legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.tst-legend-swatch {
    width: 12px;
    height: 3px;
    border-radius: 2px;
}
.tst-legend-swatch--convergence { background: #b8860b; }
.tst-legend-swatch--tension { background: #c0392b; }

/* Popover (shown on highlight click) */
.tst-popover {
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(124,92,191,0.12);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    animation: sparkResultsFadeIn 0.2s ease-out;
}
.tst-popover-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    margin-bottom: 0.35rem;
}
.tst-popover-badge--convergence { background: rgba(184, 134, 11, 0.08); color: #b8860b; }
.tst-popover-badge--tension { background: rgba(192, 57, 43, 0.08); color: #c0392b; }
.tst-popover-phrase {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 0.82rem;
    font-style: italic;
    color: var(--color-text-muted, #6b6560);
    margin-bottom: 0.3rem;
}
.tst-popover-note {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.75rem;
    color: var(--color-text, #2c2a26);
    line-height: 1.55;
    margin-bottom: 0.35rem;
}
.tst-popover-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.45rem;
}
.tst-source-tag {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.58rem;
    font-weight: 500;
    background: #f5f0fa;
    color: #7c5cbf;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}
.tst-popover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Action buttons — Journal Blue + Amazon Gold */
.tst-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}
.tst-action-btn svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}
.tst-action-btn--journal {
    color: #1e88b4;
    border: 1px solid rgba(30, 136, 180, 0.25);
    background: rgba(30, 136, 180, 0.03);
}
.tst-action-btn--journal:hover {
    background: rgba(30, 136, 180, 0.08);
    border-color: rgba(30, 136, 180, 0.4);
}
.tst-action-btn--journal svg { stroke: #1e88b4; fill: none; }
.tst-action-btn--amazon {
    color: #b8860b;
    border: 1px solid rgba(184, 134, 11, 0.25);
    background: rgba(184, 134, 11, 0.03);
}
.tst-action-btn--amazon:hover {
    background: rgba(184, 134, 11, 0.08);
    border-color: rgba(184, 134, 11, 0.4);
}
.tst-action-btn--amazon svg { stroke: #b8860b; fill: none; }

/* Synthesis */
.tst-synthesis {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text-muted, #6b6560);
    line-height: 1.6;
    text-align: center;
    padding: 0.5rem 0.3rem;
    margin-top: 0.5rem;
}

/* Closing question */
.tst-closing {
    background: rgba(124, 92, 191, 0.05);
    border: 1px solid rgba(124, 92, 191, 0.15);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin-top: 0.5rem;
}
.tst-closing-label {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7c5cbf;
    margin-bottom: 0.2rem;
}
.tst-closing-text {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 0.85rem;
    color: var(--color-text, #2c2a26);
    line-height: 1.6;
    font-style: italic;
}
.tst-closing-actions {
    margin-top: 0.45rem;
}


/* ═══════════════════════════════════════════════════
   INLINE TEXT AI SPARKS — Results (verse/sutra list pages)
   ═══════════════════════════════════════════════════ */

.its-results-panel {
    margin-top: 0.6rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(160deg, rgba(245,240,255,0.6) 0%, rgba(255,255,255,0.95) 40%, rgba(245,240,255,0.3) 100%);
    border: 1px solid rgba(124,92,191,0.25);
    border-radius: 10px;
    animation: sparkResultsFadeIn 0.3s ease-out;
}
.its-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.its-title {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 0.92rem;
    color: #7c5cbf;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.its-title-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #7c5cbf;
}
.its-title-icon svg { width: 100%; height: 100%; }
.its-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.65rem;
    font-weight: 600;
    color: #7c5cbf;
    background: rgba(124,92,191,0.06);
    border: 1px solid rgba(124,92,191,0.2);
    border-radius: 100px;
    padding: 0.25rem 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
}
.its-save-btn:hover {
    background: rgba(124,92,191,0.12);
    border-color: rgba(124,92,191,0.35);
    box-shadow: 0 1px 4px rgba(124,92,191,0.15);
}
.its-save-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.its-save-btn--saved {
    color: #fff;
    background: #7c5cbf;
    border-color: #7c5cbf;
}
.its-save-btn--saved:hover {
    background: #6a4dab;
    border-color: #6a4dab;
}
.its-save-btn--saved svg { animation: tstCheckPop 0.3s ease-out; }

/* Legend */
.its-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(124,92,191,0.12);
}
.its-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.66rem;
    color: var(--color-text-muted, #6b6560);
}
.its-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Inline highlights */
.its-hl {
    cursor: pointer;
    border-bottom: 2px solid;
    transition: background 0.15s;
}
.its-hl:hover {
    background: rgba(124,92,191,0.08);
}
.its-hl--intertextual { border-color: #b8860b; }
.its-hl--sanskrit { border-color: #c77b30; }
.its-hl--lineage { border-color: #7c5cbf; }
.its-hl--teaching { border-color: #4a9e52; }
.its-hl--intertextual:hover { background: rgba(184,134,11,0.08); }
.its-hl--sanskrit:hover { background: rgba(199,123,48,0.08); }
.its-hl--lineage:hover { background: rgba(124,92,191,0.08); }
.its-hl--teaching:hover { background: rgba(74,158,82,0.08); }

/* Popover cards */
.its-popover {
    margin: 0.5rem 0;
    padding: 0.65rem 0.8rem;
    background: #fff;
    border: 1px solid rgba(124,92,191,0.15);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    animation: sparkResultsFadeIn 0.2s ease-out;
}
.its-popover-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    margin-bottom: 0.35rem;
}
.its-popover-phrase {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text, #2c2a26);
    margin-bottom: 0.3rem;
}
.its-popover-note {
    font-size: 0.73rem;
    line-height: 1.5;
    color: var(--color-text-muted, #6b6560);
    margin-bottom: 0.35rem;
}
.its-popover-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.its-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.62rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s;
}
.its-action-btn svg { width: 11px; height: 11px; flex-shrink: 0; }
.its-action-btn--journal { color: #1e88b4; }
.its-action-btn--journal:hover { background: rgba(30,136,180,0.08); }

/* Closing question */
.its-closing {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(124,92,191,0.12);
}
.its-closing-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7c5cbf;
    margin-bottom: 0.3rem;
}
.its-closing-text {
    font-family: var(--font-serif, 'Cormorant Garamond', serif);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text, #2c2a26);
    line-height: 1.45;
}
.its-closing-actions {
    margin-top: 0.45rem;
}


/* ═══════════════════════════════════════════════════
   TOPICAL GUIDE — Inline Results (list pages)
   ═══════════════════════════════════════════════════ */

.tg-results {
    margin-top: 0.6rem; padding: 0.9rem 1rem;
    background: linear-gradient(160deg, rgba(245,240,255,0.6) 0%, rgba(255,255,255,0.95) 40%, rgba(245,240,255,0.3) 100%);
    border: 1px solid rgba(124,92,191,0.25);
    border-radius: 10px; animation: sparkResultsFadeIn 0.3s ease-out;
}
.tg-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem;
}
.tg-title {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.92rem; color: #7c5cbf; font-weight: 600;
    display: flex; align-items: center; gap: 0.35rem;
}
.tg-title-icon { width: 16px; height: 16px; flex-shrink: 0; color: #7c5cbf; }
.tg-title-icon svg { width: 100%; height: 100%; }

/* Save Button */
.tg-save-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-family: var(--font-sans, 'Inter', sans-serif); font-size: 0.65rem; font-weight: 600;
    color: #7c5cbf; background: rgba(124,92,191,0.06);
    border: 1px solid rgba(124,92,191,0.2); border-radius: 100px;
    padding: 0.25rem 0.65rem; cursor: pointer; transition: all 0.2s;
}
.tg-save-btn:hover {
    background: rgba(124,92,191,0.12); border-color: rgba(124,92,191,0.35);
    box-shadow: 0 1px 4px rgba(124,92,191,0.15);
}
.tg-save-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.tg-save-btn--saved {
    color: #fff; background: #7c5cbf; border-color: #7c5cbf;
}
.tg-save-btn--saved:hover {
    background: #6a4dab; border-color: #6a4dab;
    box-shadow: 0 1px 4px rgba(124,92,191,0.25);
}
.tg-save-btn--saved svg { animation: tstCheckPop 0.3s ease-out; }

/* Remove confirmation */
.tg-remove-confirm {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(192,57,43,0.04); border: 1px solid rgba(192,57,43,0.12);
    border-radius: 6px; padding: 0.3rem 0.6rem; margin-bottom: 0.5rem;
}

/* Groups */
.tg-group { margin-bottom: 0.6rem; }
.tg-group:last-of-type { margin-bottom: 0.5rem; }
.tg-group-label {
    font-family: var(--font-sans, 'Inter', sans-serif); font-size: 0.62rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-light, #958e85);
    margin-bottom: 0.35rem; padding-left: 0.1rem;
}

/* Reference cards */
.tg-ref {
    background: rgba(255,255,255,0.8); border: 1px solid rgba(124,92,191,0.12);
    border-radius: 6px; padding: 0.55rem 0.7rem; margin-bottom: 0.35rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tg-ref:hover { border-color: rgba(124,92,191,0.3); box-shadow: 0 1px 6px rgba(124,92,191,0.08); }
.tg-ref:last-child { margin-bottom: 0; }
.tg-ref-top { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.2rem; }
.tg-ref-badge {
    font-family: var(--font-sans, 'Inter', sans-serif); font-size: 0.55rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em; padding: 0.12rem 0.4rem;
    border-radius: 4px; flex-shrink: 0;
}
.tg-ref-badge--hyp { background: rgba(184,134,11,0.1); color: #b8860b; }
.tg-ref-badge--sutras { background: rgba(74,158,82,0.1); color: #4a9e52; }
.tg-ref-badge--library { background: rgba(124,92,191,0.1); color: #7c5cbf; }
.tg-ref-badge--high { border: 1.5px solid currentColor; }
.tg-ref-badge a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
.tg-ref-badge a:hover { opacity: 0.75; }
.tg-ref-title {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.82rem; font-weight: 600; color: var(--color-text, #2c2a26);
}
.tg-ref-context {
    font-family: var(--font-sans, 'Inter', sans-serif); font-size: 0.75rem;
    color: var(--color-text-muted, #6b6560); line-height: 1.5;
}
.tg-ref-actions {
    display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem;
}
.tg-summary {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.85rem; font-style: italic;
    color: var(--color-text-muted, #6b6560); line-height: 1.6; text-align: center;
    padding: 0.5rem 0.3rem; border-top: 1px solid rgba(124,92,191,0.12); margin-top: 0.5rem;
}
.tg-closing {
    background: rgba(124,92,191,0.05); border: 1px solid rgba(124,92,191,0.15);
    border-radius: 6px; padding: 0.6rem 0.8rem; margin-top: 0.5rem;
}
.tg-closing-label {
    font-family: var(--font-sans, 'Inter', sans-serif); font-size: 0.6rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em; color: #7c5cbf; margin-bottom: 0.2rem;
}
.tg-closing-text {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.85rem; color: var(--color-text, #2c2a26);
    line-height: 1.6; font-style: italic;
}
.tg-closing-actions { margin-top: 0.45rem; }

/* ═══════════════════════════════════════════════════
   Link AI Sparks — Inline Results (.ls-*)
   ═══════════════════════════════════════════════════ */
.ls-results {
    margin-top: 1rem;
    padding: 1.25rem 1rem;
    background: linear-gradient(160deg, rgba(245,240,255,0.6) 0%, rgba(255,255,255,0.95) 40%, rgba(245,240,255,0.3) 100%);
    border: 1px solid rgba(124,92,191,0.25);
    border-radius: 10px;
    animation: resultsFadeIn 0.3s ease-out;
}
.ls-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.75rem;
}
.ls-title {
    display: flex; align-items: center; gap: 0.4rem;
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 1rem; font-weight: 600; color: #7c5cbf;
}
.ls-title-icon { display: flex; align-items: center; }
.ls-title-icon svg { width: 18px; height: 18px; }
.ls-save-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: 100px;
    border: 1px solid rgba(124,92,191,0.25);
    background: rgba(124,92,191,0.06); color: #7c5cbf;
    font-size: 0.72rem; font-weight: 600; cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.ls-save-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.ls-save-btn:hover { background: rgba(124,92,191,0.12); }
.ls-save-btn--saved {
    background: #7c5cbf; color: #fff; border-color: #7c5cbf;
    animation: checkPop 0.3s ease-out;
}
.ls-card {
    background: var(--color-white, #fff);
    border: 1px solid rgba(124,92,191,0.12);
    border-radius: 8px; padding: 0.75rem;
    margin-bottom: 0.6rem;
}
.ls-card-header {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 0.4rem; flex-wrap: wrap;
}
.ls-card-type {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: #fff; padding: 2px 8px;
    border-radius: 100px;
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.ls-card-source {
    font-size: 0.72rem; color: var(--color-text-muted, #6b6560);
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.ls-card-phrase {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.88rem; font-style: italic; color: #7c5cbf;
    margin-bottom: 0.35rem; line-height: 1.5;
}
.ls-card-thread {
    font-size: 0.82rem; color: var(--color-text, #2c2a26);
    line-height: 1.55; margin-bottom: 0.4rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.ls-card-actions {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.ls-card-action {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.72rem; font-weight: 500; text-decoration: none;
    border-radius: 6px; padding: 3px 8px;
    transition: background 0.15s;
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.ls-card-action svg { width: 12px; height: 12px; flex-shrink: 0; }
.ls-card-action--journal { color: #1e88b4; background: rgba(30,136,180,0.06); }
.ls-card-action--journal:hover { background: rgba(30,136,180,0.12); }
.ls-card-action--book { color: #7c5cbf; background: rgba(124,92,191,0.06); }
.ls-card-action--book:hover { background: rgba(124,92,191,0.12); }
.ls-synthesis {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.88rem; font-style: italic; color: var(--color-text, #2c2a26);
    line-height: 1.6; text-align: center; padding: 0.75rem 0.5rem;
    border-top: 1px solid rgba(124,92,191,0.1);
    margin-top: 0.5rem;
}
.ls-closing {
    margin-top: 0.75rem; padding-top: 0.75rem;
    border-top: 1px solid rgba(124,92,191,0.1);
}
.ls-closing-label {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: #7c5cbf; margin-bottom: 0.4rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.ls-closing-card {
    display: block; text-decoration: none; color: inherit;
    background: rgba(124,92,191,0.04); border: 1px solid rgba(124,92,191,0.12);
    border-radius: 8px; padding: 0.6rem 0.75rem;
    transition: background 0.15s;
}
.ls-closing-card:hover { background: rgba(124,92,191,0.08); }
.ls-closing-title {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.88rem; font-weight: 600; color: #7c5cbf;
    margin-bottom: 0.2rem;
}
.ls-closing-text {
    font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 0.85rem; color: var(--color-text, #2c2a26);
    line-height: 1.6; font-style: italic;
}
.ls-empty {
    text-align: center; padding: 1rem;
    color: var(--color-text-muted, #6b6560);
    font-size: 0.85rem; font-style: italic;
    font-family: var(--font-sans, 'Inter', sans-serif);
}
.ls-error {
    text-align: center; padding: 0.5rem;
    color: #c0392b; font-size: 0.82rem;
    font-family: var(--font-sans, 'Inter', sans-serif);
}

/* ══════════════════════════════════════════════════════════════
   ENTRY PAGE AI SPARKS — Lightning button states + inline save
   ══════════════════════════════════════════════════════════════ */

/* Active: stronger purple glow when annotations are visible */
.spark-lightning-trigger.spark-active {
    border-color: rgba(124, 92, 191, 0.5);
    background: linear-gradient(160deg, rgba(235,228,255,0.95) 0%, rgba(200,185,240,0.8) 40%, rgba(140,110,200,0.35) 70%, rgba(235,228,255,0.9) 100%);
    box-shadow: 0 0 8px rgba(124, 92, 191, 0.25), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* Inline Save pill — sits in legend row when AI Sparks are active */
.spark-save-pill {
    display: inline-flex; align-items: center; gap: 0.3rem;
    margin-left: auto;
    padding: 0.25rem 0.65rem;
    border: 1px solid rgba(124, 92, 191, 0.3);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(124, 92, 191, 0.08) 0%, #fff 100%);
    color: #7c5cbf;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 0.72rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    animation: savePillFadeIn 0.3s ease;
}
.spark-save-pill:hover {
    background: #7c5cbf; color: #fff; border-color: #7c5cbf;
    box-shadow: 0 2px 8px rgba(124, 92, 191, 0.25);
}
.spark-save-pill svg {
    width: 12px; height: 12px;
}
@keyframes savePillFadeIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Saved state — clickable to unsave */
.spark-save-pill--saved {
    border-color: rgba(124, 92, 191, 0.4);
    background: rgba(124, 92, 191, 0.1);
    color: #7c5cbf;
    cursor: pointer;
    pointer-events: auto;
}
.spark-save-pill--saved:hover {
    background: rgba(192, 57, 43, 0.08);
    border-color: rgba(192, 57, 43, 0.4);
    color: #c0392b;
}

/* Entry body shimmer — purple gradient sweep during AI analysis */
.entry-body.spark-shimmer {
    position: relative;
    overflow: hidden;
}
.entry-body.spark-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(124, 92, 191, 0.04) 20%,
        rgba(124, 92, 191, 0.10) 50%,
        rgba(124, 92, 191, 0.04) 80%,
        transparent 100%
    );
    animation: sparkTextShimmer 1.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes sparkTextShimmer {
    0% { left: -50%; }
    100% { left: 100%; }
}
