/* Journal Page Styles */

/* Journal list: minimal title strip (entries page) */
.journal-page-toolbar {
    margin-bottom: 1.25rem;
    padding: 2rem;
    border-bottom: 1px solid rgba(45, 55, 72, 0.12);
}

.journal-page-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.journal-page-toolbar__titles {
    flex: 1 1 220px;
    min-width: 0;
    text-align: left;
}

.journal-page-toolbar__title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin-bottom: 0.35rem;
}

.journal-page-toolbar__title-line .journal-page-toolbar__title {
    margin-bottom: 0;
}

.journal-page-toolbar__title {
    color: #2d3748;
    font-weight: 700;
    font-size: 1.75rem;
    margin: 0 0 0.25rem 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.journal-page-toolbar__title i {
    color: #8b9d83;
    margin-right: 0.5rem;
    font-size: 1.75rem;
}

.journal-page-toolbar__subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: #64748b;
}

.journal-page-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex: 0 1 auto;
}

.journal-page-toolbar .journal-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25;
    padding: 0.45rem 0.875rem;
    border-radius: 0.375rem;
    box-shadow: none;
    text-shadow: none;
    box-sizing: border-box;
    min-height: 2.375rem;
    height: auto;
    width: auto !important;
    white-space: nowrap;
}

.journal-page-toolbar .journal-toolbar-btn.btn-primary {
    background: #8b9d83;
    border-color: #8b9d83;
    color: #fff;
}

.journal-page-toolbar .journal-toolbar-btn.btn-primary:hover {
    background: #7a8b72;
    border-color: #7a8b72;
    color: #fff;
}

.journal-page-toolbar .journal-toolbar-btn.btn-outline-primary {
    color: #5a6b52;
    border-color: #8b9d83;
    background: transparent;
}

.journal-page-toolbar .journal-toolbar-btn.btn-outline-primary:hover {
    background: rgba(139, 157, 131, 0.12);
    color: #3d4a38;
    border-color: #8b9d83;
}

/* Categories: same outline rhythm as Collections, teal-slate hue (distinct from sage primary) */
.journal-page-toolbar .journal-toolbar-btn.journal-toolbar-btn--categories {
    color: #436158;
    border-color: #6b9188;
    background: transparent;
}

.journal-page-toolbar .journal-toolbar-btn.journal-toolbar-btn--categories:hover {
    background: rgba(91, 130, 120, 0.14);
    color: #2f4540;
    border-color: #5a8379;
}

.journal-page-toolbar--edit-collection .journal-toolbar-btn--primary-action {
    padding: 0.9rem 1.25rem;
    border-radius: 0.65rem;
    font-size: 1rem;
    font-weight: 700;
    min-height: 52px;
    background: #198754;
    border-color: #198754;
    color: #fff;
    box-shadow: 0 6px 16px rgba(25, 135, 84, 0.22);
}

.journal-page-toolbar--edit-collection .journal-toolbar-btn--primary-action:hover {
    background: #157347;
    border-color: #146c43;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(25, 135, 84, 0.3);
}

.journal-page-toolbar--edit-collection .journal-toolbar-btn--primary-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.journal-page-toolbar .journal-beta-note {
    margin: 0.75rem 0 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
}

.journal-page-toolbar .journal-beta-note i {
    margin-right: 0.35rem;
    opacity: 0.85;
}

/* Edit collection page: inline title/description + meta inside toolbar strip */
.journal-page-toolbar--edit-collection {
    width: 100%;
    margin: 1rem auto 1.25rem;
    padding: 0 2rem 1rem;
    box-sizing: border-box;
}

.journal-page-toolbar--edit-collection .journal-page-toolbar__titles--edit {
    flex: 1 1 280px;
    min-width: 0;
}

.journal-page-toolbar--edit-collection .title-inline {
    justify-content: flex-start;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.journal-page-toolbar--edit-collection .title-inline h1 {
    color: #2d3748;
    font-weight: 700;
    font-size: 1.75rem;
    margin: 0 0 0.25rem 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
    text-align: left;
}

.journal-page-toolbar--edit-collection #sessionNameLabel {
    font-size: 1.75rem;
}

.journal-page-toolbar--edit-collection .title-inline .title-input {
    font-size: 1.75rem;
    text-align: left;
}

.journal-page-toolbar--edit-collection .desc-inline {
    justify-content: flex-start;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.journal-page-toolbar--edit-collection .desc-inline .journal-subtitle {
    text-align: left;
}

.journal-page-toolbar--edit-collection #sessionDescriptionText.is-placeholder {
    opacity: 0.75;
    font-style: italic;
}

.journal-page-toolbar--edit-collection .desc-inline .desc-input {
    margin: 0;
    text-align: left;
    min-width: 0;
    max-width: min(100%, 600px);
}

.journal-page-toolbar--edit-collection .journal-page-toolbar__helper-note {
    margin: 0 0 0.75rem 0;
    max-width: 900px;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.45;
}

.journal-page-toolbar--edit-collection .journal-page-toolbar__helper-note i {
    margin-right: 0.35rem;
    opacity: 0.9;
}

.journal-page-toolbar--edit-collection .journal-page-toolbar__helper-note .helper-note-tip {
    display: inline;
}

.journal-page-toolbar--edit-collection .collection-meta-info {
    justify-content: flex-start;
    margin-bottom: 0;
}

.edit-collection-page .edit-collection-main-content {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 2rem;
    align-items: flex-start;
}

.edit-collection-page .workspace-content {
    padding: 0;
    max-height: none !important;
    overflow: visible !important;
}

.edit-collection-page .journal-entries {
    max-height: none !important;
    overflow: visible !important;
}

.edit-collection-page .journal-entry {
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-collection-page .journal-entry-top-row {
    justify-content: flex-end;
}

.edit-collection-page .journal-entry.dragging {
    opacity: 0.6;
}

.edit-collection-page .title-inline,
.edit-collection-page .desc-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.edit-collection-page .title-input,
.edit-collection-page .desc-input {
    border: 1px solid rgba(45, 55, 72, 0.2);
    background: #fff;
    color: #2d3748;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
}

.edit-collection-page .title-input::placeholder,
.edit-collection-page .desc-input::placeholder {
    color: #94a3b8;
}

.edit-collection-page .title-input:focus,
.edit-collection-page .desc-input:focus {
    outline: none;
    border-color: #8b9d83;
    box-shadow: 0 0 0 3px rgba(139, 157, 131, 0.15);
}

.edit-collection-page .icon-btn {
    border: none;
    background: transparent;
    padding: 0.15rem 0.25rem;
    border-radius: 4px;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.edit-collection-page .icon-btn i {
    font-size: 0.9rem;
}

.edit-collection-page .icon-white {
    color: #64748b;
}

.edit-collection-page .icon-btn:hover {
    opacity: 1;
}

.edit-collection-page .session-description-input {
    width: 100%;
    min-height: 60px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    background: #f8f9fa;
    color: #5a6c7d;
    font-style: italic;
}

.edit-collection-page .session-description-input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    color: #2c3e50;
    font-style: normal;
}

.edit-collection-page .session-description-input:read-only {
    background: #f8f9fa;
    cursor: default;
}

.edit-collection-page .session-description-input:read-only:focus {
    background: #f8f9fa;
}

.edit-collection-page .description-save-container {
    margin-top: 0.5rem;
}

/* Collection compose: align with compose grid, title + session meta */
.journal-page-toolbar--compose {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem;
    box-sizing: border-box;
}

.journal-page-toolbar--compose .compose-collection-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 1rem;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: #64748b;
}

.journal-page-toolbar--compose .compose-collection-meta .collection-name {
    font-weight: 600;
    color: #2d3748;
}

.journal-page-toolbar--compose .compose-collection-meta .collection-stats {
    opacity: 0.9;
}

@media (max-width: 576px) {
    .journal-page-toolbar__row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .journal-page-toolbar__titles {
        flex: 0 0 auto;
        text-align: center;
    }

    .journal-page-toolbar__title-line {
        justify-content: center;
    }

    .journal-page-toolbar__actions {
        justify-content: center;
        margin-top: 0;
        flex-wrap: nowrap;
        gap: 0.3rem;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Journal list: Entry + Collections stay on one row; shrink text/padding — no hyphenation */
    .journal-page-toolbar:not(.journal-page-toolbar--edit-collection):not(.journal-page-toolbar--compose) {
        padding-top: 1rem;
        padding-bottom: 1rem;
        padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
    }

    .journal-page-toolbar:not(.journal-page-toolbar--edit-collection):not(.journal-page-toolbar--compose)
        .journal-toolbar-btn {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        font-size: clamp(0.62rem, 2.4vw + 0.42rem, 0.8125rem);
        padding: clamp(0.28rem, 1.2vw, 0.4rem) clamp(0.35rem, 2vw, 0.65rem);
        min-height: auto;
        line-height: 1.15;
        letter-spacing: -0.02em;
        hyphens: none;
        -webkit-hyphens: none;
        word-break: normal;
        overflow-wrap: normal;
    }

    .journal-page-toolbar:not(.journal-page-toolbar--edit-collection):not(.journal-page-toolbar--compose)
        .journal-toolbar-btn i {
        font-size: 0.9em;
        flex-shrink: 0;
    }

    .journal-page-toolbar--edit-collection .title-inline {
        justify-content: center;
    }

    .journal-page-toolbar--edit-collection .title-inline h1 {
        text-align: center;
    }

    .journal-page-toolbar--edit-collection .title-inline .title-input {
        text-align: center;
    }

    .journal-page-toolbar--edit-collection .desc-inline {
        justify-content: center;
    }

    .journal-page-toolbar--edit-collection .desc-inline .journal-subtitle {
        text-align: center;
    }

    .journal-page-toolbar--edit-collection .journal-page-toolbar__helper-note {
        text-align: center;
    }

    .journal-page-toolbar--edit-collection .collection-meta-info {
        justify-content: center;
    }

    .journal-page-toolbar--edit-collection {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .journal-page-toolbar--compose {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .journal-page-toolbar--compose .compose-collection-meta {
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }
}

@media (max-width: 768px) {
    .edit-collection-page .edit-collection-main-content {
        padding: 0 1rem;
    }

    .edit-collection-page .icon-btn {
        display: none !important;
    }

    .edit-collection-page #sessionNameText,
    .edit-collection-page #sessionDescriptionText {
        cursor: pointer;
        position: relative;
        padding: 0.3rem 0.5rem;
        border-radius: 6px;
        transition: background 0.1s ease;
        user-select: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
        pointer-events: auto;
        z-index: 10;
    }

    .edit-collection-page #sessionDescriptionText {
        display: inline-block;
        min-width: 150px;
    }

    .edit-collection-page #sessionNameText:active,
    .edit-collection-page #sessionDescriptionText:active {
        background: rgba(255, 255, 255, 0.25) !important;
        transform: scale(0.98);
    }

    .edit-collection-page #sessionNameText::after,
    .edit-collection-page #sessionDescriptionText::after {
        content: '\270E';
        margin-left: 0.5rem;
        opacity: 0.7;
        font-size: 0.9em;
        pointer-events: none;
    }

    .edit-collection-page #sessionDescriptionText:empty::before {
        content: 'Tap to add description...';
        opacity: 0.7;
        font-style: italic;
        pointer-events: none;
    }
}

/* Header (collection edit & other pages using journal-header) */
.journal-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    background: linear-gradient(135deg, #f5f5f0 0%, #e8e8e0 100%);
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Quick Actions */
.quick-actions {
    margin: 1.5rem 0;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.quick-actions .btn {
    width: 250px !important;
    height: 80px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: fit-content;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border: none !important;
    position: relative;
    font-weight: 700;
    font-size: 1.4rem;
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.quick-actions .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    pointer-events: none;
}

.quick-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    color: #ffffff !important;
}

.quick-actions .btn i {
    font-size: 1.5rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.8);
    color: #ffffff !important;
}

/* Individual button backgrounds */
.quick-actions button[onclick="createCustomJournalEntry()"] {
    background-image: url('/static/images/Buttons/New_Journal_Entry.png') !important;
}

.quick-actions button[onclick*="showCreateCollectionModal"] {
    background-image: url('/static/images/Buttons/New_Collection.png') !important;
}

.quick-actions a[href*="collection"] {
    background-image: url('/static/images/Buttons/My_Collections.png') !important;
}

.quick-actions a[href*="journal"] {
    background-image: url('/static/images/Buttons/My_Journal.png') !important;
}

.quick-actions a[href*="home"] {
    background-image: url('/static/images/Buttons/Go_Study.png') !important;
}

.quick-actions button,
.quick-actions a {
    width: 250px !important;
    height: 80px !important;
    display: inline-flex !important;
}

/* Inline Edit Styles for Collection Edit Page */
.title-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.title-inline h1 {
    margin: 0;
    color: #2d3748;
    font-weight: 700;
    font-size: 2rem;
}

.title-inline .title-input {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    border: 2px solid #8b9d83;
    border-radius: 0.5rem;
    padding: 0.5rem;
    text-align: center;
    min-width: 300px;
}

.desc-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    clear: both;
    margin-bottom: 1rem;
}

.desc-inline .journal-subtitle {
    margin: 0;
}

.desc-inline .icon-btn {
    flex-shrink: 0;
}

.desc-inline .desc-input {
    display: block;
    font-size: 1.1rem;
    color: #64748b;
    border: 2px solid #8b9d83;
    border-radius: 0.5rem;
    padding: 0.5rem;
    text-align: center;
    min-width: 400px;
    max-width: 600px;
    margin: 0 auto;
    resize: vertical;
}

.icon-btn {
    background: transparent;
    border: 1px solid #cbd5e0;
    color: #64748b;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.icon-btn:hover {
    background: #f7fafc;
    border-color: #8b9d83;
    color: #8b9d83;
}

.collection-meta-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #64748b;
}

.collection-meta-info .session-created,
.collection-meta-info .entry-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.journal-header h1 {
    color: #2d3748;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.journal-header h1 i {
    color: #8b9d83;
    margin-right: 1rem;
}

.journal-subtitle {
    color: #64748b;
    font-size: 1.1rem;
    margin: 0;
}

/* Collection System Tools */
.collection-tools-section {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.collection-tools-header {
    text-align: center;
    margin-bottom: 2rem;
}

.collection-tools-header h3 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.collection-tools-header h3 i {
    color: #8b9d83;
    margin-right: 0.5rem;
}

.hopper-tools-subtitle {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

.collection-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.collection-tool-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.collection-tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #8b9d83;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.collection-tool-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8b9d83 0%, #6b7c5a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.collection-tool-icon i {
    color: white;
    font-size: 1.5rem;
}

.collection-tool-content h4 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.collection-tool-content p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* Responsive adjustments for Collection tools */
@media (max-width: 768px) {
    /* Quick Actions Mobile */
    .quick-actions {
        flex-direction: column !important;
        flex-wrap: wrap !important;
    }
    
    .quick-actions .btn,
    .quick-actions button,
    .quick-actions a {
        width: 280px !important;
        height: 90px !important;
        max-width: 90%;
        font-size: 1.95rem !important;
    }
    
    .quick-actions .btn i,
    .quick-actions button i,
    .quick-actions a i {
        font-size: 2.1rem !important;
    }
    
    /* Inline Edit Mobile */
    .title-inline {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .title-inline h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .title-inline .title-input {
        min-width: 100%;
        max-width: 100%;
    }
    
    .desc-inline {
        flex-direction: column;
        padding: 0 1rem;
        gap: 0.5rem;
    }
    
    .desc-inline .desc-input {
        min-width: 100%;
        max-width: 100%;
    }
    
    .collection-meta-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .collection-tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .collection-tool-card {
        padding: 1rem;
    }
    
    .collection-tool-icon {
        width: 50px;
        height: 50px;
        margin-right: 0.75rem;
    }
    
    .collection-tool-icon i {
        font-size: 1.25rem;
    }
}

/* Filters */
.journal-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.journal-filters .form-control {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.journal-filters .form-control:focus {
    border-color: #8b9d83;
    box-shadow: 0 0 0 3px rgba(139, 157, 131, 0.1);
    outline: none;
}

.journal-filters .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.journal-filters .btn-primary {
    background: #8b9d83;
    border-color: #8b9d83;
    color: white;
}

.journal-filters .btn-primary:hover {
    background: #7a8b72;
    border-color: #7a8b72;
    transform: translateY(-1px);
}

.journal-filters .btn-secondary {
    /* Uses tradition-specific styling from traditions.css */
}

.journal-stats {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-weight: 500;
    color: #64748b;
    margin-top: 0.75rem;
}

.journal-stats span {
    color: #8b9d83;
    font-weight: 600;
}

/* Mobile Search accordion: collapses filter row; desktop keeps panel open via JS open attr */
.journal-filters-search-accordion {
    border: 0;
    margin: 0;
    padding: 0;
}

.journal-filters-search-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 0;
    margin: 0;
    display: none;
}

.journal-filters-search-summary::-webkit-details-marker {
    display: none;
}

.journal-filters-search-summary__label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #475569;
}

.journal-filters-search-panel .row {
    margin-left: 0;
    margin-right: 0;
}

@media (min-width: 768px) {
    .journal-filters-search-summary {
        display: none;
    }

    .journal-filters-search-panel {
        padding-top: 0;
    }
}

@media (max-width: 767.98px) {
    .journal-filters-search-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 44px;
        padding: 0.65rem 0.85rem;
        margin: -0.25rem -0.35rem 0.75rem;
        border-radius: 0.5rem;
        border: 1px solid #e2e8f0;
        background: #f8fafc;
    }

    .journal-filters-search-summary::after {
        content: '';
        width: 0.5rem;
        height: 0.5rem;
        margin-left: auto;
        border-right: 2px solid #64748b;
        border-bottom: 2px solid #64748b;
        transform: rotate(45deg);
        transition: transform 0.2s ease;
        flex-shrink: 0;
    }

    .journal-filters-search-accordion[open] .journal-filters-search-summary::after {
        transform: rotate(225deg);
        margin-top: 0.2rem;
    }

    .journal-filters-search-panel {
        padding-top: 0.25rem;
    }
}

/* Journal Entries */
.journal-entries {
    min-height: 400px;
}

.journal-entry {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
}

.journal-entry:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.journal-entry-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.journal-entry-main-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.journal-entry-speaker-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 100px;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.journal-entry-speaker-section:hover {
    background: rgba(139, 157, 131, 0.1);
    transform: translateY(-2px);
}

.journal-speaker-coin-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(139, 157, 131, 0.3);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.journal-speaker-coin-large:hover {
    border-color: #8b9d83;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(139, 157, 131, 0.3);
    transition: all 0.3s ease;
}

.speaker-coin-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.speaker-coin-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b9d83;
    font-size: 2.5rem;
}

.journal-speaker-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    text-align: center;
    line-height: 1.2;
    max-width: 100px;
    word-wrap: break-word;
}

.journal-entry-title-section {
    flex: 1;
    display: flex;
    align-items: flex-start;
    padding-top: 0.5rem;
}

.journal-entry-title {
    color: #2d3748;
    font-weight: 600;
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.4;
    flex: 1;
}

.journal-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.journal-entry-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.journal-entry-meta i {
    color: #8b9d83;
}

/* Make meta elements clickable */
.journal-entry-speaker,
.journal-entry-category,
.journal-entry-date {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    margin: -0.25rem -0.5rem;
}

.journal-entry-speaker:hover,
.journal-entry-category:hover,
.journal-entry-date:hover {
    background: rgba(139, 157, 131, 0.1);
    color: #8b9d83;
    transform: translateY(-1px);
}

/* Collection membership replaces the full journal-copy preview on each card. */
.journal-entry-collection-list {
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(139, 157, 131, 0.25);
    border-radius: 0.5rem;
    background: rgba(139, 157, 131, 0.07);
}

.journal-entry-collection-heading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
    color: #556b2f;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.journal-entry-collection-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.journal-entry-collection-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.3rem 0.65rem;
    border: 1px solid rgba(139, 157, 131, 0.35);
    border-radius: 1rem;
    background: #fff;
    color: #2d3748;
    font-size: 0.78rem;
    line-height: 1.25;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: all 0.2s ease;
}

.journal-entry-collection-link:hover {
    background: #8b9d83;
    border-color: #8b9d83;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.journal-entry-collection-status {
    color: #64748b;
    font-size: 0.78rem;
    font-style: italic;
}

.journal-entry-collection-status--error {
    color: #9a5b5b;
}

.journal-entry-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-journal-action {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-journal-action:hover {
    background: #f9fafb;
    border-color: #8b9d83;
    color: #8b9d83;
    transform: translateY(-1px);
}

.btn-journal-action.btn-danger:hover {
    background: #fee;
    border-color: #f56565;
    color: #f56565;
}

    .journal-entry-content {
        background: #f8fafc;
        border-radius: 0.5rem;
        padding: 1rem;
        margin-bottom: 1rem;
        line-height: 1.6;
        color: #374151;
        max-height: 300px;
        overflow-y: auto;
        white-space: pre-line; /* Preserve line breaks but collapse extra spaces to avoid first-line indentation */
        word-wrap: break-word;
        text-align: left; /* Ensure left-aligned blog-style text */
    }
    
    /* Ensure content doesn't overflow in grid cells */
    .journal-entry-content * {
        max-width: 100%;
        word-wrap: break-word;
    }

    /* Normalize common rich-text elements for consistent left alignment */
    .journal-entry-content p,
    .journal-entry-content h1,
    .journal-entry-content h2,
    .journal-entry-content h3,
    .journal-entry-content h4,
    .journal-entry-content h5,
    .journal-entry-content h6,
    .journal-entry-content blockquote,
    .journal-entry-content ul,
    .journal-entry-content ol,
    .journal-entry-content li {
        text-align: left;
    }

    .journal-entry-content ul,
    .journal-entry-content ol {
        padding-left: 1.25rem;
    }

.journal-entry-notes {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.journal-entry-notes strong {
    color: #92400e;
    display: block;
    margin-bottom: 0.5rem;
}

.journal-entry-notes p {
    margin: 0;
    color: #78350f;
    line-height: 1.5;
}

.journal-entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.journal-tag {
    background: rgba(139, 157, 131, 0.1);
    color: #2d3748;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(139, 157, 131, 0.3);
    cursor: pointer; /* Add cursor pointer */
    transition: all 0.2s ease; /* Add transition */
    display: inline-block;
}

.journal-tag:hover {
    background: rgba(139, 157, 131, 0.2);
    border-color: rgba(139, 157, 131, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(139, 157, 131, 0.3);
}

.journal-tag:active {
    transform: translateY(0);
}

/* Active tag filter indicator */
.active-tag-filter {
    background: #e0f2fe;
    border: 1px solid #81d4fa;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

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

.filter-label {
    color: #0277bd;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-tag {
    background: #81d4fa;
    color: #01579b;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.filter-clear {
    background: transparent;
    border: none;
    color: #0277bd;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: auto;
    transition: all 0.2s ease;
}

.filter-clear:hover {
    background: rgba(2, 119, 189, 0.1);
    color: #01579b;
}

/* Meta filter indicator (reuse tag filter styles) */
.active-meta-filter {
    background: #e0f2fe;
    border: 1px solid #81d4fa;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideDown 0.3s ease;
}

/* Loading and Empty States */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: #64748b;
    font-size: 1.1rem;
}

.loading-spinner i {
    font-size: 2rem;
    color: #8b9d83;
    margin-bottom: 1rem;
    display: block;
}

.journal-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.journal-empty .empty-icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.journal-empty h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.journal-empty p {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.journal-empty .btn {
    background: #8b9d83;
    border-color: #8b9d83;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.journal-empty .btn:hover {
    background: #7a8b72;
    border-color: #7a8b72;
    transform: translateY(-1px);
}

/* Pagination */
.journal-pagination {
    margin-top: 2rem;
}

.pagination .page-link {
    color: #8b9d83;
    border-color: #d1d5db;
    padding: 0.75rem 1rem;
}

.pagination .page-link:hover {
    background: rgba(139, 157, 131, 0.1);
    border-color: #8b9d83;
    color: #2d3748;
}

.pagination .page-item.active .page-link {
    background: #8b9d83;
    border-color: #8b9d83;
    color: white;
}

/* Responsive Grid Layouts */

/* Desktop Grid Layout (≥769px) */
@media (min-width: 769px) {
    .journal-entries {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .journal-entry {
        margin-bottom: 0; /* Remove since grid gap handles spacing */
        height: fit-content; /* Prevent stretching */
        padding: 1.25rem; /* Slightly reduced from 1.5rem */
        display: flex;
        flex-direction: column;
    }
    
    .journal-entry-title {
        font-size: 1.25rem; /* Match main title size for grid layout */
    }
    
    .journal-entry-meta {
        font-size: 0.75rem;
    }
    
    .journal-speaker-coin-large {
        width: 80px;
        height: 80px;
    }
    
    .journal-speaker-name {
        font-size: 0.8rem;
        max-width: 80px;
    }
    
    .speaker-coin-placeholder {
        font-size: 2rem;
    }
    
    .journal-entry-content {
        flex-grow: 1; /* Allow content to expand */
    }
    
    .journal-entry-actions {
        margin-top: auto; /* Push actions to bottom */
    }
}

/* Tablet Grid Layout (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .journal-entries {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .journal-entry {
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }
    
    .journal-entry-content {
        flex-grow: 1;
    }
    
    .journal-entry-actions {
        margin-top: auto;
    }
}

/* Mobile Layout (≤480px) */
@media (max-width: 480px) {
    .quick-actions .btn,
    .quick-actions button,
    .quick-actions a {
        width: 240px !important;
        height: 75px !important;
        font-size: 1.725rem !important;
    }
    
    .quick-actions .btn i,
    .quick-actions button i,
    .quick-actions a i {
        font-size: 1.875rem !important;
    }
    
    .journal-entries {
        display: block; /* Keep current behavior */
    }
    
    .journal-entry {
        margin-bottom: 1.5rem; /* Maintain current spacing */
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .journal-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .journal-header h1 {
        font-size: 2rem;
    }
    
    .journal-filters {
        padding: 1rem;
    }
    
    .journal-filters .row > div {
        margin-bottom: 1rem;
    }
    
    .journal-filters .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .journal-stats {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .journal-entry {
        padding: 1rem;
    }
    
    .journal-entry-top-row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .journal-entry-main-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .journal-entry-speaker-section {
        order: 1;
    }
    
    .journal-entry-title-section {
        order: 2;
        text-align: center;
        padding-top: 0;
    }
    
    .journal-entry-actions {
        order: 3;
        align-self: center;
    }
    
    .journal-entry-meta {
        flex-direction: column;
        gap: 0.5rem;
        justify-content: center;
        padding-left: 0;
        text-align: center;
    }
    
    .journal-speaker-coin-large {
        width: 70px;
        height: 70px;
    }
    
    .speaker-coin-placeholder {
        font-size: 2rem;
    }
    
    .journal-entry-content {
        font-size: 0.9rem;
    }
    
    .journal-empty {
        padding: 3rem 1rem;
    }
    
    .journal-empty .empty-icon {
        font-size: 3rem;
    }
    
    /* Mobile adjustments for filter indicators */
    .active-tag-filter,
    .active-meta-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .filter-clear {
        align-self: flex-end;
        margin-left: 0;
    }
}

/* Collection Modal Styles */
.collection-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.collection-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.collection-option:hover {
    border-color: #8b9d83;
    background-color: #f8f9fa;
}

.collection-option input[type="radio"] {
    margin: 0;
    accent-color: #8b9d83;
}

.collection-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #2d3748;
}

.collection-instructions {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
}

.collection-instructions p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.collection-instructions i {
    color: #8b9d83;
    margin-right: 0.5rem;
}

/* Selection Header Styles */
.selection-header {
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
    border: 1px solid #81d4fa;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

.selection-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.select-all-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #0277bd;
}

.select-all-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0277bd;
    cursor: pointer;
}

.select-all-label {
    font-size: 0.95rem;
    font-weight: 600;
}

.selected-count {
    background: rgba(2, 119, 189, 0.1);
    color: #01579b;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bulk-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.bulk-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.bulk-actions .btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Entry Checkbox Styles */
.journal-entry-checkbox {
    display: flex;
    align-items: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.entry-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.entry-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8b9d83;
    cursor: pointer;
    opacity: 0;
    position: absolute;
}

.entry-checkbox .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    background: white;
    position: relative;
    transition: all 0.2s ease;
}

.entry-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #8b9d83;
    border-color: #8b9d83;
}

.entry-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.entry-checkbox:hover .checkmark {
    border-color: #8b9d83;
    box-shadow: 0 0 0 3px rgba(139, 157, 131, 0.1);
}

/* Selected Entry Styles */
.journal-entry.selected {
    border-color: #8b9d83;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 4px 12px rgba(139, 157, 131, 0.2);
}

/* Bulk Operations Modal Styles */
.bulk-scope-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.bulk-scope-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-scope-option:hover {
    border-color: #8b9d83;
    background-color: #f8f9fa;
}

.bulk-scope-option input[type="radio"] {
    margin: 0;
    accent-color: #8b9d83;
}

.bulk-scope-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #2d3748;
    flex: 1;
}

.bulk-scope-option label span {
    font-weight: 600;
    color: #8b9d83;
}

.bulk-operation-details {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.bulk-operation-details p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive adjustments for selection UI */
@media (max-width: 768px) {
    .selection-header {
        padding: 0.75rem 1rem;
    }
    
    .selection-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .bulk-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .bulk-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .journal-entry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .journal-entry-checkbox {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .bulk-scope-options {
        gap: 0.75rem;
    }
    
    .bulk-scope-option {
        padding: 0.5rem;
    }
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast-message {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #8b9d83;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    max-width: 300px;
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: auto;
}

.toast-message.toast-success {
    border-left-color: #10b981;
    color: #065f46;
}

.toast-message.toast-error {
    border-left-color: #ef4444;
    color: #991b1b;
}

.toast-message.toast-info {
    border-left-color: #3b82f6;
    color: #1e40af;
}

.toast-message.toast-warning {
    border-left-color: #f59e0b;
    color: #92400e;
}

/* Journal Speaker Coin Images - Legacy styles removed, using new larger coin layout */

/* =============================================================================
   "Chat about this" — chat icon button + modal speaker picker
   ============================================================================= */

.btn-journal-action.btn-chat-about:hover {
    background: #eef5f0;
    border-color: #5a9367;
    color: #2e5a3a;
}

#chatAboutModal .chat-about-modal {
    max-width: 680px !important;
    width: min(94vw, 680px);
    display: flex;
    flex-direction: column;
}

@media (min-width: 601px) {
    #chatAboutModal .chat-about-modal {
        max-height: 90vh;
        overflow: visible;
    }

    #chatAboutModal .modal-body {
        position: relative;
        z-index: 2;
    }

    #chatAboutModal .speaker-picker-panel {
        z-index: 120;
    }

    #chatAboutModal .modal-footer {
        position: relative;
        z-index: 1;
    }
}

.chat-about-modal .modal-body {
    overflow: visible;
    padding-bottom: 0.75rem;
}

.chat-about-hint {
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
}

/* Picker trigger (the always-visible compact dropdown button) */
.speaker-picker {
    position: relative;
}

.speaker-picker-trigger {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    text-align: left;
    color: #1f2937;
    font-size: 1rem;
    min-height: 56px;
}

.speaker-picker-trigger:hover {
    border-color: #8b9d83;
}

.speaker-picker-trigger:focus,
.speaker-picker.is-open .speaker-picker-trigger {
    outline: none;
    border-color: #5a9367;
    box-shadow: 0 0 0 3px rgba(90, 147, 103, 0.18);
}

.speaker-picker-coin {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speaker-picker-coin img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.speaker-picker-name {
    flex: 1 1 auto;
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.speaker-picker-caret {
    flex: 0 0 auto;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.speaker-picker.is-open .speaker-picker-caret {
    transform: rotate(180deg);
}

/* Picker panel — desktop: absolute under trigger */
.speaker-picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 30;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: min(60vh, 460px);
}

.speaker-picker-panel[hidden] {
    display: none;
}

.speaker-picker-search {
    position: relative;
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    flex: 0 0 auto;
}

.speaker-picker-search i {
    position: absolute;
    left: 1.4rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
    pointer-events: none;
}

.speaker-picker-search input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem 0.55rem 2.1rem;
    font-size: 0.95rem;
    background: #f9fafb;
}

.speaker-picker-search input:focus {
    outline: none;
    border-color: #5a9367;
    box-shadow: 0 0 0 3px rgba(90, 147, 103, 0.15);
    background: #ffffff;
}

.speaker-picker-list {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.25rem 0 0.5rem;
    scrollbar-gutter: stable;
}

.speaker-picker-empty {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Tradition group accordion inside the picker */
.tradition-group {
    border-bottom: 1px solid #f3f4f6;
}

.tradition-group:last-child {
    border-bottom: none;
}

.tradition-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.6rem 0.95rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: #4b5563;
    cursor: pointer;
    text-align: left;
    position: sticky;
    top: 0;
    background: #f9fafb;
    z-index: 1;
}

.tradition-group-header:hover {
    background: #f3f4f6;
}

.tradition-group-chevron {
    font-size: 0.75rem;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.tradition-group.is-collapsed .tradition-group-chevron {
    transform: rotate(-90deg);
}

.tradition-group-name {
    flex: 1 1 auto;
}

.tradition-group-count {
    flex: 0 0 auto;
    font-size: 0.7rem;
    color: #6b7280;
    background: #e5e7eb;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 600;
}

.tradition-group-body {
    display: flex;
    flex-direction: column;
    padding: 0.15rem 0.4rem 0.5rem;
}

.tradition-group.is-collapsed .tradition-group-body {
    display: none;
}

/* Speaker option rows */
.speaker-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    text-align: left;
    color: #1f2937;
    min-height: 44px;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.speaker-row:hover,
.speaker-row:focus {
    background: #eef5f0;
    border-color: #d1e0d7;
    outline: none;
}

.speaker-row.is-selected {
    background: #e0ece4;
    border-color: #8b9d83;
}

.speaker-row-coin {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speaker-row-coin img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.speaker-row-name {
    flex: 1 1 auto;
    font-size: 0.95rem;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Mobile bottom-sheet behavior for the picker panel */
@media (max-width: 600px) {
    .speaker-picker-panel {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 80vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.18);
        z-index: 1100;
    }

    .speaker-picker-list {
        max-height: 65vh;
    }

    .speaker-row {
        min-height: 48px;
    }
}
