/**
 * Pocket-Sommelier - Journal Styles v4.3
 *
 * v4.3 Änderungen:
 * - Taste Info Button (.journal-taste-info-btn) mit Gold-Kreis-Icon
 * - Taste Info Bottom-Sheet Modal (.journal-taste-info-overlay, -modal, -section)
 * - Dark Mode + prefers-color-scheme Support für alle neuen Elemente
 *
 * v4.2 Änderungen:
 * - Header-Styles beibehalten aber nicht mehr gerendert (Header in JS entfernt)
 * - .journal-confidence-motivation reaktiviert (war display:none)
 *
 * v4.1 Änderungen:
 * - OFFEN-Stat-Card: Puls-Glow Animation (.journal-stat-open-attention)
 * - "aktualisiert vor X min" Label (.journal-profile-updated-ago)
 * - Dark Mode für beide neuen Elemente
 *
 * v4.0 Änderungen:
 * - Stat-Icons entfernt (.journal-stat-icon ausgeblendet)
 * - Klickbare Stats (BEWERTET/OFFEN) mit Cursor + Hover
 * - Farbbalken dicker (14px statt 8px)
 * - Tachonadel statt rundem Schieberegler-Pin
 * - INAKTIV Badge Styles (grau statt grün)
 * - Motivationstext als separater Bereich
 * - Prominente Fragebogen-CTA mit Dark Mode Support
 * - Bewertungsanzahl aus Confidence-Sub entfernt
 *
 * v3.2: Font-Sizes vergrößert für Mobile
 * v3.1: Vollständiger Dark Mode Support
 * v3.0: Stats-Row, Confidence Card, farbcodierte Einträge, Rating-Modal
 */

/* ==================== Header ==================== */
.journal-header {
    padding: 20px 16px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.journal-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--wine-800, #8c2942), var(--wine-900, #722F37));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(114, 47, 55, 0.25);
    flex-shrink: 0;
}

.journal-header-icon svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

.journal-header-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    margin: 0;
    line-height: 1.2;
}

.journal-header-subtitle {
    font-size: 13px;
    color: var(--text-tertiary, var(--gray-400));
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 2px 0 0;
    font-weight: 500;
}

.journal-main {
    padding: 0 0 1rem 0;
}

/* ==================== Tab Bar ==================== */
.journal-tab-bar {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    margin-bottom: 14px;
    background: var(--bg-tertiary, #F2EAE7);
    border-radius: 12px;
    margin-left: 16px;
    margin-right: 16px;
    padding: 4px;
}

.journal-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-tertiary, #9C878C);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.journal-tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.journal-tab:active {
    transform: scale(0.97);
}

.journal-tab.active {
    background: var(--bg-secondary, #FFFBF9);
    color: var(--text-primary, #2A1215);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Grüner Dot-Indikator (z.B. wenn Partner verbunden) */
.journal-tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22C55E;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
}

/* Partner-Tab Content Wrapper */
.journal-partner-tab-content {
    padding: 0;
}

/* ==================== Loading ==================== */
.journal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
}

/* ==================== Stats Row ==================== */
.journal-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 14px;
}

.journal-stat-card {
    background: var(--bg-secondary, #fff);
    border-radius: 14px;
    padding: 0 10px 10px;
    text-align: center;
    border: 1px solid var(--border-color, var(--gray-200));
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

/* Stat Icons ausgeblendet (v4.0) */
.journal-stat-icon {
    display: none;
}

/* Klickbare Stats (BEWERTET / OFFEN) */
.journal-stat-clickable {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.journal-stat-clickable:hover {
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.15);
}

.journal-stat-clickable:active {
    transform: scale(0.97);
}

/* OFFEN card attention animation (when unrated wines exist) */
.journal-stat-open-attention {
    border-color: var(--gold, #c5a059);
    border-width: 2px;
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.12) 0%, rgba(197, 160, 89, 0.06) 100%);
    animation: journalOpenPulse 2s ease-in-out infinite;
    position: relative;
}

.journal-stat-open-attention .journal-stat-value {
    color: var(--gold, #c5a059);
}

.journal-stat-open-attention .journal-stat-label {
    color: var(--gold, #c5a059);
    font-weight: 700;
}

@keyframes journalOpenPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(197, 160, 89, 0.4),
                    0 0 8px 2px rgba(197, 160, 89, 0.15);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 18px 6px rgba(197, 160, 89, 0.45),
                    0 0 30px 10px rgba(197, 160, 89, 0.2);
        transform: scale(1.03);
    }
}

.journal-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 0.85;
    padding-top: 6px;
}

.journal-stat-label {
    font-size: 13px;
    color: var(--text-tertiary, var(--gray-400));
    font-weight: 500;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ==================== Confidence Card ==================== */
.journal-confidence-card {
    margin: 0 16px 14px;
    padding: 16px 18px;
    background: var(--bg-secondary, #fff);
    border-radius: 16px;
    border: 1px solid var(--border-color, var(--gray-200));
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Top row: Title + Live/Inactive badge */
.journal-confidence-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.journal-confidence-profile-title {
    display: flex;
    align-items: center;
}

.journal-confidence-profile-title svg {
    display: none;
}

.journal-confidence-title-badge {
    display: inline-block;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, var(--gold, #c5a059) 0%, #B8860B 100%);
    padding: 5px 16px;
    border-radius: 8px;
    font-family: 'Playfair Display', Georgia, serif;
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.3);
}

/* Live / Active Badge */
.journal-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px 3px 7px;
    border-radius: 9999px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.18);
}

/* INAKTIV Badge */
.journal-live-badge.inactive {
    background: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.25);
}

.journal-live-badge.inactive .journal-live-label {
    color: var(--text-tertiary, #9CA3AF);
}

/* ==================== UPDATING Badge ==================== */
.journal-live-badge.updating {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.18);
}

.journal-live-badge.updating .journal-live-label {
    color: #3B82F6;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Animated Spinner */
.journal-updating-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: #3B82F6;
    animation: journalSpinnerRotate 1s linear infinite;
}

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

/* "noch ca. 2 Minuten" Zeitanzeige */
.journal-updating-time {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(59, 130, 246, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.12);
}

.journal-updating-time svg {
    color: #3B82F6;
    flex-shrink: 0;
}

.journal-updating-time span {
    font-size: 13px;
    font-weight: 500;
    color: #3B82F6;
}


.journal-inactive-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary, #9CA3AF);
    opacity: 0.5;
}

.journal-live-dot-wrap {
    position: relative;
    width: 8px;
    height: 8px;
}

.journal-live-dot-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #22C55E;
    animation: journalLivePulse 2s ease-in-out infinite;
}

.journal-live-dot {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #22C55E;
}

.journal-live-label {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

@keyframes journalLivePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(2.4); opacity: 0; }
}

/* Sub-header row (ohne Count) */
.journal-confidence-sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.journal-confidence-sub-text {
    font-size: 15px;
    color: var(--text-secondary, var(--gray-600));
    font-weight: 500;
}

.journal-confidence-sub-count {
    font-size: 14px;
    color: var(--text-tertiary, var(--gray-400));
    font-weight: 500;
}

/* ==================== RYG Gradient Track (DICKER, 14px) ==================== */
.journal-confidence-track-wrapper {
    position: relative;
    margin-bottom: 6px;
    padding-top: 16px; /* Platz für die Nadel oben */
}

.journal-confidence-track {
    position: relative;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(
        to right,
        #ef4444 0%,
        #ef4444 15%,
        #f59e0b 35%,
        #f59e0b 55%,
        #22c55e 80%,
        #22c55e 100%
    );
    overflow: visible;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ==================== Tachonadel (statt rundem Pin) ==================== */
.journal-confidence-needle {
    position: absolute;
    top: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    pointer-events: none;
    transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dreieckige Nadel-Spitze (zeigt nach unten auf die Skala) */
.journal-confidence-needle-pointer {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid var(--gold, #c5a059);
    margin-top: -17px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

/* Vertikaler Strich der Nadel */
.journal-confidence-needle-stem {
    width: 2px;
    height: 6px;
    background: var(--gold, #c5a059);
    margin-top: -1px;
    border-radius: 0 0 1px 1px;
}

/* Alter Pin ausgeblendet (Fallback) */
.journal-confidence-pin {
    display: none;
}

/* Confidence Label */
.journal-confidence-label {
    font-size: 15px;
    color: var(--text-tertiary, var(--gray-400));
    text-align: center;
    margin: 10px 0 0;
    font-style: italic;
    line-height: 1.4;
}

/* ==================== Tipp Section ==================== */
.journal-tipp-section {
    margin: 0 16px 14px;
    padding: 12px 16px;
    background: rgba(197, 160, 89, 0.06);
    border-radius: 12px;
    border-left: 3px solid var(--gold, #c5a059);
}

.journal-tipp-section p {
    font-size: 15px;
    color: var(--text-secondary, var(--gray-600));
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

/* Alte Motivation ausgeblendet */
.journal-motivation-section {
    display: none;
}

/* Motivation innerhalb der Confidence Card (v5.6 reaktiviert) */
.journal-confidence-motivation {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, var(--gray-200));
}

.journal-confidence-motivation p {
    font-size: 14px;
    color: var(--text-secondary, var(--gray-600));
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

/* ==================== Prominente Fragebogen-CTA ==================== */
.journal-questionnaire-cta-prominent {
    margin: 0 16px 18px;
    padding: 24px 20px;
    background: var(--bg-secondary, #fff);
    border-radius: 16px;
    border: 1px solid var(--border-color, var(--gray-200));
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.1);
    text-align: center;
}

.journal-questionnaire-cta-icon {
    display: none;
}

.journal-questionnaire-cta-icon svg {
    width: 26px;
    height: 26px;
    color: var(--gold, #c5a059);
}

.journal-questionnaire-cta-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    margin: 0 0 8px;
    line-height: 1.3;
}

.journal-questionnaire-cta-text {
    font-size: 15px;
    color: var(--text-secondary, var(--gray-600));
    margin: 0 0 18px;
    line-height: 1.5;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.journal-questionnaire-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--gold-gradient, linear-gradient(135deg, #C5A059 0%, #D4AF37 50%, #B8860B 100%));
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.35);
    -webkit-tap-highlight-color: transparent;
}

.journal-questionnaire-cta-btn:hover {
    box-shadow: 0 6px 20px rgba(197, 160, 89, 0.45);
    transform: translateY(-1px);
}

.journal-questionnaire-cta-btn:active {
    transform: scale(0.97);
}

/* ==================== Profile Estimate (unter der Skala) ==================== */
.journal-profile-estimate {
    margin: 0 16px 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.06) 100%);
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, 0.18);
}

.journal-profile-estimate-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(99, 102, 241, 0.8);
    margin-bottom: 8px;
}

.journal-profile-estimate .journal-profile-summary {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, var(--gray-900));
    margin: 0 0 4px;
    line-height: 1.45;
}

/* ---- Profile Info (Haupttext, prominent) ---- */
.journal-profile-info {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, var(--gray-900));
    margin: 0 0 4px;
    line-height: 1.45;
}

/* ---- "aktualisiert vor X min" Label ---- */
.journal-profile-updated-ago {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    padding: 4px 12px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.18);
    border-radius: 9999px;
    animation: journalUpdatedFadeIn 0.5s ease both;
}

.journal-profile-updated-ago svg {
    color: #16a34a;
    flex-shrink: 0;
}

.journal-profile-updated-ago span {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    letter-spacing: 0.2px;
}

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

/* ---- Section Header (Letzte Aktualisierung, Details) ---- */
.journal-profile-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.journal-profile-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-tertiary, var(--gray-400));
}

/* ---- Letzte Aktualisierung ---- */
.journal-profile-update-wrap {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(99, 102, 241, 0.12);
}

.journal-profile-update-text {
    font-size: 15px;
    color: var(--text-secondary, var(--gray-600));
    margin: 0;
    line-height: 1.5;
}

/* ---- Addressing Wrap (Premium-gated) ---- */
.journal-profile-addressing-wrap {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(99, 102, 241, 0.12);
}

.journal-profile-addressing-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

/* Premium Badge */
.journal-profile-premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.12) 0%, rgba(212, 175, 55, 0.08) 100%);
    border: 1px solid rgba(197, 160, 89, 0.25);
    font-size: 11px;
    font-weight: 700;
    color: var(--gold, #c5a059);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.journal-profile-premium-badge svg {
    color: var(--gold, #c5a059);
    flex-shrink: 0;
}

/* Addressing Body (relative for fade) */
.journal-profile-addressing-body {
    position: relative;
}

.journal-profile-estimate .journal-profile-addressing {
    font-size: 15px;
    color: var(--text-secondary, var(--gray-600));
    margin: 0;
    line-height: 1.5;
}

/* 2-line clamp */
.journal-profile-addressing-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Fade overlay at the bottom of clamped text */
.journal-profile-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: linear-gradient(
        to bottom,
        rgba(238, 237, 252, 0) 0%,
        rgba(238, 237, 252, 0.8) 60%,
        rgba(238, 237, 252, 1) 100%
    );
    pointer-events: none;
    border-radius: 0 0 4px 4px;
}

/* Show More / Show Less Button */
.journal-profile-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 6px 14px;
    background: rgba(197, 160, 89, 0.08);
    border: 1px solid rgba(197, 160, 89, 0.2);
    border-radius: 9999px;
    color: var(--gold, #c5a059);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.journal-profile-more-btn:hover {
    background: rgba(197, 160, 89, 0.15);
    border-color: var(--gold, #c5a059);
}

.journal-profile-more-btn:active {
    transform: scale(0.97);
}

.journal-profile-more-btn svg {
    color: var(--gold, #c5a059);
    flex-shrink: 0;
}

/* Alte Profile Card ausgeblendet */
.journal-profile-card {
    display: none;
}

.journal-profile-inner {
    display: none;
}

.journal-profile-icon {
    display: none;
}

/* ==================== Section Header ==================== */
.journal-section {
    padding: 0 16px;
    margin-bottom: 18px;
}

.journal-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
    margin-bottom: 8px;
}

.journal-section-bar {
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: var(--gold);
    flex-shrink: 0;
}

.journal-section-bar.green {
    background: #22C55E;
}

.journal-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary, var(--gray-600));
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
    flex: 1;
}

.journal-section-count {
    font-size: 14px;
    color: var(--text-tertiary, var(--gray-400));
    font-weight: 500;
}

/* ==================== Entry List ==================== */
.journal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==================== Wine Entry Card ==================== */
.journal-entry {
    background: var(--bg-secondary, #fff);
    border-radius: 14px;
    padding: 16px;
    border: 1px solid var(--border-color, var(--gray-200));
    border-left-width: 4px;
    border-left-color: var(--border-color, var(--gray-200));
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    animation: journalSlideIn 0.35s ease both;
}

.journal-entry:active {
    transform: scale(0.98);
}

/* Wine type color coding */
.journal-entry.wine-red { border-left-color: #8B2942; }
.journal-entry.wine-white { border-left-color: #E8D4A8; }
.journal-entry.wine-rose { border-left-color: #F4A0B5; }
.journal-entry.wine-sparkling { border-left-color: #D4C08A; }

.journal-entry-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* Wine Type Dot */
.journal-entry-type-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--gray-300, #D1D5DB);
}

.journal-entry-type-dot.red {
    background: linear-gradient(135deg, #9F1239, #722F37);
    box-shadow: 0 1px 4px rgba(114, 47, 55, 0.35);
}

.journal-entry-type-dot.white {
    background: linear-gradient(135deg, #FDE68A, #F59E0B);
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.35);
}

.journal-entry-type-dot.rose {
    background: linear-gradient(135deg, #FDA4AF, #F43F5E);
    box-shadow: 0 1px 4px rgba(244, 63, 94, 0.3);
}

.journal-entry-type-dot.sparkling {
    background: linear-gradient(135deg, #FDE68A, #D4AF37);
    box-shadow: 0 1px 4px rgba(212, 175, 55, 0.3);
}

.journal-entry-info {
    flex: 1;
    min-width: 0;
}

.journal-entry-name {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary, var(--gray-900));
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Meta row (badges + date) */
.journal-entry-meta-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    flex-wrap: wrap;
}

/* Wine Type Badge */
.journal-wine-type-badge {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.journal-wine-type-badge.red { background: #7C1D35; color: #FDEEF2; }
.journal-wine-type-badge.white { background: #D4E4B0; color: #2E3D14; }
.journal-wine-type-badge.rose { background: #F5A3B5; color: #5C0A24; }
.journal-wine-type-badge.sparkling { background: #C5A059; color: #FFFFFF; }

/* Wine Character Badge */
.journal-wine-char-badge {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800, #1f2937);
    background: var(--gray-200, #E5E7EB);
    padding: 3px 9px;
    border-radius: 10px;
    white-space: nowrap;
}

.journal-entry-meta-sep {
    font-size: 12px;
    color: var(--text-tertiary, var(--gray-400));
    line-height: 1;
}

.journal-entry-date {
    font-size: 13px;
    color: var(--text-tertiary, var(--gray-400));
    white-space: nowrap;
}

/* ==================== Rate Button ==================== */
.journal-rate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gold);
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    animation: journalRateBtnGlow 2.5s ease-in-out infinite;
}

/* Shimmer sweep effect */
.journal-rate-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        transparent 40%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 60%,
        transparent 100%
    );
    animation: journalRateBtnShimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes journalRateBtnGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(197, 160, 89, 0.3),
                    0 0 0 0 rgba(197, 160, 89, 0.25);
    }
    50% {
        box-shadow: 0 4px 16px rgba(197, 160, 89, 0.5),
                    0 0 14px 4px rgba(197, 160, 89, 0.3);
    }
}

@keyframes journalRateBtnShimmer {
    0%   { left: -75%; }
    40%  { left: 125%; }
    100% { left: 125%; }
}

.journal-rate-btn:hover {
    background: var(--gold-dark);
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.3);
}

.journal-rate-btn:active {
    transform: scale(0.96);
}

.journal-rate-btn svg {
    flex-shrink: 0;
}

/* ==================== Rating Badge ==================== */
.journal-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.journal-badge.good { background: #BBF7D0; color: #14532D; }
.journal-badge.neutral { background: #FDE68A; color: #78350F; }
.journal-badge.bad { background: #FECACA; color: #7F1D1D; }

.journal-badge svg {
    flex-shrink: 0;
}

/* ==================== Rating Modal ==================== */
.journal-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 150;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.journal-modal-overlay.active {
    background: var(--modal-bg, rgba(0, 0, 0, 0.5));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.journal-modal {
    background: var(--bg-secondary, #fff);
    width: 100%;
    max-width: 32rem;
    border-radius: 1.25rem 1.25rem 0 0;
    padding: 1.25rem 1.25rem calc(var(--safe-area-bottom) + 1.5rem);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    position: relative;
}

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

.journal-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary, var(--gray-100));
    border: none;
    border-radius: 50%;
    color: var(--text-secondary, var(--gray-600));
    cursor: pointer;
    transition: background 0.15s ease;
}

.journal-modal-close:hover {
    background: var(--border-color, var(--gray-200));
}

.journal-modal-wine-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary, var(--gray-900));
    margin: 0 0 0.25rem 0;
    padding-right: 2.5rem;
    line-height: 1.3;
    text-align: center;
}

.journal-modal-wine-badges {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}

.journal-modal-wine-date {
    font-size: 14px;
    color: var(--text-tertiary, var(--gray-400));
    text-align: center;
    margin-top: 4px;
}

.journal-modal-question {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    margin: 20px 0 16px;
    text-align: center;
}

.journal-modal-options {
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* Modal Option Buttons */
.journal-modal-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 108px;
    -webkit-tap-highlight-color: transparent;
}

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

.journal-modal-option.opt-good { background: #f0fdf4; border-color: #bbf7d0; }
.journal-modal-option.opt-good:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15); }

.journal-modal-option.opt-neutral { background: #fffbeb; border-color: #fde68a; }
.journal-modal-option.opt-neutral:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15); }

.journal-modal-option.opt-bad { background: #fef2f2; border-color: #fecaca; }
.journal-modal-option.opt-bad:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15); }

/* Icon Container */
.journal-modal-icon-wrap {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    overflow: hidden;
}

.journal-modal-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.journal-modal-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    line-height: 1;
}

.journal-modal-option span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, var(--gray-900));
}

/* ==================== Clickable Rating Badge ==================== */
.journal-badge.clickable {
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.journal-badge.clickable:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

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

.journal-badge-edit-icon {
    opacity: 0.5;
    margin-left: 2px;
    flex-shrink: 0;
}

/* ==================== Modal: Selected State ==================== */
.journal-modal-option.selected {
    box-shadow: 0 0 0 2px var(--gold, #c5a059), 0 4px 12px rgba(197, 160, 89, 0.2);
    transform: scale(1.03);
}

/* ==================== Modal: Divider ==================== */
.journal-modal-divider {
    height: 1px;
    background: var(--border-color, var(--gray-200));
    margin: 18px 0 14px;
}

/* ==================== Modal: Delete Button ==================== */
.journal-modal-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color, var(--gray-200));
    border-radius: 12px;
    color: var(--text-tertiary, var(--gray-400));
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.journal-modal-delete-btn:hover {
    color: #DC2626;
    border-color: #FECACA;
    background: #FEF2F2;
}

.journal-modal-delete-btn:active {
    transform: scale(0.98);
}

/* ==================== Delete Confirmation Dialog ==================== */
.journal-delete-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 24px;
}

.journal-delete-dialog {
    background: var(--bg-secondary, #fff);
    width: 100%;
    max-width: 340px;
    border-radius: 20px;
    padding: 28px 24px 24px;
    text-align: center;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.journal-delete-overlay.active .journal-delete-dialog {
    transform: scale(1);
    opacity: 1;
}

.journal-delete-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #FEF2F2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.journal-delete-icon-wrap svg {
    color: #DC2626;
}

.journal-delete-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    margin: 0 0 8px;
    line-height: 1.3;
}

.journal-delete-wine {
    font-size: 15px;
    font-weight: 600;
    color: var(--gold, #c5a059);
    margin: 0 0 12px;
    line-height: 1.3;
}

.journal-delete-message {
    font-size: 14px;
    color: var(--text-secondary, var(--gray-600));
    margin: 0 0 24px;
    line-height: 1.55;
}

.journal-delete-actions {
    display: flex;
    gap: 10px;
}

.journal-delete-cancel {
    flex: 1;
    padding: 13px 16px;
    background: var(--bg-tertiary, var(--gray-100));
    border: 1px solid var(--border-color, var(--gray-200));
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, var(--gray-900));
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.journal-delete-cancel:hover {
    background: var(--border-color, var(--gray-200));
}

.journal-delete-cancel:active {
    transform: scale(0.97);
}

.journal-delete-confirm-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 16px;
    background: #DC2626;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.journal-delete-confirm-btn:hover {
    background: #B91C1C;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.journal-delete-confirm-btn:active {
    transform: scale(0.97);
}

/* ==================== Empty State ==================== */
.journal-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    min-height: 50vh;
}

.journal-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.12) 0%, rgba(197, 160, 89, 0.04) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.journal-empty-icon svg {
    width: 40px;
    height: 40px;
    color: var(--gold);
}

.journal-empty-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary, var(--gray-900));
    margin: 0 0 8px;
}

.journal-empty-text {
    font-size: 16px;
    color: var(--text-tertiary, var(--gray-400));
    margin: 0;
    max-width: 280px;
    line-height: 1.5;
}

.journal-empty-hint {
    text-align: center;
    padding: 2rem 1rem;
}

.journal-empty-hint p {
    font-size: 1rem;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

/* ==================== Bottom Tipp ==================== */
.journal-bottom-tipp {
    text-align: center;
    padding: 1.5rem 1.5rem 2rem;
    margin-top: 8px;
}

.journal-bottom-tipp p {
    font-size: 13px;
    color: var(--text-tertiary, var(--gray-400));
    margin: 0;
    font-style: italic;
    line-height: 1.5;
}

/* ==================== Animations ==================== */
@keyframes journalSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ==================================================================
   DARK MODE OVERRIDES
   
   Nur für Elemente mit hardcodierten Farben nötig.
   Alles andere wird automatisch über die --gray-* Variablen-
   Überschreibung in themes.css v2.0 abgedeckt.
   ================================================================== */

/* ==================== Taste Info Button ==================== */
.journal-confidence-profile-title {
    cursor: pointer;
}

.journal-taste-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--gold, #c5a059);
    background: rgba(197, 160, 89, 0.1);
    color: var(--gold, #c5a059);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
    margin-left: 2px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.journal-taste-info-btn:hover {
    background: rgba(197, 160, 89, 0.25);
    transform: scale(1.1);
}

.journal-taste-info-btn:active {
    transform: scale(0.92);
}

/* ==================== Taste Info Modal ==================== */
.journal-taste-info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.journal-taste-info-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.journal-taste-info-modal {
    background: var(--bg-secondary, #fff);
    width: 100%;
    max-width: 32rem;
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.journal-taste-info-overlay.active .journal-taste-info-modal {
    transform: translateY(0);
}

.journal-taste-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    position: sticky;
    top: 0;
    background: var(--bg-secondary, #fff);
    z-index: 1;
    border-bottom: 1px solid var(--border-color, var(--gray-200));
}

.journal-taste-info-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gold, #c5a059) 0%, #B8860B 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.3);
}

.journal-taste-info-title {
    flex: 1;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, var(--gray-900));
    margin: 0;
    line-height: 1.3;
}

.journal-taste-info-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary, var(--gray-100));
    color: var(--text-tertiary, var(--gray-400));
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    padding: 0;
}

.journal-taste-info-close:hover {
    background: var(--border-color, var(--gray-200));
    color: var(--text-primary, var(--gray-900));
}

.journal-taste-info-body {
    padding: 20px 20px calc(var(--safe-area-bottom, 0px) + 24px);
}

.journal-taste-info-section {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    align-items: flex-start;
}

.journal-taste-info-section:last-of-type {
    margin-bottom: 20px;
}

.journal-taste-info-section-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(197, 160, 89, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold, #c5a059);
    flex-shrink: 0;
    margin-top: 1px;
}

.journal-taste-info-section p {
    font-size: 14px;
    color: var(--text-secondary, var(--gray-600));
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.journal-taste-info-footer {
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, var(--gray-200));
    text-align: center;
}

.journal-taste-info-footer p {
    font-size: 15px;
    font-weight: 600;
    color: var(--gold, #c5a059);
    margin: 0;
    line-height: 1.4;
}


/* --- [data-theme="dark"] --- */

[data-theme="dark"] .journal-confidence-card {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .journal-tipp-section {
    background: rgba(197, 160, 89, 0.1);
}

[data-theme="dark"] .journal-confidence-motivation {
    background: rgba(197, 160, 89, 0.1);
}

[data-theme="dark"] .journal-profile-estimate {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .journal-profile-estimate-label {
    color: rgba(129, 140, 248, 0.9);
}

[data-theme="dark"] .journal-profile-addressing-wrap {
    border-top-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .journal-profile-update-wrap {
    border-top-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .journal-profile-premium-badge {
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.18) 0%, rgba(212, 175, 55, 0.12) 100%);
    border-color: rgba(197, 160, 89, 0.3);
}

[data-theme="dark"] .journal-profile-fade-overlay {
    background: linear-gradient(
        to bottom,
        rgba(30, 27, 55, 0) 0%,
        rgba(30, 27, 55, 0.8) 60%,
        rgba(30, 27, 55, 1) 100%
    );
}

[data-theme="dark"] .journal-profile-more-btn {
    background: rgba(197, 160, 89, 0.12);
    border-color: rgba(197, 160, 89, 0.25);
}

[data-theme="dark"] .journal-confidence-title-badge {
    background: linear-gradient(135deg, var(--gold, #c5a059) 0%, #B8860B 100%);
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.2);
}

[data-theme="dark"] .journal-live-badge {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
}

[data-theme="dark"] .journal-live-badge.inactive {
    background: rgba(156, 163, 175, 0.12);
    border-color: rgba(156, 163, 175, 0.2);
}

[data-theme="dark"] .journal-live-label {
    color: #4ADE80;
}

[data-theme="dark"] .journal-live-badge.inactive .journal-live-label {
    color: #6B7280;
}

[data-theme="dark"] .journal-confidence-motivation {
    background: transparent;
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .journal-live-badge.updating {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .journal-live-badge.updating .journal-live-label {
    color: #60A5FA;
}

[data-theme="dark"] .journal-updating-spinner {
    color: #60A5FA;
}

[data-theme="dark"] .journal-updating-time {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .journal-updating-time svg {
    color: #60A5FA;
}

[data-theme="dark"] .journal-updating-time span {
    color: #60A5FA;
}


[data-theme="dark"] .journal-inactive-dot {
    background: #6B7280;
}

/* Prominente CTA Dark Mode */
[data-theme="dark"] .journal-questionnaire-cta-prominent {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Taste Info Button Dark Mode */
[data-theme="dark"] .journal-taste-info-btn {
    background: rgba(212, 175, 55, 0.15);
    border-color: #D4AF37;
    color: #D4AF37;
}

[data-theme="dark"] .journal-taste-info-btn:hover {
    background: rgba(212, 175, 55, 0.3);
}

/* Taste Info Modal Dark Mode */
[data-theme="dark"] .journal-taste-info-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .journal-taste-info-modal {
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .journal-taste-info-section-icon {
    background: rgba(197, 160, 89, 0.15);
    color: #D4AF37;
}

[data-theme="dark"] .journal-questionnaire-cta-icon {
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.2) 0%, rgba(197, 160, 89, 0.08) 100%);
}

/* Clickable Stats Dark Mode */
[data-theme="dark"] .journal-stat-clickable:hover {
    box-shadow: 0 2px 8px rgba(197, 160, 89, 0.1);
}

/* OFFEN attention Dark Mode */
[data-theme="dark"] .journal-stat-open-attention {
    background: linear-gradient(135deg, rgba(197, 160, 89, 0.12) 0%, rgba(197, 160, 89, 0.05) 100%);
    border-color: rgba(197, 160, 89, 0.5);
}

/* Updated-ago Label Dark Mode */
[data-theme="dark"] .journal-profile-updated-ago {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
}

[data-theme="dark"] .journal-profile-updated-ago svg {
    color: #4ADE80;
}

[data-theme="dark"] .journal-profile-updated-ago span {
    color: #4ADE80;
}

/* Wine Type Badges */
[data-theme="dark"] .journal-wine-type-badge.red { background: rgba(139, 41, 66, 0.25); color: #F9A8BC; }
[data-theme="dark"] .journal-wine-type-badge.white { background: rgba(245, 158, 11, 0.15); color: #FDE68A; }
[data-theme="dark"] .journal-wine-type-badge.rose { background: rgba(190, 24, 93, 0.18); color: #FDA4AF; }
[data-theme="dark"] .journal-wine-type-badge.sparkling { background: rgba(146, 112, 45, 0.2); color: #FDE68A; }

/* Rating Badges */
[data-theme="dark"] .journal-badge.good { background: rgba(34, 197, 94, 0.15); color: #86EFAC; }
[data-theme="dark"] .journal-badge.neutral { background: rgba(245, 158, 11, 0.15); color: #FCD34D; }
[data-theme="dark"] .journal-badge.bad { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; }

/* Delete Dialog */
[data-theme="dark"] .journal-delete-icon-wrap { background: rgba(239, 68, 68, 0.15); }
[data-theme="dark"] .journal-delete-dialog { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .journal-modal-delete-btn:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); }
[data-theme="dark"] .journal-delete-confirm-btn { background: #EF4444; }
[data-theme="dark"] .journal-delete-confirm-btn:hover { background: #DC2626; }

/* Modal Options */
[data-theme="dark"] .journal-modal-option.opt-good { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.25); }
[data-theme="dark"] .journal-modal-option.opt-neutral { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.25); }
[data-theme="dark"] .journal-modal-option.opt-bad { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); }

/* Tab Bar Dark Mode */
[data-theme="dark"] .journal-tab-bar {
    background: var(--bg-tertiary, #374151);
}
[data-theme="dark"] .journal-tab {
    color: var(--text-tertiary, #9CA3AF);
}
[data-theme="dark"] .journal-tab.active {
    background: var(--bg-secondary, #1F2937);
    color: var(--text-primary, #F9FAFB);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}


/* --- @media prefers-color-scheme: dark (iOS Auto) --- */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .journal-tab-bar {
        background: var(--bg-tertiary, #374151);
    }
    :root:not([data-theme="light"]) .journal-tab {
        color: var(--text-tertiary, #9CA3AF);
    }
    :root:not([data-theme="light"]) .journal-tab.active {
        background: var(--bg-secondary, #1F2937);
        color: var(--text-primary, #F9FAFB);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    :root:not([data-theme="light"]) .journal-confidence-motivation {
        background: transparent;
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    :root:not([data-theme="light"]) .journal-confidence-card {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    }

    :root:not([data-theme="light"]) .journal-tipp-section {
        background: rgba(197, 160, 89, 0.1);
    }

    :root:not([data-theme="light"]) .journal-confidence-motivation {
        background: rgba(197, 160, 89, 0.1);
    }

    :root:not([data-theme="light"]) .journal-profile-estimate {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
        border-color: rgba(99, 102, 241, 0.2);
    }

    :root:not([data-theme="light"]) .journal-profile-estimate-label {
        color: rgba(129, 140, 248, 0.9);
    }

    :root:not([data-theme="light"]) .journal-profile-addressing-wrap {
        border-top-color: rgba(99, 102, 241, 0.2);
    }

    :root:not([data-theme="light"]) .journal-profile-update-wrap {
        border-top-color: rgba(99, 102, 241, 0.2);
    }

    :root:not([data-theme="light"]) .journal-profile-premium-badge {
        background: linear-gradient(135deg, rgba(197, 160, 89, 0.18) 0%, rgba(212, 175, 55, 0.12) 100%);
        border-color: rgba(197, 160, 89, 0.3);
    }

    :root:not([data-theme="light"]) .journal-profile-fade-overlay {
        background: linear-gradient(
            to bottom,
            rgba(30, 27, 55, 0) 0%,
            rgba(30, 27, 55, 0.8) 60%,
            rgba(30, 27, 55, 1) 100%
        );
    }

    :root:not([data-theme="light"]) .journal-profile-more-btn {
        background: rgba(197, 160, 89, 0.12);
        border-color: rgba(197, 160, 89, 0.25);
    }

    :root:not([data-theme="light"]) .journal-confidence-title-badge {
        background: linear-gradient(135deg, var(--gold, #c5a059) 0%, #B8860B 100%);
        box-shadow: 0 2px 8px rgba(197, 160, 89, 0.2);
    }

    :root:not([data-theme="light"]) .journal-live-badge {
        background: rgba(34, 197, 94, 0.12);
        border-color: rgba(34, 197, 94, 0.25);
    }

    :root:not([data-theme="light"]) .journal-live-badge.inactive {
        background: rgba(156, 163, 175, 0.12);
        border-color: rgba(156, 163, 175, 0.2);
    }

    :root:not([data-theme="light"]) .journal-live-label {
        color: #4ADE80;
    }

    :root:not([data-theme="light"]) .journal-live-badge.inactive .journal-live-label {
        color: #6B7280;
    }

    :root:not([data-theme="light"]) .journal-live-badge.updating {
        background: rgba(59, 130, 246, 0.15);
        border-color: rgba(59, 130, 246, 0.3);
    }

    :root:not([data-theme="light"]) .journal-live-badge.updating .journal-live-label {
        color: #60A5FA;
    }

    :root:not([data-theme="light"]) .journal-updating-spinner {
        color: #60A5FA;
    }

    :root:not([data-theme="light"]) .journal-updating-time {
        background: rgba(59, 130, 246, 0.1);
        border-color: rgba(59, 130, 246, 0.2);
    }

    :root:not([data-theme="light"]) .journal-updating-time svg {
        color: #60A5FA;
    }

    :root:not([data-theme="light"]) .journal-updating-time span {
        color: #60A5FA;
    }


    :root:not([data-theme="light"]) .journal-inactive-dot {
        background: #6B7280;
    }

    :root:not([data-theme="light"]) .journal-questionnaire-cta-prominent {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Taste Info Button auto dark */
    :root:not([data-theme="light"]) .journal-taste-info-btn {
        background: rgba(212, 175, 55, 0.15);
        border-color: #D4AF37;
        color: #D4AF37;
    }

    :root:not([data-theme="light"]) .journal-taste-info-btn:hover {
        background: rgba(212, 175, 55, 0.3);
    }

    /* Taste Info Modal auto dark */
    :root:not([data-theme="light"]) .journal-taste-info-overlay {
        background: rgba(0, 0, 0, 0.7);
    }

    :root:not([data-theme="light"]) .journal-taste-info-modal {
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
    }

    :root:not([data-theme="light"]) .journal-taste-info-section-icon {
        background: rgba(197, 160, 89, 0.15);
        color: #D4AF37;
    }

    :root:not([data-theme="light"]) .journal-questionnaire-cta-icon {
        background: linear-gradient(135deg, rgba(197, 160, 89, 0.2) 0%, rgba(197, 160, 89, 0.08) 100%);
    }

    :root:not([data-theme="light"]) .journal-stat-clickable:hover {
        box-shadow: 0 2px 8px rgba(197, 160, 89, 0.1);
    }

    /* OFFEN attention auto dark */
    :root:not([data-theme="light"]) .journal-stat-open-attention {
        background: linear-gradient(135deg, rgba(197, 160, 89, 0.12) 0%, rgba(197, 160, 89, 0.05) 100%);
        border-color: rgba(197, 160, 89, 0.5);
    }

    /* Updated-ago Label auto dark */
    :root:not([data-theme="light"]) .journal-profile-updated-ago {
        background: rgba(34, 197, 94, 0.12);
        border-color: rgba(34, 197, 94, 0.25);
    }

    :root:not([data-theme="light"]) .journal-profile-updated-ago svg {
        color: #4ADE80;
    }

    :root:not([data-theme="light"]) .journal-profile-updated-ago span {
        color: #4ADE80;
    }

    /* Wine Type Badges */
    :root:not([data-theme="light"]) .journal-wine-type-badge.red { background: rgba(139, 41, 66, 0.25); color: #F9A8BC; }
    :root:not([data-theme="light"]) .journal-wine-type-badge.white { background: rgba(245, 158, 11, 0.15); color: #FDE68A; }
    :root:not([data-theme="light"]) .journal-wine-type-badge.rose { background: rgba(190, 24, 93, 0.18); color: #FDA4AF; }
    :root:not([data-theme="light"]) .journal-wine-type-badge.sparkling { background: rgba(146, 112, 45, 0.2); color: #FDE68A; }

    /* Rating Badges */
    :root:not([data-theme="light"]) .journal-badge.good { background: rgba(34, 197, 94, 0.15); color: #86EFAC; }
    :root:not([data-theme="light"]) .journal-badge.neutral { background: rgba(245, 158, 11, 0.15); color: #FCD34D; }
    :root:not([data-theme="light"]) .journal-badge.bad { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; }

    /* Delete Dialog */
    :root:not([data-theme="light"]) .journal-delete-icon-wrap { background: rgba(239, 68, 68, 0.15); }
    :root:not([data-theme="light"]) .journal-delete-dialog { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
    :root:not([data-theme="light"]) .journal-modal-delete-btn:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); }
    :root:not([data-theme="light"]) .journal-delete-confirm-btn { background: #EF4444; }
    :root:not([data-theme="light"]) .journal-delete-confirm-btn:hover { background: #DC2626; }

    /* Modal Options */
    :root:not([data-theme="light"]) .journal-modal-option.opt-good { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.25); }
    :root:not([data-theme="light"]) .journal-modal-option.opt-neutral { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.25); }
    :root:not([data-theme="light"]) .journal-modal-option.opt-bad { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); }
}

/* ============================================================
 * LETZTE EMPFEHLUNGEN (Recent Recommendations) v1.0
 * ============================================================ */

/* --- Recent Header (Back + Title) --- */
.journal-recent-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0 8px;
    margin-bottom: 4px;
}

.journal-recent-back-btn {
    background: none;
    border: none;
    color: var(--text-primary, #1a1a2e);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.journal-recent-back-btn:hover {
    background: rgba(0,0,0,0.05);
}

.journal-recent-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    flex: 1;
    margin: 0;
}

.journal-recent-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    background: rgba(0,0,0,0.05);
    padding: 2px 10px;
    border-radius: 12px;
}

/* --- Stats Row: "Letzte" card styling --- */
.journal-stat-recent {
    position: relative;
}

/* --- Session Headers --- */
.journal-recent-session-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0 6px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.journal-recent-session-date {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
}
.journal-recent-session-mode {
    font-size: 0.72rem;
    font-weight: 500;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
}
.journal-recent-session-dish {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
}

/* --- Compact List Items --- */
.journal-recent-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.journal-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px;
    background: var(--bg-card, #ffffff);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    animation: journalRecentFadeIn 0.3s ease both;
}
.journal-recent-item:active {
    transform: scale(0.98);
}

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

.journal-recent-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.journal-recent-item-info {
    flex: 1;
    min-width: 0;
}

.journal-recent-item-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.journal-recent-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.journal-recent-badge-top {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
}

.journal-wine-type-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 4px;
}
.journal-wine-type-badge.red,
.journal-wine-type-badge.rotwein { color: #9f1239; background: rgba(159, 18, 57, 0.08); }
.journal-wine-type-badge.white,
.journal-wine-type-badge.weisswein { color: #a16207; background: rgba(161, 98, 7, 0.08); }
.journal-wine-type-badge.rose { color: #be185d; background: rgba(190, 24, 93, 0.08); }
.journal-wine-type-badge.sparkling { color: #0e7490; background: rgba(14, 116, 144, 0.08); }

.journal-wine-char-badge {
    font-size: 0.7rem;
    color: var(--text-secondary, #6b7280);
}

.journal-recent-price {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
}

.journal-recent-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-left: 6px;
}

/* Rating emoji badge in list (for rated wines) */
.journal-recent-rating-badge {
    font-size: 1rem;
    line-height: 1;
}

/* CTA badge in list (for unrated wines in journal) */
.journal-recent-rate-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    animation: journalRateBadgePulse 2.5s ease-in-out infinite;
}

@keyframes journalRateBadgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.journal-recent-chevron {
    color: var(--text-tertiary, #9ca3af);
}

/* --- Empty State --- */
.journal-recent-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary, #6b7280);
    font-size: 0.95rem;
}

/* --- Safe bottom padding for Recent views (clears fixed bottom nav) --- */
.journal-recent-list {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}
.journal-rec-detail-card {
    margin-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

/* --- Detail View --- */
.journal-rec-date-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary, #6b7280);
    padding: 6px 12px;
    background: rgba(124, 58, 237, 0.06);
    border-radius: 8px;
    margin-bottom: 10px;
}
.journal-rec-date-banner svg { color: #7c3aed; flex-shrink: 0; }

.journal-rec-dish-pill {
    margin-bottom: 12px;
}
.journal-rec-dish-pill span {
    font-size: 0.82rem;
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.journal-rec-detail-card {
    margin-bottom: 16px;
}

/* Profile Warning */
.journal-rec-profile-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: #92400e;
    line-height: 1.4;
}
.journal-rec-profile-warning svg {
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Price date note */
.journal-rec-price-date-note {
    font-size: 0.75rem;
    color: var(--text-tertiary, #9ca3af);
    margin-bottom: 6px;
    font-style: italic;
}

/* Already saved indicator */
.journal-rec-already-saved {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.06);
    border-radius: 10px;
    margin-top: 8px;
}

/* Rating CTA Button (unrated wine in journal) */
.journal-rec-rate-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.journal-rec-rate-cta:active {
    transform: scale(0.97);
    opacity: 0.9;
}
.journal-rec-rate-cta svg {
    color: #fbbf24;
}

/* Rating Status (already rated wine) */
.journal-rec-rating-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(124, 58, 237, 0.04);
    border-radius: 12px;
    margin-top: 8px;
}

.journal-rec-rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.journal-rec-rating-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.journal-rec-rating-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
}

.journal-rec-change-rating-btn {
    background: none;
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #7c3aed;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.journal-rec-change-rating-btn:hover {
    background: rgba(124, 58, 237, 0.06);
}

/* ============================================================
 * DARK MODE — Recent Recommendations
 * ============================================================ */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .journal-recent-back-btn { color: #e5e7eb; }
    :root:not([data-theme="light"]) .journal-recent-back-btn:hover { background: rgba(255,255,255,0.08); }
    :root:not([data-theme="light"]) .journal-recent-title { color: #f3f4f6; }
    :root:not([data-theme="light"]) .journal-recent-count { background: rgba(255,255,255,0.08); color: #9ca3af; }

    :root:not([data-theme="light"]) .journal-recent-session-header { border-bottom-color: rgba(255,255,255,0.06); }
    :root:not([data-theme="light"]) .journal-recent-session-date { color: #e5e7eb; }
    :root:not([data-theme="light"]) .journal-recent-session-mode { background: rgba(167, 139, 250, 0.12); color: #a78bfa; }
    :root:not([data-theme="light"]) .journal-recent-session-dish { color: #9ca3af; }

    :root:not([data-theme="light"]) .journal-recent-item { background: rgba(255,255,255,0.04); }
    :root:not([data-theme="light"]) .journal-recent-item-name { color: #f3f4f6; }

    :root:not([data-theme="light"]) .journal-recent-badge-top { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }

    :root:not([data-theme="light"]) .journal-wine-type-badge.red,
    :root:not([data-theme="light"]) .journal-wine-type-badge.rotwein { color: #fda4af; background: rgba(253, 164, 175, 0.1); }
    :root:not([data-theme="light"]) .journal-wine-type-badge.white,
    :root:not([data-theme="light"]) .journal-wine-type-badge.weisswein { color: #fde68a; background: rgba(253, 230, 138, 0.1); }
    :root:not([data-theme="light"]) .journal-wine-type-badge.rose { color: #f9a8d4; background: rgba(249, 168, 212, 0.1); }
    :root:not([data-theme="light"]) .journal-wine-type-badge.sparkling { color: #67e8f9; background: rgba(103, 232, 249, 0.1); }

    :root:not([data-theme="light"]) .journal-recent-empty { color: #6b7280; }

    :root:not([data-theme="light"]) .journal-recent-rate-badge { color: #a78bfa; background: rgba(167, 139, 250, 0.12); border-color: rgba(167, 139, 250, 0.25); }

    :root:not([data-theme="light"]) .journal-rec-date-banner { background: rgba(167, 139, 250, 0.08); color: #9ca3af; }
    :root:not([data-theme="light"]) .journal-rec-date-banner svg { color: #a78bfa; }

    :root:not([data-theme="light"]) .journal-rec-dish-pill span { color: #a78bfa; background: rgba(167, 139, 250, 0.1); }

    :root:not([data-theme="light"]) .journal-rec-profile-warning { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.2); color: #fbbf24; }
    :root:not([data-theme="light"]) .journal-rec-profile-warning svg { color: #f59e0b; }

    :root:not([data-theme="light"]) .journal-rec-price-date-note { color: #6b7280; }

    :root:not([data-theme="light"]) .journal-rec-already-saved { color: #4ade80; background: rgba(74, 222, 128, 0.08); }

    :root:not([data-theme="light"]) .journal-rec-rate-cta { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); }
    :root:not([data-theme="light"]) .journal-rec-rate-cta svg { color: #fbbf24; }

    :root:not([data-theme="light"]) .journal-rec-rating-status { background: rgba(167, 139, 250, 0.08); }
    :root:not([data-theme="light"]) .journal-rec-rating-label { color: #f3f4f6; }
    :root:not([data-theme="light"]) .journal-rec-change-rating-btn { color: #a78bfa; border-color: rgba(167, 139, 250, 0.25); }
    :root:not([data-theme="light"]) .journal-rec-change-rating-btn:hover { background: rgba(167, 139, 250, 0.1); }
}
