/* Helper text for AI prompt section */
.form-ai-prompts-helper {
    font-size: 0.92rem;
    color: var(--mc-primary-dark, #0f766e);
    margin-bottom: 10px;
    font-weight: 500;
    opacity: 0.9;
    padding-left: 2px;
}

.selected-prompt-meta {
    margin: 0 24px 12px;
    padding: 14px 16px;
    border-radius: var(--mc-radius-md, 10px);
    background: var(--mc-primary-light, #f0fdfa);
    border: 1px solid var(--mc-border, #e2e8f0);
}

.selected-prompt-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--mc-radius-full, 9999px);
    background: var(--mc-surface-muted, #f1f5f9);
    border: 1px solid var(--mc-border, #e2e8f0);
    color: var(--mc-primary-dark, #0f766e);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.selected-prompt-title {
    margin-top: 8px;
    color: var(--mc-text-primary, #0f172a);
    font-size: 0.92rem;
    font-weight: 700;
}

.selected-prompt-question {
    margin-top: 4px;
    color: var(--mc-text-secondary, #475569);
    font-size: 0.88rem;
    line-height: 1.5;
}

.selected-prompt-reset {
    margin-top: 8px;
    border: none;
    background: transparent;
    color: #0f766e;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}

.selected-prompt-reset:hover {
    text-decoration: underline;
}

.journal-validation-msg {
    min-height: 20px;
    margin: 10px 24px 0;
    color: #b91c1c;
    font-size: 0.82rem;
    font-weight: 600;
}

body.a11y-low-vision .selected-prompt-meta,
body.a11y-low-vision.a11y-high-contrast .selected-prompt-meta {
    background: #232323;
    border-color: #3a3a3a;
    box-shadow: none;
}

body.a11y-low-vision .selected-prompt-pill,
body.a11y-low-vision.a11y-high-contrast .selected-prompt-pill {
    background: #2f2f2f;
    color: #b5d5ff;
}

body.a11y-low-vision .selected-prompt-title,
body.a11y-low-vision .selected-prompt-question,
body.a11y-low-vision .selected-prompt-reset,
body.a11y-low-vision .journal-validation-msg,
body.a11y-low-vision.a11y-high-contrast .selected-prompt-title,
body.a11y-low-vision.a11y-high-contrast .selected-prompt-question,
body.a11y-low-vision.a11y-high-contrast .selected-prompt-reset,
body.a11y-low-vision.a11y-high-contrast .journal-validation-msg {
    color: #f1f5f9;
}
html { 
    background-color: #f7f9fc; 
}

body {
    background-color: var(--bg-color);
}



/* Use body prefix to win specificity over body.user-logged-in .mobile-top-bar in style.css */
body .mobile-top-bar {
    display: grid !important;
    grid-template-columns: 48px 1fr 48px !important;
    position: sticky !important;
    top: 0 !important;
    background: #ffffff !important;
    height: 64px !important;
    border-bottom: 1px solid #efefef !important;
    align-items: center !important;
    justify-content: unset !important;    /* cancel flex justify-content from style.css */
    z-index: 1000 !important;
    padding: 0 12px !important;
}

body .mobile-top-bar .mobile-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

body .mobile-top-bar .mobile-logo span {
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    color: #262626 !important;
}

/* Dark theme overrides */
body.theme-charcoal .mobile-top-bar {
    background: #181818 !important;
    border-color: #2d2d2d !important;
}

body.theme-charcoal .mobile-top-bar .mobile-logo span {
    color: #f8fafc !important;
}

@media (max-width: 767px) {

    body .mobile-top-bar {
        padding-top: env(safe-area-inset-top) !important;
        height: calc(64px + env(safe-area-inset-top)) !important;
    }

    /* Hide the injected hamburger toggle so there's no overlap */
    .mobile-sidebar-toggle {
        display: none !important;
        pointer-events: none !important;
    }

    /* Keep back button inside header grid to prevent overlap overrides */
    .mobile-top-bar .back-btn-top {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        grid-column: 1 !important;
        justify-self: start !important;
        z-index: 2 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 42px !important;
        height: 42px !important;
        background: #ffffff !important;
        color: #7c3aed !important;
        border: 1px solid #ede9fe !important;
        border-radius: 10px !important;
        font-size: 1rem !important;
        cursor: pointer !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08) !important;
        transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .mobile-top-bar .mobile-logo {
        min-width: 0 !important;
    }

    .mobile-top-bar .mobile-logo span {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .mobile-top-bar .back-btn-top:hover {
        background: #ede9fe !important;
        transform: translateX(-2px) !important;
        box-shadow: 0 10px 24px rgba(165, 148, 249, 0.2) !important;
    }

    .mobile-top-bar .back-btn-top:active {
        transform: translateX(-2px) scale(0.92) !important;
        box-shadow: none !important;
    }

    body.theme-charcoal .mobile-top-bar .back-btn-top {
        background: #1e1e1e !important;
        border-color: #2d2d2d !important;
        color: #a594f9 !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4) !important;
    }

    /* Compensate main content for sticky top bar on mobile */
    .main-content {
        padding-top: 8px !important;
    }
}

.journal-page-wrapper {
    padding: 4px 16px 24px;
    max-width: 100%;
}

.journal-hero {
    position: relative;
    border-radius: var(--mc-radius-lg, 16px);
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--mc-surface, #ffffff);
    border: 1px solid var(--mc-border, #e2e8f0);
    box-shadow: var(--mc-shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
    animation: heroFadeIn 0.4s ease-out forwards;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.journal-hero-inner {
    display: flex;
    flex-direction: column;
}

.journal-hero-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.journal-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.journal-hero-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
}

.journal-hero-body {
    padding: 20px 20px 24px;
}

.journal-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--mc-primary-light, #f0fdfa);
    color: var(--mc-primary-dark, #0f766e);
    border: 1px solid var(--mc-primary, #0F766E);
    padding: 4px 12px;
    border-radius: var(--mc-radius-full, 9999px);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.journal-hero-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--mc-text-primary, #0f172a);
    margin-bottom: 8px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.journal-hero-prompt {
    font-size: 0.95rem;
    color: var(--mc-text-secondary, #475569);
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 18px;
    font-weight: 400;
}

.journal-hero-btn {
    background: var(--mc-primary, #0F766E);
    color: #ffffff;
    border: none;
    outline: none;
    padding: 12px 24px;
    border-radius: var(--mc-radius-sm, 6px);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.2px;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.journal-hero-btn:hover {
    background: var(--mc-primary-dark, #0f766e);
}

.journal-hero-btn:active {
    opacity: 0.9;
}

.journal-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
    animation: fadeIn 0.5s ease-out 0.15s forwards;
    opacity: 0;
}

.journal-stat-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 18px 14px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.journal-stat-card:active {
    transform: scale(0.96);
}

.journal-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1.1rem;
}

.journal-stat-icon.purple {
    background: #ede9fe;
    color: #7c3aed;
}

.journal-stat-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.journal-stat-icon.teal {
    background: #ccfbf1;
    color: #0F766E;
}

.journal-stat-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 3px;
}

.journal-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.journal-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    animation: fadeIn 0.5s ease-out 0.25s forwards;
    opacity: 0;
}

.journal-timeline-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.journal-timeline-title i {
    color: var(--accent-lavender);
    font-size: 0.85rem;
}

.timeline-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.timeline-filter-select {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--accent-lavender);
    background: #ffffff;
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    padding: 6px 10px;
    min-height: 32px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.timeline-filter-select:focus {
    outline: none;
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

.journal-month-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.journal-month-group + .journal-month-group {
    margin-top: 4px;
}

.journal-month-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding-left: 2px;
}

#journalHistoryList {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeIn 0.5s ease-out 0.3s forwards;
    opacity: 0;
}

@media (max-width: 560px) {
    .journal-timeline-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .timeline-filters {
        width: 100%;
        justify-content: flex-start;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .timeline-filter-select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 40px;
        padding: 8px 30px 8px 10px;
        font-size: 16px;
        line-height: 1.2;
        box-sizing: border-box;
        -webkit-appearance: menulist;
        appearance: auto;
        background-position: right 8px center;
        background-repeat: no-repeat;
    }

    .timeline-filter-select option {
        font-size: 0.92rem;
        line-height: 1.35;
    }
}

.mood-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.mood-tag.excellent { 
    background: #d1fae5; 
    color: #065f46; 
}

.mood-tag.good { 
    background: #dbeafe; 
    color: #1e40af; 
}

.mood-tag.neutral { 
    background: #f3f4f6; 
    color: #4b5563; 
}

.mood-tag.low { 
    background: #fef3c7; 
    color: #92400e; 
}

.mood-tag.bad { 
    background: #fee2e2; 
    color: #991b1b; 
}

.journal-card {
    cursor: pointer;
    overflow: hidden;
    width: 100%;
    border-radius: 20px !important;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.journal-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.journal-card .preview-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.65;
    word-break: break-word;
}

.journal-card.expanded .preview-text {
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.journal-card-date {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.journal-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.journal-card-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.journal-card-actions button:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

.journal-empty-state {
    text-align: center;
    padding: 50px 24px;
    background: var(--card-bg);
    border-radius: 24px;
    border: 2px dashed var(--border-color);
}

.journal-empty-icon {
    width: 72px;
    height: 72px;
    background: #ede9fe;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: var(--accent-lavender);
}

.journal-empty-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.journal-empty-sub {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}


.fab-journal {
    position: fixed;
    bottom: 90px; /* Above bottom nav on mobile */
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--mc-primary, #0F766E);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: background 0.15s ease, transform 0.15s ease;
    animation: fabEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-journal:hover {
    background: var(--mc-primary-dark, #0f766e);
}

.fab-journal i {
    font-size: 1.5rem;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.fab-journal:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(165, 148, 249, 0.5),
        0 12px 32px rgba(165, 148, 249, 0.3);
}

.fab-journal:active {
    transform: scale(0.95);
}

body.has-help-now-btn .fab-journal,
body.recovery-mode-active .fab-journal {
    bottom: 160px;
}

@keyframes fabEntrance {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.1) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Hide FAB on desktop when sidebar is visible */
@media (min-width: 768px) {
    .fab-journal {
        bottom: 30px;
        right: 30px;
        width: 70px;
        height: 70px;
    }

    body.has-help-now-btn .fab-journal,
    body.recovery-mode-active .fab-journal {
        bottom: 120px;
    }
    
    .fab-journal i {
        font-size: 1.7rem;
    }
}

#journalForm {
    display: none;
    position: fixed;
    inset: 0;
    background: #fafafa;
    z-index: 2500;
    padding: 0;
    flex-direction: column;
    overflow-y: auto;
    animation: formSlideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#journalForm.active {
    display: flex;
}

@keyframes formSlideUp {
    from { 
        transform: translateY(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.journal-form-wrapper {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .journal-form-wrapper {
        max-width: 700px;
        margin: 0 auto;
        border-radius: 0;
        min-height: auto;
    }
}

.form-topbar {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #efefef;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.form-close-btn {
    background: #f5f5f5;
    border: none;
    color: #262626;
    font-size: 1rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.form-close-btn:hover {
    background: #ede9fe;
    color: #7c3aed;
    transform: translateX(-3px);
}

.form-close-btn:active {
    transform: translateX(-3px) scale(0.92);
}

.form-topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #262626;
    letter-spacing: -0.02em;
}

.form-save-btn {
    background: var(--mc-primary, #0F766E);
    border: none;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 9px 20px;
    border-radius: var(--mc-radius-sm, 6px);
    transition: background 0.15s ease;
}

.form-save-btn:hover {
    background: var(--mc-primary-dark, #0f766e);
}

.form-save-btn:active {
    transform: translateY(0);
}

.form-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 120;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.bottom-action-bar-inner {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
}

.form-body {
    flex: 1;
    padding: 24px 20px 40px;
    background: #fafafa;
}

.page-scroll-container {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.form-mood-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-mood-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #262626;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-mood-label::before {
    content: "😊";
    font-size: 1.2rem;
}

.form-mood-selector {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.form-mood-selector .mood-btn-v3 {
    flex: 1;
    min-width: 70px;
    padding: 12px 8px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.form-mood-selector .mood-btn-v3 .emoji {
    font-size: 2rem;
    line-height: 1;
    display: block;
    transition: transform 0.2s ease;
}

.form-mood-selector .mood-btn-v3 .label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    text-transform: capitalize;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.form-mood-selector .mood-btn-v3:hover {
    background: #efefef;
}

.form-mood-selector .mood-btn-v3:hover .emoji {
    transform: scale(1.15);
}

.form-mood-selector .mood-btn-v3.selected {
    background: #ede9fe;
    border-color: #a594f9;
}

.form-mood-selector .mood-btn-v3.selected .label {
    color: #8b5cf6;
    font-weight: 600;
}

.form-mood-selector .mood-btn-v3.selected .emoji {
    transform: scale(1.1);
}

.form-divider {
    height: 20px;
}

.form-textarea {
    width: 100%;
    min-height: 300px;
    background: #ffffff;
    border: 2px solid #efefef;
    border-radius: 20px;
    padding: 20px;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    color: #262626;
    line-height: 1.7;
    resize: vertical;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-textarea:focus {
    outline: none;
    border-color: #a594f9;
    box-shadow: 0 4px 16px rgba(165, 148, 249, 0.15);
}

.form-textarea::placeholder {
    color: #64748B;
    font-style: italic;
}

@media (min-width: 768px) {
    .form-body {
        padding: 32px 40px 60px;
    }

    .page-scroll-container {
        padding-bottom: calc(88px + env(safe-area-inset-bottom));
    }
    
    .form-mood-selector .mood-btn-v3 {
        min-width: 90px;
        padding: 16px 12px;
    }
    
    .form-mood-selector .mood-btn-v3 .emoji {
        font-size: 2.5rem;
    }
    
    .form-mood-selector .mood-btn-v3 .label {
        font-size: 0.85rem;
    }
    
    .form-textarea {
        min-height: 400px;
        font-size: 1.05rem;
    }
}

@media (max-width: 640px) {
    .bottom-action-bar-inner {
        justify-content: stretch;
    }

    .bottom-action-bar .form-save-btn {
        width: 100%;
    }
}

/* Mobile adjustments for mood selector */
@media (max-width: 480px) {
    .form-mood-selector {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
    }
    
    .form-mood-selector .mood-btn-v3 {
        flex: initial;
        min-width: 0;
        padding: 10px 4px;
    }
    
    .form-mood-selector .mood-btn-v3 .emoji {
        font-size: 1.75rem;
    }
    
    .form-mood-selector .mood-btn-v3 .label {
        font-size: 0.65rem;
    }
}

.ai-prompts-section {
    margin: 18px 0 20px;
}

.ai-prompts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ai-prompts-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ai-prompts-label i {
    font-size: 0.75rem;
}

.ai-prompts-refresh-btn {
    background: rgba(165, 148, 249, 0.12);
    border: none;
    outline: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #7c3aed;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.ai-prompts-refresh-btn:hover {
    background: rgba(165, 148, 249, 0.25);
    transform: rotate(45deg);
}

.ai-prompts-refresh-btn.spinning i {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-prompts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-prompt-chip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(165, 148, 249, 0.2);
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e1b4b;
    line-height: 1.45;
    transition: all 0.2s ease;
    animation: promptFadeIn 0.35s ease-out forwards;
    opacity: 0;
    -webkit-tap-highlight-color: transparent;
}

@keyframes promptFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-prompt-chip i {
    color: #a594f9;
    font-size: 0.8rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.ai-prompt-chip:hover {
    background: rgba(165, 148, 249, 0.1);
    border-color: rgba(165, 148, 249, 0.4);
    transform: translateX(4px);
}

.ai-prompt-chip:active {
    transform: scale(0.98);
}

.ai-prompts-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: #7c3aed;
    font-size: 0.8rem;
    font-weight: 500;
}

.ai-prompts-loading i {
    font-size: 0.9rem;
}

.form-ai-prompts {
    padding: 0 24px;
    margin-bottom: 8px;
}

.form-ai-prompts-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #a594f9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.form-ai-prompts-label i {
    font-size: 0.75rem;
}

.form-ai-prompt-chip {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    margin-bottom: 6px;
    background: rgba(165, 148, 249, 0.08);
    border: 1px solid rgba(165, 148, 249, 0.15);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4c1d95;
    line-height: 1.4;
    transition: all 0.2s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.form-ai-prompt-chip:hover {
    background: rgba(165, 148, 249, 0.18);
    border-color: rgba(165, 148, 249, 0.35);
}

.form-ai-prompt-chip:active {
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .form-ai-prompts {
        padding: 0 40px;
    }

    .selected-prompt-meta {
        margin-left: 40px;
        margin-right: 40px;
    }

    .journal-validation-msg {
        margin-left: 40px;
        margin-right: 40px;
    }
    
    .ai-prompt-chip {
        font-size: 0.9rem;
        padding: 14px 18px;
    }
}
