
        /* Journal-specific styles */
        .journal-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
        }

        .journal-header {
            text-align: center;
            margin-bottom: 3rem;
            padding: 2rem 0;
            border-bottom: 1px solid var(--border);
        }

        .journal-header h1 {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--fg);
            margin-bottom: 0.5rem;
            background: linear-gradient(135deg, var(--accent), var(--accent-2));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .journal-header p {
            color: var(--muted);
            font-size: 1.1rem;
            max-width: 600px;
            margin: 0 auto;
        }

        .journal-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .journal-filters {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
            align-items: center;
        }

        .journal-actions {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .filter-select, .search-input {
            padding: 0.75rem 1rem;
            border: 2px solid var(--border);
            border-radius: 8px;
            background: var(--bg-solid);
            color: var(--fg);
            /* form controls don't inherit font — the UA's Arial fallback has
               no CJK glyphs, tofu on CN (QA R14; same class as
               journal_inline.css .search-input fix) */
            font-family: inherit !important;
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .filter-select:focus, .search-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(76, 99, 210, 0.1);
        }

        .search-input {
            min-width: 250px;
        }

        .journal-entries {
            display: grid;
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .journal-entry {
            background: var(--bg-solid);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 1.5rem;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .journal-entry:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 32px rgba(0,0,0,0.1);
            border-color: var(--accent);
        }

        /* journal-entry cards became keyboard-focusable (tabindex=0/role=button,
           QA R5) so they need a visible focus ring, same treatment as the
           media thumbnails below. */
        .journal-entry:focus-visible,
        .media-item img:focus-visible {
            outline: 3px solid var(--accent, #4FACFE);
            outline-offset: 2px;
        }

        .journal-entry-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 1rem;
        }

        .journal-entry-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--fg);
            margin: 0;
            flex: 1;
        }

        .journal-entry-date {
            color: var(--muted);
            font-size: 0.9rem;
            white-space: nowrap;
            margin-left: 1rem;
        }

        .journal-entry-content {
            color: var(--fg);
            line-height: 1.6;
            margin-bottom: 1rem;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .journal-entry-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

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

        .journal-tag {
            background: rgba(76, 99, 210, 0.1);
            color: var(--accent);
            padding: 0.25rem 0.75rem;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 500;
        }

        .journal-entry-type {
            background: rgba(108, 92, 231, 0.1);
            color: var(--accent-2);
            padding: 0.25rem 0.75rem;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 500;
        }

        .journal-mood {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--muted);
            font-size: 0.9rem;
        }

        .mood-emoji {
            font-size: 1.2rem;
        }

        .journal-loading {
            text-align: center;
            padding: 3rem;
            color: var(--muted);
        }

        .journal-empty {
            text-align: center;
            padding: 4rem 2rem;
            color: var(--muted);
        }

        .journal-empty h3 {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            color: var(--fg);
        }

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

        .journal-pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 1rem;
            margin-top: 2rem;
        }

        .pagination-btn {
            padding: 0.75rem 1.5rem;
            border: 2px solid var(--border);
            background: var(--bg-solid);
            color: var(--fg);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 600;
        }

        .pagination-btn:hover:not(:disabled) {
            border-color: var(--accent);
            background: var(--accent);
            color: white;
        }

        .pagination-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .pagination-info {
            color: var(--muted);
            font-size: 0.9rem;
        }

        /* Modal styles for viewing full entry */
        .journal-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.8);
            z-index: 15000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }

        /* Quick Edit Modal */
        .edit-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.8);
            z-index: 15000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }

        .edit-modal-content {
            background: var(--bg-solid);
            border: 1px solid var(--border);
            border-radius: 20px;
            max-width: 700px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
        }

        .edit-modal-header {
            padding: 2rem 2rem 1rem 2rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }

        .edit-modal-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--fg);
            margin: 0;
        }

        .edit-modal-close {
            background: none;
            border: none;
            color: var(--muted);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .edit-modal-close:hover {
            background: rgba(255,255,255,0.1);
            color: var(--fg);
        }

        .edit-modal-body {
            padding: 2rem;
        }

        .edit-form-group {
            margin-bottom: 1.5rem;
        }

        .edit-form-label {
            display: block;
            color: var(--fg);
            font-weight: 600;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }

        .edit-form-input {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-solid);
            color: var(--fg);
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .edit-form-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(76, 99, 210, 0.1);
        }

        .edit-form-textarea {
            min-height: 120px;
            resize: vertical;
            font-family: inherit;
        }

        .edit-form-select {
            appearance: none;
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
            background-position: right 0.5rem center;
            background-repeat: no-repeat;
            background-size: 1.5em 1.5em;
            padding-right: 2.5rem;
        }

        .edit-form-actions {
            display: flex;
            gap: 1rem;
            margin-top: 2rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border);
        }

        .edit-form-btn {
            padding: 0.75rem 1.5rem;
            border: 2px solid var(--border);
            background: var(--bg-solid);
            color: var(--fg);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 600;
            flex: 1;
        }

        .edit-form-btn:hover {
            border-color: var(--accent);
            background: var(--accent);
            color: white;
        }

        .edit-form-btn.secondary {
            background: transparent;
        }

        .edit-form-btn.secondary:hover {
            background: rgba(255,255,255,0.1);
            border-color: var(--muted);
        }

        /* Edit Media Styles */
        .edit-media-list {
            margin-bottom: 1rem;
            min-height: 60px;
            border: 1px dashed var(--border);
            border-radius: 8px;
            padding: 1rem;
            background: rgba(255,255,255,0.02);
        }

        .edit-media-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem;
            margin-bottom: 0.5rem;
            background: var(--bg-solid);
            border: 1px solid var(--border);
            border-radius: 6px;
        }

        .edit-media-item:last-child {
            margin-bottom: 0;
        }

        .edit-media-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex: 1;
        }

        .edit-media-preview {
            width: 40px;
            height: 40px;
            object-fit: cover;
            border-radius: 4px;
        }

        .edit-media-details {
            flex: 1;
        }

        .edit-media-name {
            font-size: 0.9rem;
            color: var(--fg);
            margin: 0;
        }

        .edit-media-size {
            font-size: 0.8rem;
            color: var(--muted);
            margin: 0;
        }

        .edit-media-remove {
            background: none;
            border: none;
            color: var(--error);
            cursor: pointer;
            padding: 0.25rem;
            border-radius: 4px;
            transition: all 0.3s ease;
        }

        .edit-media-remove:hover {
            background: rgba(229, 62, 62, 0.1);
        }

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

        .edit-media-upload-btn {
            padding: 0.5rem 1rem;
            border: 1px solid var(--border);
            background: var(--bg-solid);
            color: var(--fg);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.9rem;
        }

        .edit-media-upload-btn:hover {
            border-color: var(--accent);
            background: var(--accent);
            color: white;
        }

        .journal-modal-content {
            background: var(--bg-solid);
            border: 1px solid var(--border);
            border-radius: 20px;
            max-width: 800px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
        }

        .journal-modal-header {
            padding: 2rem 2rem 1rem 2rem;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }

        .journal-modal-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--fg);
            margin: 0;
        }

        .journal-modal-date {
            color: var(--muted);
            font-size: 0.9rem;
        }

        .journal-modal-close {
            background: none;
            border: none;
            color: var(--muted);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .journal-modal-close:hover {
            background: rgba(255,255,255,0.1);
            color: var(--fg);
        }

        .journal-modal-body {
            padding: 2rem;
        }

        .journal-modal-content-text {
            color: var(--fg);
            line-height: 1.6;
            margin-bottom: 1.5rem;
        }

        .journal-modal-insights {
            background: rgba(76, 99, 210, 0.05);
            border: 1px solid rgba(76, 99, 210, 0.2);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .journal-modal-insights h4 {
            color: var(--accent);
            margin: 0 0 1rem 0;
            font-size: 1.1rem;
        }

        .journal-modal-insights p {
            color: var(--fg);
            margin: 0;
            line-height: 1.5;
        }

        .journal-modal-media {
            margin-top: 1.5rem;
        }

        .journal-modal-media h4 {
            color: var(--fg);
            margin: 0 0 1rem 0;
            font-size: 1.1rem;
        }

        .media-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 1rem;
        }

        .media-item {
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--border);
        }

        .media-item img, .media-item video {
            width: 100%;
            height: 150px;
            object-fit: cover;
        }

        /* Mobile responsive */
        @media (max-width: 768px) {
            .journal-container {
                padding: 1rem;
            }

            .journal-header h1 {
                font-size: 2rem;
            }

            .journal-controls {
                flex-direction: column;
                align-items: stretch;
            }

            .journal-filters {
                justify-content: center;
            }

            .journal-actions {
                justify-content: center;
            }

            .search-input {
                min-width: 100%;
            }

            .recording-sections {
                grid-template-columns: 1fr !important;
            }

            .journal-modal {
                padding: 1rem;
            }

            .journal-modal-content {
                max-height: 95vh;
            }

            .journal-modal-header,
            .journal-modal-body {
                padding: 1.5rem;
            }
        }

        /* Image Modal Styles */
        .image-modal {
            display: none;
            position: fixed;
            z-index: 20000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(5px);
        }

        .image-modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            max-width: 90%;
            max-height: 90%;
            background: var(--bg);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        }

        .image-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
        }

        .image-modal-title {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text);
            margin: 0;
        }

        .image-modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--text-muted);
            cursor: pointer;
            padding: 0.5rem;
            border-radius: 6px;
            transition: all 0.2s ease;
        }

        .image-modal-close:hover {
            background: var(--surface-hover);
            color: var(--text);
        }

        .image-modal-body {
            padding: 0;
            text-align: center;
        }

        .image-modal-body img {
            max-width: 100%;
            max-height: 70vh;
            object-fit: contain;
            border-radius: 0;
        }
    