:root {
    --primary-color: #e91e63; /* Ein schönes Pink/Rot */
    --background-color: #fce4ec; /* Sehr helles Pink als Hintergrund */
    --text-color: #333;
    --card-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lato', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    text-align: center;
    overflow-x: hidden;
    margin: 0;
    background-color: #222;
}

.background-slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.bg-slide.active {
    opacity: 1;
}


/* Container für die zentrierte Karte */
.container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    padding-top: 78px;
    z-index: 10;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Die Karte selbst - Briefpapier Look */
.content {
    background-color: #fffcf5; /* Warmes Elfenbein */
    background-image: repeating-linear-gradient(#fffcf5, #fffcf5 31px, #e8e8e8 32px); /* Linien */
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    width: 100%;
    min-height: 400px;
    position: relative;
    margin-bottom: 14px;
    transition: all 0.5s ease-in-out;
}

/* Text Schritte initial ausblenden */
.text-step {
    display: none;
    animation: fadeIn 0.8s ease;
}

.text-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Texte Styling */
.content p {
    margin-bottom: 2rem;
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    line-height: 2rem; /* Muss zum Lineal passen */
    color: #444;
}

.headline {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #b76e79; /* Rosenholz */
    text-align: center;
}

.intro {
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
    line-height: 1.6;
}

/* Controls Area (Buttons + Timer) */
.controls-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Button Container (unten im Brief) */
.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px; /* Abstand zum Text */
    padding-top: 20px;
    border-top: 1px dashed #ddd; /* Schicke Trennlinie */
}

.hidden {
    display: none !important;
}

/* Timer Styling (unten) */
.timer-wrapper {
    background: transparent; /* Kein weißer Hintergrund mehr */
    padding: 10px 20px;
    border-radius: 0;
    text-align: center;
    margin-top: 16px; /* Kompakter Abstand zum Brief/Button */
    box-shadow: none; /* Kein Schatten mehr */
    color: white; /* Weißer Text für Kontrast auf Hintergrundbild */
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); /* Schatten für Lesbarkeit */
}

.timer-label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

#live-timer {
    font-family: 'Lato', monospace; /* Monospace für stabiles Zählen */
    font-size: 1.2rem;
    font-weight: bold;
}
.heart-pulse {
    font-size: 4rem;
    text-align: center;
    margin-top: 2rem;
    animation: pulseHeart 1.5s infinite;
}

.insight-wrap {
    margin-top: 0.2rem;
    display: grid;
    gap: 12px;
    text-align: left;
}

.insight-card {
    border: 1px solid rgba(183, 110, 121, 0.26);
    border-left: 3px solid rgba(183, 110, 121, 0.45);
    border-radius: 14px;
    padding: 14px 14px 12px;
    background: rgba(255, 252, 245, 0.95);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.insight-title {
    margin: 0 0 8px;
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: #b44369;
}

.insight-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.insight-list li {
    font-size: 1rem;
    line-height: 1.55;
    color: #4a4a4a;
}

.brief-reflection-access {
    margin: 2px 0 6px;
    padding-top: 4px;
    border-top: 1px dashed #e7d6db;
    display: grid;
    gap: 10px;
}

.brief-reflection-toggle {
    width: fit-content;
    margin: 0 auto;
    padding-inline: 16px;
}

.brief-reflection-panel {
    width: 100%;
}

@keyframes pulseHeart {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.visit-counter {
    margin-top: 15px; /* Etwas Abstand zum Timer */
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Lato', sans-serif;
    display: block; /* Eigene Zeile erzwingen */
    text-align: center;
}

/* --- Top Controls Container --- */
.top-controls {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: min(600px, calc(100vw - 24px));
    box-sizing: border-box;
    z-index: 1000;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
}

/* Shared Button Styles */
.control-btn {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4); /* Dünnerer Rand */
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.8);
}

/* gallery specific */
.gallery-btn {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: rgba(233, 30, 99, 0.28);
    border-color: rgba(255, 255, 255, 0.62);
    color: #fff;
}

.gallery-btn:hover {
    background: rgba(233, 30, 99, 0.42);
    border-color: rgba(255, 255, 255, 0.82);
}

/* audio specific */
.audio-btn {
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.84rem;
    font-weight: 600;
    min-height: 38px;
}

/* Entferne alte Styles falls vorhanden, um Konflikte zu vermeiden */
/* (Dies überschreibt die vorherigen .audio-btn und .gallery-btn Regeln durch Kaskade, da am Ende) */

/* Gallery Modal Styling */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    z-index: 200; /* Über allem anderen */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto; /* Scrollbar erlauben falls nötig */
    padding: 14px;
    box-sizing: border-box;
}

/* Versteckt Klasse */
.gallery-modal.hidden {
    display: none;
}

.gallery-content {
    background: rgba(22, 22, 24, 0.96);
    width: min(980px, 96vw);
    max-height: min(92vh, 900px);
    padding: 16px 14px 14px;
    border-radius: 16px;
    overflow-y: auto;
    position: relative;
    color: white;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}

.gallery-content h2 {
    font-family: 'Playfair Display', serif;
    margin: 2px 0 14px;
    font-size: 1.55rem;
    color: #fffcf5;
}

.close-gallery {
    position: absolute;
    top: 6px;
    right: 12px;
    font-size: 1.8rem;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s;
    line-height: 1;
}

.close-gallery:hover {
    color: white;
}

/* Grid Layout für Bilder */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    
    /* Schutz vor Download */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none; /* Deaktiviert Rechtsklick und Drag auf das Bild */
}

.gallery-item:not(.blurred):hover img {
    transform: scale(1.06); /* Zoom nur bei klaren Bildern */
}

/* Blur Effekt für bestimmte Bilder */
.gallery-item.blurred img {
    filter: blur(10px);
    pointer-events: none; /* Verhindert Interaktion/Rechtsklick um das Blurren zu umgehen */
}

/* GLOBALER BILDERSCHUTZ - Auch Hintergrundbilder etc */
img {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none; /* Brutal aber effektiv für reinen "Look" Content */
}

/* Ausnahmen für interaktive Elemente falls nötig */
button img, a img {
    pointer-events: auto; /* Falls Icons in Buttons klickbar sein müssen */
}



/* Dezent dekorative Blumen/Herzen in den Ecken */
.content::before,
.content::after {
    content: '🌹'; /* Simpel und effektiv: Rosen-Emoji als Deko */
    position: absolute;
    font-size: 5rem; /* Größer */
    opacity: 0.8; /* Deutlich sichtbarer */
    pointer-events: none;
    z-index: 0;
}

.content::before {
    top: -15px;
    left: -10px;
    transform: rotate(-30deg);
}

.content::after {
    bottom: -15px;
    right: -10px;
    transform: rotate(20deg);
}

/* Inhalt muss über den Rosen liegen */
.content h1, 
.content p, 
.content button, 
.content div {
    position: relative;
    z-index: 1;
}

/* Alternative: Feine Blumen-SVG Hintergrund */
.content {
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(233, 30, 99, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 90%, rgba(233, 30, 99, 0.03) 0%, transparent 20%);
}

.headline {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.intro {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
}

/* Button Styling */
.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.nav-btn {
    padding: 8px 25px; /* Schmaler (weniger Höhe) */
    font-size: 0.9rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.5px; /* Modern: Leichter Abstand */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    font-weight: 400;
}

.nav-btn.primary {
    background: #e91e63; 
    background: linear-gradient(135deg, #e91e63, #d81b60);
    color: white;
    box-shadow: 0 3px 10px rgba(233, 30, 99, 0.2); /* Subtiler, moderner Schatten */
}

.nav-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.3);
}

.nav-btn.secondary {
    background-color: transparent;
    color: #777;
    border-color: #ddd; /* Sehr dünner, dezenter Rahmen */
}

.nav-btn.secondary:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: rgba(233, 30, 99, 0.05);
}

.nav-btn .icon {
    font-size: 1.1em;
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Text Steps Styling */
.text-container {
    text-align: left;
    margin-top: 20px;
}

.text-step {
    display: none; /* Initially hidden */
    animation: fadeIn 0.8s ease-out forwards;
}

.text-step.active {
    display: block;
}

.text-step p {
    margin-bottom: 1.2rem;
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    line-height: 2rem; /* Angepasst an Papierlinien */
    color: #444;
}

.signature {
    margin-top: 30px;
    font-weight: bold;
    font-style: italic;
    color: var(--primary-color);
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
}

.no-ai-note {
    font-size: 0.9rem;
    color: #999;
    margin-top: 5px; /* Etwas näher an den Namen rücken */
    font-weight: normal;
    font-style: normal;
    display: block; /* Damit es eine neue Zeile ist */
    text-align: center; /* Zentriert */
    width: 100%;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.5px;
}

/* Lebendiges Herz am Ende */
.heart-pulse {
    font-size: 2rem;
    margin-top: 30px;
    text-align: center;
    animation: heartbeat 2s infinite ease-in-out;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Optimierung */
@media (max-width: 480px) {
    .headline {
        font-size: 2.5rem;
    }
    .content {
        padding: 30px 15px;
    }
}
/* --- LOGIN SCREEN --- */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/bg-sand.jpg') no-repeat center center/cover;
    z-index: 99999; /* Ganz oben */
    display: flex;
    justify-content: center;
    align-items: center;
}

#login-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px); /* Blur Effekt */
}

.login-container {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-container h1 {
    font-family: 'Playfair Display', serif;
    color: #b76e79;
    margin-bottom: 20px;
}

.login-container p {
    font-family: 'Lato', sans-serif;
    color: #555;
    margin-bottom: 20px;
}

.login-container .hint {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#password-input {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
    text-align: center;
}

#password-input:focus {
    border-color: #b76e79;
}

#login-btn {
    padding: 12px;
    background: #b76e79;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

#login-btn:hover {
    background: #a05a65;
}

.error-msg {
    color: #d32f2f;
    margin-top: 15px;
    font-size: 0.9rem;
    display: none;
}
.error-msg.visible {
    display: block;
}

.login-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    font-size: 0.9rem;
    color: #7a5860;
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid rgba(183, 110, 121, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.login-back-link:hover {
    color: #b76e79;
    border-color: rgba(183, 110, 121, 0.6);
    background: rgba(255, 255, 255, 0.92);
}


@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}


/* --- ZOOM MODAL --- */
.zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 20000; /* �ber allem, auch �ber Login (wenn ausgeloggt auch egal) */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    opacity: 0;
    pointer-events: none; /* Erst klickbar wenn sichtbar */
    transition: opacity 0.3s ease;
}

.zoom-modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.zoom-modal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    border-radius: 4px;
    /* Auch im Zoom kein Drag/Select */
    user-select: none;
    pointer-events: none; 
}

.close-zoom {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    z-index: 20001;
    opacity: 0.7;
    transition: opacity 0.2s;
}

/* --- DIARY ACCESS SECTION (Middle of Page) --- */
.diary-section {
    text-align: center;
    margin: 12px auto 10px auto; /* Kompakter zwischen Brief und Counter */
    animation: fadeIn 3s ease;
    position: relative;
    z-index: 100;
}

.diary-btn-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.7); /* Transparenter */
    backdrop-filter: blur(4px);
    color: #555; /* Dezentere Farbe */
    padding: 8px 20px;
    border-radius: 5px; /* Weniger rund */
    text-decoration: none;
    font-family: 'Lato', sans-serif; /* Weniger verspielt */
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    font-weight: 400;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background 0.3s, color 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.diary-btn-main:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.diary-btn-main .icon {
    font-size: 1rem;
    animation: none; /* Kein Pulsieren mehr */
}

/* Hint removed */

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.close-zoom:hover {
    opacity: 1;
}

/* Cursor f�r Galerie Items anpassen */
.gallery-item {
    cursor: zoom-in;
}


/* --- BULLET JOURNAL (DIARY) --- */
.diary-container {
    max-width: 860px;
    margin: 50px auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: left;
}

.diary-header {
    text-align: center;
    margin-bottom: 30px;
}

.diary-header-top {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 90px;
    align-items: center;
    gap: 14px;
}

.diary-header-text {
    min-width: 0;
}

.diary-header-avatar {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(233, 30, 99, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.diary-header h1 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.diary-topbar {
    width: min(860px, calc(100% - 40px));
    margin: 24px auto 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.diary-topbar-link {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.diary-topbar-link:hover {
    color: var(--primary-color);
}

.diary-topbar-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #666;
}

.diary-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.new-entry-btn,
.save-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 999px;
    font-size: 0.95rem;
    min-height: 42px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.memory-map-btn {
    margin-left: 0;
}

.new-entry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 200px;
}

.diary-controls .new-entry-btn {
    min-width: 188px;
    min-height: 38px;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 0.88rem;
    border: 1px solid rgba(233, 30, 99, 0.36);
    box-shadow: 0 4px 10px rgba(233, 30, 99, 0.16);
}

.diary-controls .new-entry-btn:hover {
    box-shadow: 0 6px 14px rgba(233, 30, 99, 0.22);
}

.diary-controls .memory-map-btn {
    background: #fff;
    color: var(--primary-color);
    border: 1px solid rgba(233, 30, 99, 0.42);
    box-shadow: none;
}

.diary-controls .memory-map-btn:hover {
    background: rgba(233, 30, 99, 0.08);
}

.new-entry-btn:hover,
.save-btn:hover {
    background-color: #d81b60;
    transform: translateY(-1px);
}

.entry-tools {
    margin: 0 0 14px;
    padding: 7px;
    border: 1px solid #ececec;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 6px;
}

.entry-tool-block {
    border: 0;
    border-radius: 8px;
    background: transparent;
    padding: 4px;
}

.entry-tool-block-search {
    grid-column: 1 / span 2;
}

.entry-tool-title {
    display: none;
}

.entry-search-row,
.entry-date-row,
.entry-view-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.entry-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 138px;
}

.entry-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-items: end;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#entry-search-input,
#entry-type-filter,
#entry-date-from,
#entry-date-to {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 0.76rem;
    background: #fff;
    height: 34px;
}

#entry-search-input {
    min-width: 0;
}

.entry-date-row label {
    font-size: 0.74rem;
    color: #666;
    min-width: 0;
    font-weight: 600;
}

.entry-view-row .memory-filter-btn {
    font-size: 0.72rem;
    padding: 0 9px;
    height: 34px;
    min-width: 120px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
}

.entry-view-row .memory-filter-btn.active {
    background: rgba(233, 30, 99, 0.08);
}

.diary-entry {
    position: relative;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding: 0 42px 20px 0;
}

.entry-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

.action-btn:hover {
    opacity: 1;
}

.btn-delete { color: #e53935; }
.btn-edit { color: #fb8c00; }
.btn-favorite { color: #f5b300; }
.btn-favorite.active {
    opacity: 1;
}

.diary-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
}

.diary-content {
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    white-space: normal;
}

.diary-content a[href^="#memory-"] {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(233, 30, 99, 0.26);
    background: rgba(233, 30, 99, 0.08);
    color: #a81856;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
}

.diary-content a[href^="#memory-"]:hover {
    background: rgba(233, 30, 99, 0.14);
    border-color: rgba(233, 30, 99, 0.45);
}

.diary-content img {
    max-width: 100%;
    height: auto;
}

.timeline-list {
    margin-top: 4px;
}

.timeline-group {
    margin-bottom: 14px;
}

.timeline-group h4 {
    font-size: 0.86rem;
    color: #666;
    margin-bottom: 8px;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-item {
    border: 1px solid #ececec;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
    cursor: pointer;
    display: grid;
    grid-template-columns: 14px auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    text-align: left;
}

.timeline-item:hover {
    border-color: var(--primary-color);
}

.timeline-dot {
    grid-row: 1 / span 2;
    width: 10px;
    height: 10px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--primary-color);
}

.timeline-meta {
    font-size: 0.72rem;
    color: #777;
}

.timeline-text {
    font-size: 0.84rem;
    color: #444;
}

.timeline-empty {
    font-size: 0.84rem;
    color: #777;
    margin: 8px 0 0;
}

.entry-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.entry-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.entry-modal-content {
    background: #fff;
    width: min(900px, 92vw);
    padding: 28px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin-bottom: 16px;
    text-align: center;
}

.editor-container {
    min-height: 320px;
    background: #fff;
    font-family: 'Lato', sans-serif;
}

.editor-container .ql-toolbar.ql-snow {
    border-radius: 10px 10px 0 0;
    border-color: #e7e7e7;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.editor-container .ql-toolbar .ql-formats {
    margin-right: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.editor-container .ql-container.ql-snow {
    border-color: #e7e7e7;
    border-radius: 0 0 10px 10px;
    min-height: 260px;
}

.editor-container .ql-editor img {
    pointer-events: auto !important;
    user-select: auto;
    -webkit-user-select: auto;
    cursor: pointer;
}

.image-resize-controls {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #666;
}

#image-size-range {
    width: 180px;
}

#image-size-value {
    min-width: 44px;
    text-align: right;
    font-weight: 600;
    color: #555;
}

.image-layout-controls {
    margin-top: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.marker-link-controls {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.marker-link-controls label {
    font-size: 0.82rem;
    color: #666;
}

#marker-link-select {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.8rem;
    background: #fff;
}

.layout-label {
    font-size: 0.82rem;
    color: #666;
    margin-right: 4px;
}

.layout-btn {
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    cursor: pointer;
}

.layout-btn:hover,
.layout-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.delete-entry-btn {
    background-color: #e53935;
}

.delete-entry-btn:hover {
    background-color: #c62828;
}

.map-modal-content {
    width: min(980px, 94vw);
}

.map-modal-content.map-only {
    width: 100vw;
    height: 100dvh;
    height: 100vh;
    max-height: 100dvh;
    max-height: 100vh;
    border-radius: 0;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.map-modal-content.map-only .modal-title,
.map-modal-content.map-only .map-help,
.map-modal-content.map-only .marker-panel,
.map-modal-content.map-only .toggle-marker-form-btn {
    display: none;
}

.map-modal-content.map-only .map-control-row {
    justify-content: flex-end;
    flex: 0 0 auto;
    padding-right: 36px;
}

.map-modal-content.map-only .memory-map-stage {
    flex: 1 1 auto;
    min-height: 0;
}

.memory-map {
    width: 100%;
    height: 360px;
    border-radius: 10px;
    border: 1px solid #e4e4e4;
}

.memory-map-stage {
    position: relative;
    margin-top: 8px;
}

.memory-map .leaflet-top {
    top: auto;
    bottom: 10px;
}

.memory-map .leaflet-left {
    left: 10px;
}

.memory-map .leaflet-top .leaflet-control {
    margin-top: 0;
    margin-bottom: 0;
}

.memory-map .leaflet-control-zoom {
    display: flex;
    flex-direction: row;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
}

.memory-map .leaflet-control-zoom a {
    width: 26px;
    height: 26px;
    line-height: 24px;
    font-size: 14px;
}

.memory-map .leaflet-control-zoom a.leaflet-control-zoom-in {
    border-bottom: 0;
    border-right: 1px solid #ccc;
}

.map-modal-content.map-only .memory-map {
    height: 100%;
    border-radius: 8px;
}

.map-help {
    margin-top: 10px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: #666;
}

.memory-filter-bar {
    position: absolute;
    top: 64px;
    left: 10px;
    z-index: 450;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100% - 74px);
    overflow-y: auto;
    padding: 7px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.map-mini-layer-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 460;
    min-width: 104px;
}

.memory-filter-btn {
    border: 1px solid #ddd;
    background: rgba(255, 255, 255, 0.58);
    color: #555;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.72rem;
    min-height: 28px;
    min-width: 86px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
}

.memory-filter-btn:hover,
.memory-filter-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.84);
}

.map-control-row .memory-filter-btn.active {
    background: rgba(233, 30, 99, 0.08);
}

#map-layer-toggle-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(233, 30, 99, 0.08);
}

.map-control-row {
    margin-top: 12px;
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
    flex-wrap: wrap;
        grid-template-columns: 1fr 1fr;

.map-control-btn {
    padding: 7px 14px;
    font-size: 0.8rem;
    min-height: 34px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

        font-size: 0.72rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    transform: translateY(-1px);
}

.marker-panel {
    margin-top: 14px;
}

.marker-list-panel {
    margin-top: 14px;
}

.marker-form {
    margin-top: 12px;
}

.marker-grid {
    display: grid;
    grid-template-columns: 1fr 170px;
    gap: 8px;
}

.marker-grid input,
#marker-note,
#marker-photo,
#marker-category {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: 'Lato', sans-serif;
}

.marker-grid-secondary {
    margin-top: 8px;
}

.marker-favorite-row {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #666;
}

#marker-note {
    margin-top: 8px;
    min-height: 88px;
    resize: vertical;
}

.marker-photo-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.photo-name {
    font-size: 0.75rem;
    color: #777;
}

.marker-actions {
    justify-content: flex-end;
}

.memory-popup {
    max-width: 220px;
}

.memory-popup img {
    width: 100%;
    margin-top: 6px;
    border-radius: 6px;
}

.memory-category-tag {
    display: inline-block;
    font-size: 0.72rem;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    color: #fff;
}

.custom-memory-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.2);
}

.custom-memory-marker.favorite {
    box-shadow: 0 0 0 2px rgba(245, 179, 0, 0.45);
}

.memory-favorite-badge {
    display: inline-block;
    margin-top: 4px;
    margin-right: 6px;
    font-size: 0.72rem;
    color: #8a6500;
    background: rgba(245, 179, 0, 0.2);
    border-radius: 999px;
    padding: 2px 8px;
}

.memory-list-wrapper {
    margin-top: 14px;
    border-top: 1px solid #ececec;
    padding-top: 10px;
}

.memory-list-wrapper h4 {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 8px;
}

.memory-category-group {
    margin-bottom: 10px;
}

.memory-category-title {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.memory-category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.memory-category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.memory-chip {
    border: 1px solid #e5e5e5;
    background: #fafafa;
    color: #444;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.76rem;
    cursor: pointer;
}

.memory-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.diary-backup-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: -6px 0 8px;
}

#backup-btn {
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid #e4e4e4;
    border-radius: 999px;
    color: #777;
    cursor: pointer;
    font-size: 0.72rem;
    padding: 4px 9px;
    line-height: 1;
    transition: all 0.2s ease;
}

#backup-btn:hover {
    color: var(--primary-color);
    border-color: rgba(233, 30, 99, 0.4);
    background: rgba(233, 30, 99, 0.07);
}

#restore-btn {
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid #e4e4e4;
    border-radius: 999px;
    color: #777;
    cursor: pointer;
    font-size: 0.72rem;
    padding: 4px 9px;
    line-height: 1;
    transition: all 0.2s ease;
}

#restore-btn:hover {
    color: var(--primary-color);
    border-color: rgba(233, 30, 99, 0.4);
    background: rgba(233, 30, 99, 0.07);
}

.diary-footer {
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.back-link:hover {
    border-color: #666;
}

@media (max-width: 640px) {
    .diary-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* --- GLOBAL MOBILE OPTIMIZATION --- */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 14px;
    }

    .content {
        padding: 26px 18px;
        margin-bottom: 10px;
    }

    .headline {
        font-size: 2.1rem;
    }

    .content p,
    .text-step p {
        font-size: 1.35rem;
        line-height: 1.7rem;
        margin-bottom: 1.2rem;
    }

    .button-container {
        margin-top: 18px;
        padding-top: 14px;
        gap: 10px;
    }

    .diary-section {
        margin: 8px auto 8px auto;
    }

    .timer-wrapper {
        margin-top: 10px;
        padding: 6px 10px;
    }

    #live-timer {
        font-size: 1rem;
        padding: 8px 12px;
    }

    .visit-counter {
        margin-top: 8px;
        font-size: 0.8rem;
    }

    .diary-topbar,
    .diary-container {
        width: calc(100% - 20px);
    }

    .diary-container {
        margin: 14px auto;
        padding: 20px 14px;
    }

    .diary-header {
        margin-bottom: 18px;
    }

    .diary-header-top {
        grid-template-columns: 70px minmax(0, 1fr) 70px;
        gap: 10px;
    }

    .diary-header-avatar {
        width: 70px;
        height: 70px;
    }

    .entry-modal-content {
        width: calc(100% - 14px);
        padding: 16px 12px;
        max-height: 92vh;
    }

    .editor-container {
        min-height: 250px;
    }

    .editor-container .ql-container.ql-snow {
        min-height: 190px;
    }

    .editor-container .ql-toolbar.ql-snow {
        gap: 4px;
        padding: 6px;
    }

    .editor-container .ql-toolbar .ql-formats {
        gap: 2px;
    }

    .modal-actions {
        margin-top: 12px;
        gap: 8px;
    }

    .entry-tools {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 6px;
    }

    .diary-controls .new-entry-btn {
        min-width: 0;
        flex: 1 1 100%;
        min-height: 34px;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .entry-tool-block {
        padding: 2px;
    }

    .entry-tool-block-search {
        grid-column: auto;
    }

    .entry-date-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .entry-search-row {
        grid-template-columns: 1fr;
    }

    #entry-search-input,
    #entry-type-filter,
    #entry-date-from,
    #entry-date-to {
        font-size: 0.7rem;
        padding: 0 8px;
        height: 28px;
    }

    .entry-view-row .memory-filter-btn {
        min-width: 0;
        flex: 1 1 auto;
        font-size: 0.68rem;
        height: 28px;
    }

    .diary-backup-section {
        justify-content: center;
        gap: 5px;
        margin: -2px 0 6px;
    }

    #backup-btn,
    #restore-btn {
        font-size: 0.66rem;
        padding: 4px 7px;
    }

    .image-resize-controls {
        flex-wrap: wrap;
        gap: 6px;
    }

    .image-layout-controls {
        gap: 5px;
    }

    .marker-link-controls {
        gap: 6px;
    }

    .marker-grid {
        grid-template-columns: 1fr;
    }

    .memory-category-items {
        gap: 5px;
    }

    .memory-filter-bar {
        position: static;
        margin-top: 10px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
        max-height: none;
        overflow: visible;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
    }

    .memory-filter-btn {
        font-size: 0.72rem;
        padding: 4px 8px;
    }

    .map-control-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .map-control-btn {
        flex: 1 1 calc(50% - 6px);
        min-height: 36px;
    }

    .memory-chip {
        font-size: 0.72rem;
        padding: 4px 8px;
    }

    .memory-map {
        height: 300px;
    }

    .map-modal-content.map-only .memory-map {
        height: 100%;
    }

    .marker-photo-row {
        flex-direction: column;
        align-items: flex-start;
    }

    #image-size-range {
        width: 100%;
        max-width: 220px;
    }
}

@media (max-width: 480px) {
    .top-controls {
        top: 8px;
        left: 8px;
        gap: 6px;
    }

    .gallery-btn {
        font-size: 0.72rem;
        padding: 7px 9px;
    }

    .audio-btn {
        font-size: 0.75rem;
        padding: 7px 10px;
        min-height: 34px;
    }

    .headline {
        font-size: 1.9rem;
    }

    .intro {
        font-size: 1rem;
        margin-bottom: 1.2rem;
    }

    .diary-btn-main {
        font-size: 0.74rem;
        padding: 7px 14px;
    }

    .nav-btn {
        padding: 7px 14px;
        font-size: 0.82rem;
    }

    .diary-topbar {
        margin-top: 10px;
        padding: 10px 12px;
    }

    .diary-topbar-title {
        font-size: 0.9rem;
    }

    .diary-header-top {
        grid-template-columns: 62px minmax(0, 1fr) 62px;
        gap: 8px;
    }

    .diary-header-avatar {
        width: 62px;
        height: 62px;
    }

    .diary-entry {
        padding-right: 0;
        padding-bottom: 14px;
    }

    .entry-actions {
        position: static;
        justify-content: flex-end;
        margin-bottom: 8px;
    }

    .diary-date {
        font-size: 0.78rem;
    }

    .new-entry-btn,
    .save-btn {
        padding: 9px 14px;
        font-size: 0.85rem;
    }

    .close-modal {
        top: 8px;
        right: 10px;
        font-size: 1.35rem;
    }

    .memory-map {
        height: 250px;
    }

    .map-modal-content.map-only .memory-map {
        height: 100%;
    }
}

/* --- FINAL MOBILE CLEANUP OVERRIDES --- */
@media (max-width: 768px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        padding-top: 76px;
    }

    .content {
        width: 100%;
        padding: 20px 14px;
    }

    .content p,
    .text-step p {
        font-size: 1.22rem;
        line-height: 1.55;
    }

    .top-controls {
        top: 8px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(600px, calc(100vw - 16px));
        max-width: calc(100vw - 16px);
        gap: 6px;
        flex-wrap: nowrap;
    }

    .gallery-btn {
        font-size: 0.72rem;
        padding: 7px 9px;
    }

    .audio-btn {
        font-size: 0.72rem;
        padding: 7px 9px;
        min-height: 34px;
    }

    .gallery-content {
        width: calc(100% - 14px);
        max-height: 90vh;
        padding: 12px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .diary-container,
    .diary-topbar {
        width: calc(100% - 14px);
    }

    .diary-controls .new-entry-btn {
        min-width: 0;
        flex: 1 1 100%;
    }

    .diary-header h1 {
        font-size: 2.25rem;
        line-height: 1.12;
        margin-bottom: 8px;
    }

    .entry-tools {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 6px;
    }

    .entry-search-row,
    .entry-date-row {
        grid-template-columns: 1fr;
    }

    .entry-date-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 6px;
    }

    .date-field {
        min-width: 0;
    }

    .entry-view-row .memory-filter-btn {
        flex: 1 1 auto;
        min-width: 0;
        height: 30px;
        font-size: 0.7rem;
        padding: 0 8px;
    }

    .diary-backup-section {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 18px 12px;
    }

    .container {
        padding-top: 88px;
    }

    .headline {
        font-size: 1.75rem;
    }

    .content p,
    .text-step p {
        font-size: 1.1rem;
    }

    .button-container {
        gap: 8px;
    }

    .nav-btn,
    .diary-btn-main {
        font-size: 0.78rem;
        padding: 7px 12px;
    }

    .diary-header-top {
        grid-template-columns: 56px minmax(0, 1fr) 56px;
        gap: 7px;
    }

    .diary-header-avatar {
        width: 56px;
        height: 56px;
    }

    .diary-header h1 {
        font-size: 1.95rem;
        line-height: 1.1;
        margin-bottom: 6px;
    }

    .diary-header-text p {
        font-size: 0.9rem;
        line-height: 1.25;
    }

    #entry-search-input,
    #entry-type-filter,
    #entry-date-from,
    #entry-date-to,
    .entry-view-row .memory-filter-btn {
        height: 30px;
        font-size: 0.7rem;
    }

    .entry-date-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 6px;
    }

    .entry-date-row label {
        font-size: 0.68rem;
    }

    .memory-map {
        height: 240px;
    }
}

@media (min-width: 390px) and (max-width: 768px) {
    .entry-search-row {
        grid-template-columns: minmax(0, 1fr) 124px;
        align-items: center;
    }

    #entry-type-filter {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .gallery-modal {
        padding: 10px;
    }

    .gallery-content {
        width: 100%;
        max-height: 92vh;
        padding: 12px 10px 10px;
        border-radius: 12px;
    }

    .gallery-content h2 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .gallery-item {
        border-radius: 9px;
    }

    .insight-wrap {
        gap: 10px;
    }

    .insight-card {
        border-radius: 12px;
        padding: 11px 10px 10px;
    }

    .insight-title {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .insight-list {
        gap: 5px;
        padding-left: 16px;
    }

    .insight-list li {
        font-size: 0.92rem;
        line-height: 1.4;
    }

    .brief-reflection-access {
        gap: 8px;
    }

    .brief-reflection-toggle {
        width: 100%;
        justify-content: center;
        font-size: 0.8rem;
        padding: 7px 10px;
    }
}

@media (max-width: 420px) {
    .gallery-content {
        padding: 10px 8px 9px;
    }

    .close-gallery {
        top: 4px;
        right: 9px;
        font-size: 1.55rem;
    }

    .gallery-grid {
        gap: 7px;
    }
}
