/**
 * Adaptiverse Lead Gen - Styles
 * Matches the Adaptiverse design language.
 */

/* =============================================
   VARIABLES & BASE
   ============================================= */
.alg-generator-wrap,
.alg-expired-wrap {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.alg-lesson-wrap {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin: 0 auto;
    padding: 20px;
}

@media (min-width: 1200px) {
    .alg-lesson-wrap {
        margin-left: 50px;
        margin-right: 50px;
        padding-left: 50px;
        padding-right: 50px;
    }
}

@media (max-width: 1199px) {
    .alg-lesson-wrap {
        margin-left: 20px;
        margin-right: 20px;
    }
}

/* =============================================
   FORM CONTAINER
   ============================================= */
.alg-form-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px 40px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.alg-form-heading {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 30px 0;
    background: linear-gradient(90deg, #4568dc, #b06ab3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.alg-form-group {
    margin-bottom: 20px;
}

.alg-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 0.95rem;
}

.alg-form-group textarea,
.alg-form-group select,
.alg-form-group input[type="email"],
.alg-form-group input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.alg-form-group textarea:focus,
.alg-form-group select:focus,
.alg-form-group input:focus {
    outline: none;
    border-color: #2575fc;
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.1);
}

.alg-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* =============================================
   TOPIC INPUT WRAPPER & SUGGESTION BUBBLES
   ============================================= */
.alg-topic-wrap {
    position: relative;
}

.alg-topic-wrap textarea {
    min-height: 100px;
}

.alg-suggestions {
    position: absolute;
    top: 12px;
    left: 14px;
    right: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    pointer-events: auto;
}

.alg-suggestion-pill {
    display: inline-block;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #d1d9e6;
    border-radius: 20px;
    font-size: 0.82rem;
    font-family: inherit;
    color: #4568dc;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.alg-suggestion-pill:hover {
    background: rgba(69, 104, 220, 0.08);
    border-color: #4568dc;
    box-shadow: 0 2px 6px rgba(69, 104, 220, 0.15);
}

/* =============================================
   LOCKED IMAGE UPLOAD TEASER
   ============================================= */
.alg-image-upload-teaser {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    margin-bottom: 20px;
    opacity: 0.7;
    cursor: default;
    transition: opacity 0.2s ease;
}

.alg-image-upload-teaser:hover {
    opacity: 0.85;
}

.alg-upload-icon {
    flex-shrink: 0;
    color: #9ca3af;
}

.alg-upload-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alg-upload-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #4b5563;
}

.alg-upload-desc {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* =============================================
   LOCKED OPTIONS (PRO MARKETING)
   ============================================= */
.alg-locked-options {
    margin: 24px 0;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #d1d5db;
}

.alg-locked-option {
    margin-bottom: 12px;
}

.alg-locked-option:last-child {
    margin-bottom: 0;
}

.alg-locked-option label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.alg-locked-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    opacity: 0.7;
}

.alg-locked-text {
    font-size: 0.9rem;
    color: #9ca3af;
}

.alg-pro-badge {
    display: inline-block;
    padding: 2px 10px;
    background: linear-gradient(90deg, #4568dc, #b06ab3);
    color: #fff;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* =============================================
   ADVANCED TOOLS ACCORDION
   ============================================= */
.alg-advanced-accordion {
    margin-top: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.alg-advanced-toggle {
    display: block;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #6b7280;
    cursor: pointer;
    background: #f9fafb;
    list-style: none;
    user-select: none;
    transition: color 0.2s ease;
}

.alg-advanced-toggle::-webkit-details-marker {
    display: none;
}

.alg-advanced-toggle::before {
    content: '\25B6';
    display: inline-block;
    margin-right: 8px;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.alg-advanced-accordion[open] .alg-advanced-toggle::before {
    transform: rotate(90deg);
}

.alg-advanced-toggle:hover {
    color: #4568dc;
}

.alg-advanced-content {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

.alg-advanced-content .alg-image-upload-teaser {
    margin-bottom: 16px;
}

.alg-advanced-content .alg-locked-options {
    margin: 0;
}

/* =============================================
   BUTTONS
   ============================================= */
.alg-generate-button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: #2575fc;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.alg-generate-button:hover {
    background: #1a66e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 117, 252, 0.3);
}

.alg-generate-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =============================================
   GENERATION PROGRESS MODAL
   ============================================= */
.alg-generation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alg-generation-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* =============================================
   FORM ERROR
   ============================================= */
.alg-form-error {
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* =============================================
   EMAIL GATE (LAYER 3)
   ============================================= */
.alg-email-gate {
    text-align: center;
    padding: 20px 0;
}

.alg-email-gate h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.alg-email-gate p {
    color: #4a5568;
    margin-bottom: 20px;
}

/* =============================================
   GATED LESSON DISPLAY
   ============================================= */
.alg-lesson-wrap {
    padding-bottom: 40px;
}

.alg-lesson-article {
    background: #fff;
    position: relative;
}

@media (min-width: 1200px) {
    .alg-lesson-article {
        padding: 20px 50px 40px 50px;
    }
}

@media (max-width: 1199px) {
    .alg-lesson-article {
        padding: 20px;
    }
}

.alg-lesson-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.alg-lesson-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
}

.alg-lesson-meta {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.alg-meta-item {
    display: inline-block;
    padding: 4px 12px;
    background: #f7f9fc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #4a5568;
}

/* Lesson content — copy protection */
.alg-lesson-content {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Section fade effect for truncated content */
.alg-section-fade {
    position: relative;
}

.alg-section-fade::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
}

/* =============================================
   SIGNUP OVERLAY (blur boundary)
   ============================================= */
.alg-gate-overlay {
    position: sticky;
    bottom: 0;
    margin-top: -30px;
    padding-top: 40px;
    text-align: center;
    z-index: 10;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.85) 20px,
        #fff 40px);
}

@keyframes alg-gate-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alg-gate-content {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 16px;
    padding: 24px 24px 20px;
    margin: 0 auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    animation: alg-gate-slide-up 0.5s ease-out both;
}

@media (min-width: 768px) {
    .alg-gate-content {
        padding: 40px 48px;
    }
}

.alg-gate-content h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #ffffff;
}

.alg-gate-content p {
    color: #cbd5e1;
    margin-bottom: 16px;
    font-size: 1rem;
}

.alg-signup-field {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.alg-signup-field input[type="email"] {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
}

.alg-signup-field input[type="email"]:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.3);
    background: #fff;
}

.alg-signup-button {
    padding: 12px 24px;
    background: linear-gradient(90deg, #4568dc, #b06ab3);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.alg-signup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(69, 104, 220, 0.4);
}

.alg-signup-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.alg-signup-note {
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 8px;
}

.alg-signup-message .alg-success {
    color: #34d399;
    font-weight: 500;
}

.alg-signup-message .alg-error {
    color: #fb7185;
    font-weight: 500;
}

.alg-login-link {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 16px;
}

.alg-login-link a {
    color: #818cf8;
    text-decoration: underline;
}

.alg-login-link a:hover {
    color: #a5b4fc;
}

/* =============================================
   SHARE URL
   ============================================= */
.alg-share-url {
    text-align: center;
    margin-top: 24px;
}

.alg-share-text {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.alg-share-input {
    width: 100%;
    max-width: 500px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #4a5568;
    background: #f7f9fc;
    text-align: center;
    cursor: pointer;
}

/* =============================================
   EXPIRED PAGE
   ============================================= */
.alg-expired-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.alg-expired-content {
    text-align: center;
    background: #fff;
    border-radius: 12px;
    padding: 48px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 500px;
    width: 100%;
}

.alg-expired-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.alg-expired-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.alg-expired-content p {
    color: #4a5568;
    margin-bottom: 24px;
}

.alg-signup-form-centered .alg-signup-field {
    justify-content: center;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .alg-form-container,
    .alg-expired-content {
        padding: 24px 16px;
    }

    .alg-lesson-article {
        padding: 16px;
    }

    .alg-form-heading {
        font-size: 1.3rem;
    }

    .alg-lesson-title {
        font-size: 1.4rem;
    }

    .alg-signup-button {
        white-space: nowrap;
    }

    .alg-locked-input {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .alg-lesson-meta {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .alg-generator-wrap,
    .alg-expired-wrap {
        padding: 10px;
    }

    .alg-lesson-wrap {
        padding: 10px;
        margin-left: 0;
        margin-right: 0;
    }

    .alg-form-container {
        border-radius: 8px;
    }

    .alg-suggestion-pill {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}

/* =============================================
   LESSON LOADING / PROGRESS STATE
   ============================================= */
/* #alg-lesson-loading reuses .alg-generation-modal styles (fixed overlay).
   No additional layout overrides needed — the modal class handles positioning. */

/* --- Pulsing Dots Animation --- */
.alg-progress-pulse {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.alg-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4568dc, #b06ab3);
    animation: alg-pulse 1.4s ease-in-out infinite;
}

.alg-progress-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.alg-progress-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes alg-pulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Progress Message with Fade Transitions --- */
.alg-progress-message-wrap {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.alg-progress-message {
    font-size: 1.05rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.5;
    max-width: 480px;
    transition: opacity 0.35s ease, transform 0.35s ease;
    opacity: 0;
    transform: translateY(6px);
}

.alg-progress-message.alg-progress-visible {
    opacity: 1;
    transform: translateY(0);
}

.alg-progress-message.alg-progress-hidden {
    opacity: 0;
    transform: translateY(-6px);
}

.alg-progress-message.alg-progress-ready {
    font-weight: 700;
    background: linear-gradient(90deg, #4568dc, #b06ab3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.2rem;
}

/* --- Progress Bar --- */
.alg-progress-bar-wrap {
    margin-top: 8px;
    text-align: center;
}

.alg-progress-bar-track {
    width: 80%;
    max-width: 320px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin: 0 auto 8px;
    overflow: hidden;
}

.alg-progress-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, #4568dc, #b06ab3);
    transition: width 0.6s ease;
}

.alg-progress-bar-label {
    font-size: 0.75rem;
    color: #9ca3af;
    letter-spacing: 0.02em;
}

/* Legacy compatibility — keep spinner keyframes for form progress */
.alg-loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 24px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: alg-spin-legacy 0.8s linear infinite;
}

@keyframes alg-spin-legacy {
    to { transform: rotate(360deg); }
}

.alg-loading-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.alg-loading-subtext {
    font-size: 0.95rem;
    color: #6b7280;
}

/* =============================================
   SMART LOGIN PAGE
   ============================================= */
.alg-login-wrap {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.alg-login-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.alg-login-logo {
    margin-bottom: 24px;
}

.alg-login-logo-img {
    max-height: 48px;
    width: auto;
}

.alg-login-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.alg-login-subtext {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.alg-smart-login-form .alg-form-group {
    text-align: left;
    margin-bottom: 16px;
}

.alg-smart-login-form .alg-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 6px;
}

.alg-smart-login-form .alg-form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.alg-smart-login-form .alg-form-group input:focus {
    outline: none;
    border-color: #2575fc;
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.1);
}

.alg-login-button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(90deg, #4568dc, #b06ab3);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.alg-login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(69, 104, 220, 0.4);
}

.alg-login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.alg-login-message {
    margin-top: 16px;
}

.alg-login-message .alg-success {
    color: #059669;
    font-weight: 500;
    font-size: 0.95rem;
}

.alg-login-message .alg-error {
    color: #dc2626;
    font-weight: 500;
    font-size: 0.95rem;
}

.alg-login-footer {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 24px;
}

.alg-login-footer a {
    color: #4568dc;
    text-decoration: underline;
}

.alg-login-footer a:hover {
    color: #2575fc;
}

@media (max-width: 480px) {
    .alg-login-container {
        padding: 32px 20px;
    }
}

/* =============================================
   UPGRADE PROMPT MODAL
   ============================================= */
.alg-upgrade-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.alg-upgrade-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.alg-upgrade-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.alg-upgrade-close:hover {
    color: #374151;
}

.alg-upgrade-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
}

.alg-upgrade-card p {
    color: #4a5568;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.alg-discount-badge {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #92400e;
    margin-bottom: 20px;
}

.alg-upgrade-cta {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(90deg, #4568dc, #b06ab3);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
}

.alg-upgrade-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(69, 104, 220, 0.4);
    color: #fff;
}

.alg-upgrade-dismiss {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.alg-upgrade-dismiss:hover {
    color: #4a5568;
}

/* =========================================================================
   SECTION IMAGES (from lesson-generator image fetcher)
   ========================================================================= */

.lg-section-image {
    max-width: 100%;
    margin: 16px 0;
}

.lg-section-image .lg-lesson-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.lg-image-attribution {
    font-size: 11px;
    color: #999;
    margin: 4px 0 0 0;
    line-height: 1.3;
}

.lg-image-attribution a {
    color: #888;
}

/* Hide edit-mode buttons on gated view */
.alg-lesson-content .lg-image-actions {
    display: none;
}

@media (max-width: 768px) {
    .lg-section-image {
        margin: 12px 0;
    }
}

/* =========================================================================
   KEYWORD PILL CLICK-TO-HIGHLIGHT
   ========================================================================= */

.keyword-pill {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.keyword-pill:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.keyword-pill.keyword-active {
    background: #fff59d;
    border-color: #fdd835;
}

.keyword-highlight {
    background-color: #fff59d;
    padding: 1px 2px;
    border-radius: 2px;
}
