/* Base prompt container styles */
.prompt-container {
    background: linear-gradient(135deg, #9333ea33, #8b5cf644);
    border-left: 4px solid #8b5cf6;
    border-radius: 8px;
    margin: 10px 0 20px 0;
    padding: 16px 16px 16px 20px;
    position: relative;
    box-shadow: 0 4px 6px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
    z-index: 20;
    width: calc(100% - 10px);
    max-width: 100%;
    animation: prompt-fade-in 0.5s ease-out;
}

.prompt-container:hover {
    box-shadow: 0 6px 12px rgba(139, 92, 246, 0.15);
    transform: translateY(-2px);
}

@keyframes prompt-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.prompt-content {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    position: relative;
    padding-left: 28px;
}

.prompt-container.prompt-is-collapsible.prompt-collapsed .prompt-content {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
    max-height: 8em;
}

.prompt-container.prompt-is-collapsible.prompt-expanded .prompt-content {
    display: block;
    max-height: none;
    overflow: visible;
}

.prompt-content::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -5px;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: Georgia, serif;
    line-height: 1;
}

.prompt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.prompt-footer > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.prompt-source-ritual {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(70%, 420px);
}

.prompt-source-ritual-thumb {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
    flex: 0 0 auto;
    object-fit: cover;
}

.prompt-source-ritual-name {
    color: currentColor;
    font-size: 0.95rem;
    font-weight: 750;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.read-only-prompt-source {
    margin-bottom: 0.45rem;
    color: #6f3bd5;
    max-width: 100%;
}

.read-only-prompt-source .prompt-source-ritual-thumb {
    width: 24px;
    height: 24px;
    border-radius: 7px;
}

.read-only-prompt-source .prompt-source-ritual-name {
    font-size: 0.82rem;
}

.prompt-icon {
    position: absolute;
    top: -10px;
    right: -6px;
    background: #8b5cf6;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
    z-index: 2;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prompt-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.7);
}

.prompt-dismiss {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 0.8rem;
    height: 32px;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 32px;
}

.prompt-dismiss:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.prompt-dismiss::before {
    content: '×';
    font-size: 1rem;
    line-height: 0.8;
}

.prompt-container.prompt-template-source-only {
    padding-top: 14px;
    padding-bottom: 14px;
}

.prompt-container.prompt-template-source-only .prompt-content {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    margin: 0;
    padding: 0;
}

.prompt-container.prompt-template-source-only.prompt-is-collapsible.prompt-collapsed .prompt-content,
.prompt-container.prompt-template-source-only.prompt-is-collapsible.prompt-expanded .prompt-content {
    display: block;
    max-height: 1px;
    overflow: hidden;
}

.prompt-container.prompt-template-source-only .prompt-content::before {
    content: none;
}

.prompt-container.prompt-template-source-only .prompt-footer {
    margin-top: 0;
}

.prompt-container.prompt-template-source-only .prompt-source-ritual {
    max-width: calc(100% - 48px);
}

.prompt-container.prompt-template-source-only .prompt-collapse-toggle {
    display: none;
}

/* Additional styles to ensure visibility and positioning */
.modal-body .prompt-container {
    margin-top: 18px;
    margin-bottom: 20px;
    position: relative;
    z-index: 20;
}

.prompt-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    margin-left: auto;
    min-width: 0;
}

.prompt-collapse-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.86);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    max-width: min(46vw, 220px);
    overflow: hidden;
    padding: 7px 10px;
    text-overflow: ellipsis;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}

.prompt-collapse-toggle:hover,
.prompt-collapse-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    outline: none;
}

.saved-inspiration-composer {
    border: 1px solid var(--input-border, rgba(0, 0, 0, 0.12));
    border-radius: 12px;
    padding: 0.9rem;
    margin-bottom: 1rem;
    background: color-mix(in srgb, var(--input-bg, #fff) 82%, var(--button-bg, #8B5CF6) 5%);
}

.saved-inspiration-header {
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.saved-inspiration-title {
    color: var(--text-color, #333);
    font-size: 0.95rem;
    font-weight: 760;
    line-height: 1.25;
}

.saved-inspiration-count {
    color: var(--text-color, #333);
    font-size: 0.76rem;
    font-weight: 700;
    opacity: 0.48;
    margin-top: 0.1rem;
}

.saved-inspiration-add-toggle {
    border: 1px solid var(--input-border, rgba(0, 0, 0, 0.12));
    border-radius: 999px;
    background: var(--input-bg, rgba(255, 255, 255, 0.72));
    color: var(--button-bg, #8B5CF6);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    font-size: 0.82rem;
    font-weight: 750;
    padding: 0.48rem 0.72rem;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.saved-inspiration-add-toggle:hover,
.saved-inspiration-add-toggle:focus-visible {
    background: color-mix(in srgb, var(--button-bg, #8B5CF6) 8%, transparent);
    border-color: color-mix(in srgb, var(--button-bg, #8B5CF6) 24%, transparent);
    transform: translateY(-1px);
    outline: none;
}

.saved-inspiration-composer-compact {
    padding: 0.75rem;
    margin-bottom: 0.85rem;
}

.saved-inspiration-composer-compact .saved-inspiration-composer-hint {
    display: none;
}

.saved-inspiration-composer-header {
    margin-bottom: 0.7rem;
}

.saved-inspiration-composer-title {
    color: var(--text-color, #333);
    font-size: 0.92rem;
    font-weight: 750;
    margin-bottom: 0.18rem;
}

.saved-inspiration-composer-hint {
    color: var(--text-color, #333);
    font-size: 0.78rem;
    line-height: 1.4;
    opacity: 0.62;
    margin: 0;
}

.saved-inspiration-textarea {
    width: 100%;
    min-height: 78px;
    resize: vertical;
    margin-bottom: 0.7rem;
}

.saved-inspiration-composer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.saved-inspiration-secondary-btn {
    border: 1px solid var(--input-border, rgba(0, 0, 0, 0.12));
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    background: transparent;
    color: var(--text-color, #333);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 650;
}

.saved-inspiration-save-btn {
    margin: 0;
    min-width: 140px;
}

.saved-inspiration-secondary-btn:disabled,
.saved-inspiration-save-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.saved-inspiration-list-title {
    margin-bottom: 0.65rem;
}

.saved-inspiration-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: calc(80vh - 250px);
    overflow-y: auto;
    padding-right: 0.15rem;
    margin-bottom: 1rem;
}

.saved-inspiration-card {
    border: 1px solid var(--input-border, rgba(0, 0, 0, 0.12));
    border-radius: 10px;
    padding: 0.78rem;
    background: var(--input-bg, rgba(255, 255, 255, 0.72));
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.saved-inspiration-card:hover {
    border-color: color-mix(in srgb, var(--button-bg, #8B5CF6) 24%, transparent);
    background: color-mix(in srgb, var(--input-bg, #fff) 90%, var(--button-bg, #8B5CF6) 6%);
}

.saved-inspiration-card-main {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.saved-inspiration-card-text {
    color: var(--text-color, #333);
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.42;
    margin: 0;
    white-space: pre-wrap;
}

.saved-inspiration-options-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-color, #333);
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.58;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
    transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.saved-inspiration-options-btn:hover,
.saved-inspiration-options-btn:focus-visible,
.saved-inspiration-card.is-actions-open .saved-inspiration-options-btn {
    opacity: 1;
    background: color-mix(in srgb, var(--button-bg, #8B5CF6) 8%, transparent);
    outline: none;
}

.saved-inspiration-options-btn:hover,
.saved-inspiration-options-btn:focus-visible {
    transform: scale(1.1);
}

.saved-inspiration-options-btn:active {
    transform: scale(0.95);
}

.saved-inspiration-options-btn span,
.library-prompt-options-btn span {
    font-size: 14px;
    line-height: 1;
}

.saved-inspiration-row-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.72rem;
}

.saved-inspiration-row-actions[hidden] {
    display: none;
}

.saved-inspiration-row-btn {
    border: 1px solid var(--input-border, rgba(0, 0, 0, 0.12));
    border-radius: 999px;
    background: transparent;
    color: var(--text-color, #333);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.4rem 0.68rem;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.saved-inspiration-row-btn:hover,
.saved-inspiration-row-btn:focus-visible {
    background: color-mix(in srgb, var(--button-bg, #8B5CF6) 8%, transparent);
    border-color: color-mix(in srgb, var(--button-bg, #8B5CF6) 24%, transparent);
    transform: translateY(-1px);
    outline: none;
}

.saved-inspiration-row-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.saved-inspiration-row-btn-primary {
    background: var(--button-bg, #8B5CF6);
    border-color: var(--button-bg, #8B5CF6);
    color: #fff;
}

.saved-inspiration-row-btn-primary:hover,
.saved-inspiration-row-btn-primary:focus-visible {
    background: var(--button-hover-bg, var(--button-bg, #8B5CF6));
    color: #fff;
}

.saved-inspiration-row-btn-danger {
    color: #b45353;
}

.saved-inspiration-edit-textarea {
    width: 100%;
    min-height: 104px;
    resize: vertical;
    margin-bottom: 0.65rem;
    white-space: pre-wrap;
}

.saved-inspiration-edit-actions {
    justify-content: flex-end;
}

.rituals-intro {
    border: 1px solid color-mix(in srgb, var(--button-bg, #8B5CF6) 16%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--input-bg, #fff) 92%, var(--button-bg, #8B5CF6) 5%);
    color: var(--text-color, #333);
    font-size: 0.86rem;
    line-height: 1.45;
    margin-bottom: 0.9rem;
    padding: 0.78rem 0.86rem;
}

.rituals-empty-card {
    border: 1px solid var(--input-border, rgba(0, 0, 0, 0.12));
    border-radius: 12px;
    background: var(--input-bg, rgba(255, 255, 255, 0.72));
    color: var(--text-color, #333);
    font-size: 0.9rem;
    line-height: 1.45;
    opacity: 0.72;
    padding: 0.9rem;
}

.library-prompt-card {
    background: var(--input-bg, rgba(255, 255, 255, 0.72));
    border: 1px solid var(--input-border, rgba(0, 0, 0, 0.12));
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.library-prompt-card:hover,
.library-prompt-card.is-actions-open {
    background: color-mix(in srgb, var(--input-bg, #fff) 90%, var(--button-bg, #8B5CF6) 6%);
    border-color: color-mix(in srgb, var(--button-bg, #8B5CF6) 24%, transparent);
}

.library-prompt-card:hover {
    transform: translateY(-1px);
}

.library-prompt-card-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.library-prompt-image {
    border-radius: 8px;
    flex-shrink: 0;
    height: 60px;
    object-fit: cover;
    width: 60px;
}

.library-prompt-card-copy {
    flex: 1;
    min-width: 0;
}

.library-prompt-title {
    color: var(--text-color, #333);
    font-size: 0.9rem;
    font-weight: 650;
    margin: 0 0 0.25rem;
}

.library-prompt-description {
    color: var(--text-color, #333);
    font-size: 0.85rem;
    line-height: 1.38;
    margin: 0;
    opacity: 0.7;
}

.library-prompt-options-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--text-color, #333);
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.58;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
    transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.library-prompt-options-btn:hover,
.library-prompt-options-btn:focus-visible,
.library-prompt-card.is-actions-open .library-prompt-options-btn {
    opacity: 1;
    background: color-mix(in srgb, var(--button-bg, #8B5CF6) 8%, transparent);
    outline: none;
}

.library-prompt-options-btn:hover,
.library-prompt-options-btn:focus-visible {
    transform: scale(1.1);
}

.library-prompt-options-btn:active {
    transform: scale(0.95);
}

.library-prompt-row-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.library-prompt-row-actions[hidden] {
    display: none;
}

.library-prompt-row-btn {
    border: 1px solid var(--input-border, rgba(0, 0, 0, 0.12));
    border-radius: 999px;
    background: transparent;
    color: var(--text-color, #333);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.4rem 0.68rem;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.library-prompt-row-btn:hover,
.library-prompt-row-btn:focus-visible {
    background: color-mix(in srgb, var(--button-bg, #8B5CF6) 8%, transparent);
    border-color: color-mix(in srgb, var(--button-bg, #8B5CF6) 24%, transparent);
    transform: translateY(-1px);
    outline: none;
}

.library-prompt-row-btn.is-saved,
.library-prompt-row-btn:disabled {
    background: color-mix(in srgb, var(--button-bg, #8B5CF6) 8%, transparent);
    border-color: color-mix(in srgb, var(--button-bg, #8B5CF6) 24%, transparent);
    color: var(--button-bg, #8B5CF6);
    cursor: default;
    opacity: 1;
    transform: none;
}

.journal-tile .library-prompt-options-btn {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    z-index: 5;
    background: transparent;
    opacity: 0.72;
}

.recent-prompt-card .library-prompt-options-btn {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    z-index: 5;
    background: transparent;
    opacity: 0.72;
}

.journal-tile:hover .library-prompt-options-btn,
.journal-tile.is-actions-open .library-prompt-options-btn,
.recent-prompt-card:hover .library-prompt-options-btn,
.recent-prompt-card.is-actions-open .library-prompt-options-btn,
.journal-tile .library-prompt-options-btn:focus-visible,
.recent-prompt-card .library-prompt-options-btn:focus-visible {
    opacity: 1;
}

.prompt-card-with-menu {
    cursor: pointer;
}

.recent-prompt-card {
    padding: 2.55rem 1.2rem 1.15rem !important;
}

.recent-prompt-card .recent-prompt-text {
    margin: 0;
}

.library-prompt-card-action-menu {
    position: absolute;
    right: 0.5rem;
    top: 2.7rem;
    z-index: 6;
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: min(220px, calc(100% - 1rem));
    padding: 0.5rem;
    border: 1px solid var(--input-border, rgba(0, 0, 0, 0.12));
    border-radius: 12px;
    background: var(--input-bg, rgba(255, 255, 255, 0.92));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.library-prompt-card-action-menu[hidden] {
    display: none;
}

.prompt-card-action-menu {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    min-width: 168px;
}

.prompt-card-action-menu .library-prompt-row-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9px;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
}

.prompt-card-action-menu .library-prompt-row-btn svg {
    flex-shrink: 0;
}

.prompt-history-empty-state {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.prompt-history-empty-card {
    width: min(420px, 100%);
    border: 1px dashed var(--input-border, rgba(139, 92, 246, 0.28));
    border-radius: 16px;
    background: color-mix(in srgb, var(--input-bg, rgba(255, 255, 255, 0.72)) 88%, var(--button-bg, #8B5CF6) 5%);
    color: var(--text-color, #333);
    padding: 1.5rem;
    text-align: center;
}

.prompt-history-empty-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 0.85rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--button-bg, #8B5CF6) 12%, transparent);
    color: var(--button-bg, #8B5CF6);
}

.prompt-history-empty-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.45rem;
}

.prompt-history-empty-body {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.72;
}

.prompt-history-empty-use-btn {
    margin: 1rem auto 0;
    min-height: 40px;
    padding: 0 1.05rem;
    border: none;
    border-radius: 10px;
    background: var(--button-bg, #8B5CF6);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--button-bg, #8B5CF6) 22%, transparent);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.prompt-history-empty-use-btn:hover,
.prompt-history-empty-use-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px color-mix(in srgb, var(--button-bg, #8B5CF6) 28%, transparent);
    outline: none;
}

.prompt-history-empty-use-btn:active {
    transform: translateY(0);
}

.prompt-history-empty-use-btn svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
}

.filtered-history-modal {
    width: min(920px, calc(100vw - 32px));
    height: min(86vh, 840px);
    max-height: calc(100vh - 32px);
    overflow: hidden;
}

.filtered-history-modal-header {
    flex: 0 0 auto;
    padding: 1.75rem 4.5rem 1.6rem;
    position: relative;
}

.filtered-history-modal .filtered-history-modal-header,
.filtered-history-modal .filtered-history-modal-content,
.filtered-history-modal .filtered-history-modal-loading {
    background: inherit !important;
    background-color: transparent !important;
}

.filtered-history-modal-title {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    text-align: center;
}

.filtered-history-modal-close {
    border: 0;
    border-radius: 10px;
    height: 38px;
    padding: 0;
    position: absolute;
    right: 1.55rem;
    top: 1.45rem;
    width: 38px;
    z-index: 2;
}

.filtered-history-modal-close:hover,
.filtered-history-modal-close:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.filtered-history-modal-prompt-wrap {
    display: flex;
    justify-content: center;
    margin-top: 0.85rem;
    width: 100%;
}

.filtered-history-modal-prompt-wrap .timeline-prompt-component {
    align-items: center;
    box-sizing: border-box;
    cursor: default;
    display: flex !important;
    margin: 0;
    max-width: 100%;
    min-height: 50px;
    padding: 0.78rem 1rem !important;
    width: 100%;
}

.filtered-history-modal-prompt-wrap .timeline-prompt-component:hover {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transform: none;
}

.filtered-history-modal-prompt-wrap .timeline-prompt-component::before {
    content: none;
}

.filtered-history-modal-prompt-wrap .timeline-prompt-component .prompt-content {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 !important;
    overflow-wrap: anywhere;
    padding-left: 0 !important;
    text-align: left;
}

.filtered-history-modal-prompt-wrap .timeline-prompt-component--with-source {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 0.45rem;
}

.filtered-history-modal-prompt-wrap .timeline-prompt-source,
.filtered-history-modal-prompt-wrap .prompt-source-ritual {
    max-width: 100%;
}

.filtered-history-modal-prompt-wrap .prompt-source-ritual-name {
    white-space: normal;
}

.filtered-history-filter-chip {
    padding: 0.45rem 0.85rem;
}

.filtered-history-modal-loading,
.filtered-history-modal-content {
    min-height: 0;
}

.filtered-history-modal-content {
    padding: 1.5rem 2rem;
}

@media (max-width: 768px) {
    .filtered-history-modal {
        height: min(88vh, calc(100vh - 24px));
        width: calc(100vw - 24px);
    }

    .filtered-history-modal-header {
        padding: 1.35rem 3.5rem 1.25rem 1.35rem;
    }

    .filtered-history-modal-title {
        font-size: 1.2rem;
    }

    .filtered-history-modal-close {
        right: 1rem;
        top: 1rem;
    }

    .filtered-history-modal-content {
        padding: 1rem;
    }
}

/* Removed .prompt-use-button styles as it's no longer needed */

/* Light theme adjustments */
@media (prefers-color-scheme: light) {
    .prompt-container {
        background: linear-gradient(135deg, #9333ea15, #8b5cf625);
        box-shadow: 0 4px 6px rgba(139, 92, 246, 0.15);
        border-left: 4px solid #8b5cf6;
    }
    
    .prompt-content {
        color: #4b0082;
        text-shadow: none;
    }
    
    .prompt-content::before {
        color: rgba(75, 0, 130, 0.2);
    }
    
    .prompt-footer {
        color: #6b7280;
    }
    
    .prompt-dismiss {
        background: rgba(75, 0, 130, 0.05);
        border: 1px solid rgba(75, 0, 130, 0.1);
        color: #6b7280;
    }
    
    .prompt-dismiss:hover {
        background: rgba(75, 0, 130, 0.1);
        color: #4b0082;
    }
    
    .prompt-use-button {
        background: rgba(75, 0, 130, 0.05);
        border: 1px solid rgba(75, 0, 130, 0.1);
        color: #6b7280;
    }
    
    .prompt-use-button:hover {
        background: rgba(75, 0, 130, 0.1);
        color: #4b0082;
    }
}

/* Theme-specific styles */
/* Dark theme (Day One Dark) */
.dark-theme .prompt-container,
body.dark .prompt-container {
    background: linear-gradient(135deg, #9333ea33, #8b5cf644);
    border-left: 4px solid #8b5cf6;
}

.dark-theme .prompt-content,
body.dark .prompt-content {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dark-theme .prompt-content::before,
body.dark .prompt-content::before {
    color: rgba(255, 255, 255, 0.4);
}

.dark-theme .prompt-footer,
body.dark .prompt-footer {
    color: rgba(255, 255, 255, 0.7);
}

.dark-theme .prompt-dismiss,
body.dark .prompt-dismiss {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.dark-theme .prompt-dismiss:hover,
body.dark .prompt-dismiss:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Removed dark theme .prompt-use-button styles as it's no longer needed */

/* Light theme */
.light-theme .prompt-container,
body.light .prompt-container {
    background: linear-gradient(135deg, #9333ea15, #8b5cf625);
    box-shadow: 0 4px 6px rgba(139, 92, 246, 0.15);
    border-left: 4px solid #8b5cf6;
}

.light-theme .prompt-content,
body.light .prompt-content {
    color: #4b0082;
    text-shadow: none;
}

.light-theme .prompt-content::before,
body.light .prompt-content::before {
    color: rgba(75, 0, 130, 0.2);
}

.light-theme .prompt-footer,
body.light .prompt-footer {
    color: #6b7280;
}

.light-theme .prompt-dismiss,
body.light .prompt-dismiss {
    background: rgba(75, 0, 130, 0.05);
    border: 1px solid rgba(75, 0, 130, 0.1);
    color: #6b7280;
}

.light-theme .prompt-dismiss:hover,
body.light .prompt-dismiss:hover {
    background: rgba(75, 0, 130, 0.1);
    color: #4b0082;
}

/* Removed light theme .prompt-use-button styles as it's no longer needed */

/* Zen theme - using light theme colors */
.zen-theme .prompt-container,
body.zen .prompt-container {
    background: linear-gradient(135deg, #9333ea15, #8b5cf625);
    box-shadow: 0 4px 6px rgba(139, 92, 246, 0.15);
    border-left: 4px solid #8b5cf6;
}

.zen-theme .prompt-content,
body.zen .prompt-content {
    color: #4b0082;
    text-shadow: none;
}

.zen-theme .prompt-content::before,
body.zen .prompt-content::before {
    color: rgba(75, 0, 130, 0.2);
}

.zen-theme .prompt-footer,
body.zen .prompt-footer {
    color: #6b7280;
}

.zen-theme .prompt-dismiss,
body.zen .prompt-dismiss {
    background: rgba(75, 0, 130, 0.05);
    border: 1px solid rgba(75, 0, 130, 0.1);
    color: #6b7280;
}

.zen-theme .prompt-dismiss:hover,
body.zen .prompt-dismiss:hover {
    background: rgba(75, 0, 130, 0.1);
    color: #4b0082;
}

/* Removed zen theme .prompt-use-button styles as it's no longer needed */

/* Zen Garden theme - using light theme colors */
.zenGarden-theme .prompt-container,
body.zenGarden .prompt-container {
    background: linear-gradient(135deg, #9333ea15, #8b5cf625);
    box-shadow: 0 4px 6px rgba(139, 92, 246, 0.15);
    border-left: 4px solid #8b5cf6;
}

.zenGarden-theme .prompt-content,
body.zenGarden .prompt-content {
    color: #4b0082;
    text-shadow: none;
}

.zenGarden-theme .prompt-content::before,
body.zenGarden .prompt-content::before {
    color: rgba(75, 0, 130, 0.2);
}

.zenGarden-theme .prompt-footer,
body.zenGarden .prompt-footer {
    color: #6b7280;
}

.zenGarden-theme .prompt-dismiss,
body.zenGarden .prompt-dismiss {
    background: rgba(75, 0, 130, 0.05);
    border: 1px solid rgba(75, 0, 130, 0.1);
    color: #6b7280;
}

.zenGarden-theme .prompt-dismiss:hover,
body.zenGarden .prompt-dismiss:hover {
    background: rgba(75, 0, 130, 0.1);
    color: #4b0082;
}

/* Removed zenGarden theme .prompt-use-button styles as it's no longer needed */

/* Responsive adjustments */
@media (max-width: 640px) {
    .prompt-container {
        padding: 12px 12px 12px 16px;
    }
    
    .prompt-content {
        font-size: 1.1rem;
        padding-left: 20px;
    }

    .prompt-container.prompt-is-collapsible.prompt-collapsed .prompt-content {
        -webkit-line-clamp: 4;
        max-height: 7em;
    }

    .prompt-content::before {
        font-size: 2rem;
    }
    
    .prompt-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .prompt-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .prompt-source-ritual {
        max-width: 100%;
    }

    .prompt-collapse-toggle {
        max-width: calc(100% - 44px);
    }
}

/* Fix for top right not being blocked */
.modal-header {
    z-index: 20;
    position: relative;
}

/* Prompt Loading Animation */
.prompt-loading-container {
    background: linear-gradient(135deg, #9333ea15, #8b5cf625);
    border-left: 4px solid #8b5cf6;
    border-radius: 8px;
    margin: 18px 0 20px 0;
    padding: 16px;
    position: relative;
    box-shadow: 0 4px 6px rgba(139, 92, 246, 0.15);
    z-index: 20;
    width: calc(100% - 10px);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    animation: prompt-fade-in 0.5s ease-out;
}

.prompt-loading-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: #4b0082;
}

.prompt-loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    border-top-color: #8b5cf6;
    animation: prompt-spin 1s ease-in-out infinite;
}

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

/* Dark theme styles for loading */
body.dark .prompt-loading-container {
    background: linear-gradient(135deg, #9333ea33, #8b5cf644);
}

body.dark .prompt-loading-text {
    color: white;
}

body.dark .prompt-loading-spinner {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: white;
}

/* Timeline prompt component styles */
.timeline-prompt-component {
    background: linear-gradient(135deg, #9333ea08, #8b5cf615);
    border-left: 2px solid #8b5cf6;
    border-radius: 6px;
    margin-bottom: 0;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    width: 99.5%; /* Make it as wide as the bubble */
    max-width: 99.5%;
    display: block; /* Change to block for full width */
    position: relative;
    padding-left: 24px; /* Increase padding for bigger icon */
    box-sizing: border-box; /* Ensure padding is included in width */
    cursor: pointer; /* Indicate it's clickable */
}

/* Hover effect to indicate clickability */
.timeline-prompt-component:hover {
    background: linear-gradient(135deg, #9333ea15, #8b5cf625);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.timeline-prompt-component .prompt-icon {
    font-size: 1rem;
    color: #8b5cf6;
}

.timeline-prompt-component .prompt-content {
    color: inherit;
    font-size: 0.95rem; /* Bigger text */
    padding-left: 0;
    margin-bottom: 0;
    text-shadow: none;
    font-style: italic;
    line-height: 1.4;
}

/* Add a subtle prompt icon */
.timeline-prompt-component::before {
    content: '💬';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem; /* Bigger icon */
}

.timeline-prompt-component .prompt-content::before {
    content: none;
}

#promptContainer .historical-prompt-component {
    cursor: default;
    margin: 0 0 0.75rem;
    max-width: 100%;
    width: 100%;
}

#promptContainer .historical-prompt-component:hover {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transform: none;
}

#promptContainer .historical-prompt-component.timeline-prompt-component--with-source {
    display: flex !important;
}

#promptContainer .historical-prompt-component .timeline-prompt-source {
    max-width: 100%;
}

#promptContainer .historical-prompt-component .prompt-source-ritual-name {
    white-space: normal;
}

.timeline-prompt-component--with-source {
    display: inline-flex !important;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.4rem;
    white-space: normal;
}

.timeline-prompt-component--with-source::before {
    content: none;
}

.timeline-prompt-component--with-source .timeline-prompt-source {
    margin: 0;
    max-width: 100%;
}

.timeline-prompt-component--with-source .prompt-content {
    margin-left: 0 !important;
    padding-left: 0;
}

.timeline-prompt-component--entry-source {
    width: auto;
    max-width: 100%;
    margin: 0 0 0.45rem;
    padding: 0.45rem 0.65rem 0.45rem 1.8rem;
    font-size: 0.82rem;
    opacity: 0.86;
}

.timeline-prompt-component--entry-source::before {
    left: 0.55rem;
    font-size: 0.82rem;
}

.timeline-prompt-component--entry-source .prompt-content {
    font-size: 0.82rem;
    line-height: 1.35;
}

/* Dark mode timeline prompt */
body.dark .timeline-prompt-component {
    background: linear-gradient(135deg, #9333ea22, #8b5cf633);
    color: #e2e8f0;
    border-color: #8b5cf6;
}

/* Light mode timeline prompt */
body.light .timeline-prompt-component {
    background: linear-gradient(135deg, #9333ea10, #8b5cf620);
    color: #4a5568;
    border-color: #8b5cf6;
}

/* Zen mode timeline prompt - same as light */
body.zen .timeline-prompt-component {
    background: linear-gradient(135deg, #9333ea10, #8b5cf620);
    color: #4a5568;
    border-color: #8b5cf6;
}

/* Zen Garden mode timeline prompt - adjusted to match zen garden theme */
body.zen-garden .timeline-prompt-component {
    background: linear-gradient(135deg, #f3f4f610, #e5e7eb20);
    color: #4b5563;
    border-color: #9ca3af;
    border-left: 2px solid #9ca3af;
}

/* Timeline prompt container positioning */
.timeline-prompt-container {
    position: relative;
    margin-top: 5px;
    margin-bottom: 8px;
    margin-left: 36px; /* Align with the avatar */
    width: 100%;
    max-width: calc(100% - 36px); /* Account for the left margin */
    box-sizing: border-box;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timeline-prompt-container {
        margin-left: 30px;
        max-width: calc(100% - 30px);
    }
    
    .timeline-prompt-component {
        padding-left: 20px;
    }
    
    .timeline-prompt-component::before {
        left: 6px;
        font-size: 1rem;
    }
    
    .timeline-prompt-component .prompt-content {
        font-size: 0.9rem;
        margin-left: 4px;
    }
}

@media (max-width: 480px) {
    .timeline-prompt-container {
        margin-left: 20px;
        max-width: calc(100% - 20px);
    }
    
    .timeline-prompt-component {
        padding-left: 18px;
    }
    
    .timeline-prompt-component::before {
        left: 5px;
        font-size: 0.9rem;
    }
}
