* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Elegant journal palette (warm off-whites, beiges, dark ink, gold accent) */
    --ink: #1a1f2e;
    --ink-soft: #2c3344;
    --gold: #b8860b;
    --gold-soft: #c9a962;
    --bg-warm: #f8f6f2;
    --bg-cream: #f5f2eb;
    --bg-paper: #faf9f6;
    --border-warm: #e8e4dc;
    --border-gold: rgba(184, 134, 11, 0.25);
    --card-bg: #ffffff;
    --primary-color: #1a1f2e;
    --primary-hover: #2c3344;
    --accent-color: #b8860b;
    --danger-color: #a0522d;
    --success-color: #4a7c59;
    --text-primary: #1a1f2e;
    --text-secondary: #5c5c5c;
    --border-color: #e8e4dc;
    --secondary-color: #c9a962;
    --shadow: 0 2px 12px rgba(26, 31, 46, 0.08);
    --shadow-lg: 0 8px 32px rgba(26, 31, 46, 0.12);
    --card-shadow: 0 4px 20px rgba(26, 31, 46, 0.06);
    /* Mood accents (referenced by mood buttons) */
    --mood-great: #51cf66;
    --mood-good: #339af0;
    --mood-ok: #ffd43b;
    --mood-anxious: #ff6b6b;
    --mood-low: #9775fa;
    --mood-not: #e67700;
}

/* Dark theme */
[data-theme="dark"] {
    --ink: #e8e6e1;
    --ink-soft: #c9c6bf;
    --gold: #d4a84b;
    --gold-soft: #c9a962;
    --bg-warm: #1a1c1e;
    --bg-cream: #222428;
    --bg-paper: #25272b;
    --border-warm: #3a3d42;
    --border-gold: rgba(212, 168, 75, 0.3);
    --card-bg: #2c2f34;
    --primary-color: #e8e6e1;
    --primary-hover: #c9c6bf;
    --accent-color: #d4a84b;
    --danger-color: #e07a6e;
    --success-color: #7bc98c;
    --text-primary: #e8e6e1;
    --text-secondary: #9ca3af;
    --border-color: #3a3d42;
    --secondary-color: #c9a962;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    --mood-great: #69db7c;
    --mood-good: #4dabf7;
    --mood-ok: #ffd43b;
    --mood-anxious: #ff8787;
    --mood-low: #b197fc;
    --mood-not: #f59f00;
}

[data-theme="dark"] body {
    background-image:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(34, 36, 40, 0.95) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-cream) 100%);
}

[data-theme="dark"] .header {
    background: linear-gradient(180deg, var(--bg-paper) 0%, var(--bg-cream) 100%);
}

[data-theme="dark"] .pet-selector select,
[data-theme="dark"] .filters select,
[data-theme="dark"] .notifications-time-input {
    background: var(--card-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .mood-btn.selected {
    background: linear-gradient(135deg, rgba(212, 168, 75, 0.2) 0%, rgba(201, 169, 98, 0.15) 100%);
}

[data-theme="dark"] .logged-message {
    background: linear-gradient(135deg, rgba(123, 201, 140, 0.25) 0%, rgba(81, 207, 102, 0.2) 100%);
    border-color: var(--mood-great);
}

[data-theme="dark"] .logged-message p {
    color: var(--text-primary);
}

[data-theme="dark"] .pixels-day.no-entry {
    background: var(--border-warm);
    border-color: var(--border-color);
    opacity: 0.6;
}

[data-theme="dark"] .phone-screen {
    background: var(--card-bg);
    border-color: #1a1c1e;
}

[data-theme="dark"] .mockup-mood {
    background: var(--bg-cream);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .mockup-mood.selected {
    background: rgba(212, 168, 75, 0.25);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

/* Dark mode: Notable Day, Insights, Tag summary, Pixels calendar, Settings notebook/tag listings */
[data-theme="dark"] .notable-label {
    background: linear-gradient(135deg, rgba(212, 168, 75, 0.15) 0%, rgba(201, 169, 98, 0.1) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .notable-label:hover {
    background: linear-gradient(135deg, rgba(212, 168, 75, 0.22) 0%, rgba(201, 169, 98, 0.15) 100%);
}

[data-theme="dark"] .weekly-sentence-box {
    background: linear-gradient(135deg, rgba(212, 168, 75, 0.2) 0%, rgba(201, 169, 98, 0.15) 100%);
    border-color: var(--accent-color);
}

[data-theme="dark"] .weekly-mood-sentence,
[data-theme="dark"] .insight-box p {
    color: var(--text-primary);
}

[data-theme="dark"] .tag-correlation {
    background: linear-gradient(135deg, rgba(212, 168, 75, 0.12) 0%, rgba(201, 169, 98, 0.08) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .tag-correlation:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .tag-correlation strong {
    color: var(--text-primary);
}

[data-theme="dark"] .pixels-view-box {
    background: linear-gradient(135deg, rgba(212, 168, 75, 0.12) 0%, rgba(201, 169, 98, 0.08) 100%);
}

[data-theme="dark"] .pixels-month-year,
[data-theme="dark"] .pixels-day-label,
[data-theme="dark"] .pixels-legend-item {
    color: var(--text-primary);
}

[data-theme="dark"] .pixels-day {
    background: var(--border-warm);
    border: 2px solid var(--border-color);
}

[data-theme="dark"] .pixels-day.has-entry {
    background: linear-gradient(135deg, rgba(212, 168, 75, 0.25) 0%, rgba(201, 169, 98, 0.2) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .pet-item,
[data-theme="dark"] .tag-item {
    background: linear-gradient(135deg, rgba(212, 168, 75, 0.12) 0%, rgba(201, 169, 98, 0.08) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .pet-item:hover,
[data-theme="dark"] .tag-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .pet-item span,
[data-theme="dark"] .tag-item span {
    color: var(--text-primary);
}

[data-theme="dark"] .pet-avatar-placeholder {
    background: linear-gradient(135deg, rgba(212, 168, 75, 0.2) 0%, rgba(201, 169, 98, 0.15) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .pet-personality-text {
    background: linear-gradient(135deg, rgba(212, 168, 75, 0.12) 0%, rgba(201, 169, 98, 0.08) 100%);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* Theme toggle — subtle, fixed corner (bottom-right to avoid header/login) */
.theme-toggle {
    position: fixed;
    bottom: 5rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
    z-index: 1001;
}

[data-theme="light"] .theme-toggle {
    color: var(--ink);
    border-color: var(--ink-soft);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(26, 31, 46, 0.15);
}

.theme-toggle:hover {
    opacity: 1;
    color: var(--accent-color);
    transform: scale(1.05);
}

.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

body {
    font-family: 'Lora', 'Cormorant Garamond', Georgia, serif;
    background: var(--bg-warm);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(245, 242, 235, 0.9) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-cream) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.65;
    padding-bottom: 160px;
    min-height: 100vh;
}

body.show-app {
    padding-bottom: 160px;
}

body.show-landing {
    padding-bottom: 0;
}

/* Header */
.header {
    background: linear-gradient(180deg, var(--bg-paper) 0%, var(--bg-cream) 100%);
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 0 var(--border-warm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.header-logo {
    height: 55px;
    width: auto;
    display: block;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.header-logo:hover {
    opacity: 0.8;
}

.header-taglines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header-tagline-main {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    line-height: 1.3;
    font-family: 'Lora', Georgia, serif;
}

.header-tagline-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
    font-style: italic;
}

/* Birthday Celebration */
.birthday-celebration {
    background: linear-gradient(135deg, var(--bg-paper) 0%, var(--bg-cream) 100%);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 8px 24px rgba(26, 31, 46, 0.1);
    animation: birthdayBurst 0.6s ease;
}

@keyframes birthdayBurst {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.birthday-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.birthday-logo {
    height: 120px;
    width: auto;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.birthday-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.birthday-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.pet-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0;
}

/* Desktop header layout */
@media (min-width: 768px) {
    .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
    }
    
    .header-logo {
        height: 50px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .pet-selector {
        flex: 0 0 auto;
        min-width: 200px;
        max-width: 300px;
    }
    
    .pet-selector select {
        min-width: 150px;
    }
}

.pet-selector select {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pet-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.1);
}

/* Screens */
.screen {
    display: none;
    min-height: calc(100vh - 70px);
}

.screen.active {
    display: block;
}

.content {
    padding: 1.5rem 1.25rem;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background: var(--bg-paper);
    border-radius: 0;
}

@media (min-width: 1200px) {
    .content {
        max-width: 92%;
        padding: 2rem 3rem;
    }
}

/* Date Header */
.date-header {
    margin-bottom: 1.5rem;
}

.date-header h2 {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
    font-weight: 600;
    font-family: 'Lora', Georgia, serif;
}

.date-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.streak-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0 0;
    font-weight: 500;
    opacity: 0.75;
    font-style: italic;
}

/* Mood Grid */
.mood-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.mood-btn {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 20px;
    padding: 1.25rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.2;
    position: relative;
    overflow: hidden;
}

.mood-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.06) 0%, rgba(201, 169, 98, 0.06) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mood-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(26, 31, 46, 0.12);
}

.mood-btn:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.06) 0%, rgba(201, 169, 98, 0.06) 100%);
}

.mood-btn.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    box-shadow: 0 8px 24px rgba(26, 31, 46, 0.1);
    transform: scale(1.05);
}

.mood-btn.selected::before {
    opacity: 1;
}

.mood-btn[data-mood="great"]:hover,
.mood-btn[data-mood="great"].selected {
    border-color: var(--mood-great);
    background: linear-gradient(135deg, #d3f9d8 0%, #b2f2bb 100%);
}

.mood-btn[data-mood="good"]:hover,
.mood-btn[data-mood="good"].selected {
    border-color: var(--mood-good);
    background: linear-gradient(135deg, #d0ebff 0%, #a5d8ff 100%);
}

.mood-btn[data-mood="ok"]:hover,
.mood-btn[data-mood="ok"].selected {
    border-color: var(--mood-ok);
    background: linear-gradient(135deg, #fff9db 0%, #ffec99 100%);
}

.mood-btn[data-mood="anxious"]:hover,
.mood-btn[data-mood="anxious"].selected {
    border-color: var(--mood-anxious);
    background: linear-gradient(135deg, #ffe3e3 0%, #ffc9c9 100%);
}

.mood-btn[data-mood="low"]:hover,
.mood-btn[data-mood="low"].selected {
    border-color: var(--mood-low);
    background: linear-gradient(135deg, #e7dbff 0%, #d0bfff 100%);
}

.mood-btn[data-mood="not-themselves"]:hover,
.mood-btn[data-mood="not-themselves"].selected {
    border-color: var(--mood-not);
    background: linear-gradient(135deg, #ffe8cc 0%, #ffd8a8 100%);
}

.mood-btn .emoji {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.mood-btn:hover .emoji {
    transform: scale(1.1) rotate(5deg);
}

.mood-btn .label {
    font-size: 0.85rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    color: var(--text-primary);
}

.mood-btn-expand {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 1.25rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0.7;
}

.mood-btn-expand:hover {
    border-color: var(--primary-color);
    border-style: solid;
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 31, 46, 0.08);
}

.mood-btn-expand .expand-icon {
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.mood-btn-expand:hover .expand-icon {
    transform: rotate(90deg) scale(1.1);
    color: var(--primary-color);
}

.mood-btn-expand .label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.mood-btn-expand:hover .label {
    color: var(--primary-color);
}

/* Emoji Picker */
.emoji-picker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    max-height: 70vh;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3000;
    overflow: hidden;
}

.emoji-picker.active {
    transform: translateY(0);
}

.emoji-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    flex-shrink: 0;
}

.emoji-picker-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.emoji-picker-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.emoji-picker-close:hover {
    background: rgba(184, 134, 11, 0.12);
    color: var(--primary-color);
    transform: rotate(90deg);
}

.emoji-picker-content {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1rem;
    flex: 1;
    width: 100%;
}

.emoji-category {
    margin-bottom: 2rem;
}

.emoji-category:last-child {
    margin-bottom: 1rem;
}

.emoji-category-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

.emoji-option {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc((100% - 3.5rem) / 8);
    aspect-ratio: 1;
    flex-shrink: 0;
}

.emoji-option:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(26, 31, 46, 0.08);
    z-index: 1;
}

/* Responsive emoji grid */
@media (max-width: 480px) {
    .emoji-option {
        width: calc((100% - 2.5rem) / 6);
        padding: 0.5rem;
        font-size: 1.3rem;
    }
    
    .emoji-picker-content {
        padding: 1rem 0.75rem;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .emoji-option {
        width: calc((100% - 3.5rem) / 8);
    }
}

@media (min-width: 768px) {
    .emoji-picker {
        left: 50%;
        right: auto;
        max-width: min(90vw, 800px);
        transform: translate(-50%, 100%);
    }
    
    .emoji-picker.active {
        transform: translate(-50%, 0);
    }
    
    .emoji-option {
        width: calc((100% - 4.5rem) / 10);
    }
    
    .emoji-picker-content {
        padding: 1rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .emoji-option {
        width: calc((100% - 5.5rem) / 12);
    }
}

/* Form Sections */
.form-section {
    margin-bottom: 1.5rem;
}

.form-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-section label.notable-label {
    display: flex;
    margin-bottom: 0;
}

.notable-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    cursor: pointer;
    padding: 1rem;
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.notable-label:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    transform: translateX(4px);
}

.notable-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.notable-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.notable-icon {
    font-size: 1.2rem;
}

.notable-main {
    white-space: nowrap;
}

.notable-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-left: auto;
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
}

@media (max-width: 600px) {
    .notable-hint {
        flex-basis: 100%;
        margin-left: 35px;
        text-align: left;
    }
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.form-section textarea,
.form-section input[type="text"] {
    width: 100%;
    max-width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Lora', Georgia, serif;
    resize: vertical;
    background: var(--card-bg);
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-section textarea:focus,
.form-section input[type="text"]:focus {
    outline: none;
    border-color: var(--gold-soft);
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.12);
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag {
    background: var(--bg-cream);
    color: var(--ink);
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-warm);
}

.tag:hover {
    border-color: var(--gold-soft);
    background: rgba(201, 169, 98, 0.12);
}

.tag.selected {
    background: var(--ink);
    color: var(--bg-paper);
    border-color: var(--ink);
}

.tag .tag-remove {
    background: rgba(255,255,255,0.3);
    border: none;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-tag-add {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: white;
    border: none;
    border-radius: 24px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(26, 31, 46, 0.15);
}

.btn-tag-add:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(26, 31, 46, 0.2);
}

/* Buttons */
.btn-primary {
    background: var(--ink);
    color: var(--bg-paper);
    border: 1px solid var(--ink);
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Lora', Georgia, serif;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--ink-soft);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-cream);
    color: var(--ink);
    border: 1px solid var(--border-warm);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Lora', Georgia, serif;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--gold-soft);
    background: rgba(201, 169, 98, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #fb7185 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
    box-shadow: 0 4px 16px rgba(248, 113, 113, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(248, 113, 113, 0.4);
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.btn-large {
    padding: 1.25rem;
    font-size: 1rem;
    margin-top: 1.5rem;
    border-radius: 20px;
}

/* Logged Message */
.logged-message {
    background: linear-gradient(135deg, #d3f9d8 0%, #b2f2bb 100%);
    border: 2px solid var(--mood-great);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(81, 207, 102, 0.2);
    animation: slideIn 0.3s ease;
}

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

.logged-message p {
    margin-bottom: 1rem;
    color: #065f46;
    font-weight: 600;
    font-size: 1.05rem;
}

.logged-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.logged-actions .btn-primary {
    width: auto;
    flex: 1;
    min-width: 100px;
}

.btn-share {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    flex: 1;
    min-width: 100px;
    justify-content: center;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
}

.btn-share.shared {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    animation: shareSuccess 0.3s ease;
}

@keyframes shareSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.share-icon {
    font-size: 1.1rem;
}

/* Timeline */
.filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filters select {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 0.9rem;
    background: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filters select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.12);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-month {
    margin-bottom: 2rem;
}

.timeline-month h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%) 1;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.timeline-entry {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.12);
    margin-bottom: 0.75rem;
}

.timeline-entry:hover {
    box-shadow: 0 8px 24px rgba(26, 31, 46, 0.12);
    transform: translateX(8px) scale(1.02);
    border-color: var(--primary-color);
}

.timeline-entry-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.notable-entry {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
}

.notable-badge {
    font-size: 1.1rem;
    margin-right: 0.25rem;
    animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.timeline-date {
    font-weight: 600;
    min-width: 60px;
    color: var(--text-primary);
}

.timeline-mood {
    font-size: 1.5rem;
}

.timeline-pet {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.timeline-note {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

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

.timeline-entry-tags .tag {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
}

.timeline-photo {
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timeline-photo img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}

.timeline-audio {
    margin: 0.75rem 0;
}

.timeline-audio audio {
    width: 100%;
    max-width: 320px;
    height: 40px;
}

/* Photo Upload */
.photo-upload-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-photo-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-photo-upload:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 31, 46, 0.08);
}

.photo-icon {
    font-size: 1.2rem;
}

.photo-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.photo-preview img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: cover;
}

.photo-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.photo-remove-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Audio Upload */
.audio-upload-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.audio-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-audio-record,
.btn-audio-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #f0f8ff 0%, #e0e8f0 100%);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-audio-record:hover,
.btn-audio-upload:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e8f4fc 0%, #d8e4f0 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26, 31, 46, 0.08);
}

.audio-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    position: relative;
}

.audio-preview audio {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    height: 40px;
}

.audio-remove-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.audio-remove-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Insights */
.insights-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.insight-box {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.insight-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(26, 31, 46, 0.08);
}

.insight-box h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.weekly-sentence-box {
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    border: 2px solid var(--primary-color);
}

.weekly-mood-sentence {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-style: italic;
    margin: 0;
}

.insight-box p {
    color: var(--text-secondary);
    line-height: 1.8;
}

#mood-chart {
    max-height: 250px;
}

.tag-correlation {
    padding: 1rem;
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
    border-radius: 16px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.tag-correlation:hover {
    transform: translateX(4px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(26, 31, 46, 0.08);
}

.tag-correlation strong {
    color: var(--text-primary);
}

/* Month-in-Pixels View */
.pixels-view-box {
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
}

.pixels-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pixels-nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(26, 31, 46, 0.1);
}

.pixels-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(26, 31, 46, 0.15);
}

.pixels-month-year {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 150px;
    text-align: center;
}

.pixels-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.pixels-day-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.25rem;
}

.pixels-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #e0e0e0;
    border: 2px solid transparent;
    position: relative;
}

.pixels-day.has-entry {
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
    border-color: var(--border-color);
}

.pixels-day.has-entry:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.pixels-day.no-entry {
    background: #f5f5f5;
    border: 1px solid #ddd;
    opacity: 0.5;
}

.pixels-emoji {
    font-size: 1.2rem;
    display: block;
}

.pixels-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

.pixels-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pixels-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

@media (min-width: 768px) {
    .pixels-grid {
        gap: 0.75rem;
    }
    
    .pixels-emoji {
        font-size: 1.5rem;
    }
    
    .pixels-day {
        border-radius: 10px;
    }
}

/* Settings */
.settings-section {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.settings-section:hover {
    box-shadow: 0 8px 24px rgba(26, 31, 46, 0.08);
}

.settings-section h3 {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
}

.pet-item,
.tag-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
    border-radius: 16px;
    margin-bottom: 0.75rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.pet-item:hover,
.tag-item:hover {
    transform: translateX(4px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(26, 31, 46, 0.08);
}

.pet-item-info {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
}

.pet-item-info-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.pet-item-avatar-wrap {
    flex-shrink: 0;
}

.pet-avatar {
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.pet-avatar-header {
    width: 48px;
    height: 48px;
}

.pet-avatar-list {
    width: 44px;
    height: 44px;
}

.pet-avatar-placeholder {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
    border-radius: 50%;
    border: 2px solid var(--border-color);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.today-pet-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pet-birthday-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.pet-personality-text {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
    font-style: italic;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.pet-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* Mobile: keep pet card content and buttons inside bounds */
@media (max-width: 600px) {
    .pet-item {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .pet-item-info {
        flex: 1 1 100%;
        min-width: 0;
    }
    .pet-item-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }
    .pet-item-actions .btn-small {
        padding: 0.5rem 1rem;
    }
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.pet-item span,
.tag-item span {
    font-weight: 500;
}

.settings-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.settings-section .btn-secondary {
    margin-top: 0.5rem;
    width: 100%;
}

.settings-section .btn-danger {
    margin-top: 1rem;
}

/* Account / Cloud sync (unobtrusive) */
.settings-section-account {
    border-color: rgba(184, 134, 11, 0.3);
}

.cloud-sync-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.cloud-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.cloud-sync-toggle {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.cloud-toggle-text {
    user-select: none;
}

.cloud-sync-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cloud-sync-status.saved {
    color: var(--success-green, #2e7d32);
}

.cloud-sync-actions {
    margin-top: 0.75rem;
}

.cloud-auth-block {
    margin-top: 0.5rem;
}

.notifications-auth-block,
.notifications-prefs-block {
    margin-top: 0.5rem;
}

.notifications-time-row {
    margin-bottom: 0.75rem;
}

.notifications-time-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notifications-time-input {
    font-size: 1rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

#notifications-test-btn {
    margin-top: 0.5rem;
}

/* Install Pawry (PWA) */
.settings-section-install {
    border-color: rgba(26, 31, 46, 0.12);
}

.install-state {
    margin-top: 0.5rem;
}

.install-installed-msg {
    color: var(--text-primary);
    font-weight: 500;
}

.install-ios-steps {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.install-ios-steps li {
    margin-bottom: 0.5rem;
}

.install-generic-msg {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.cloud-signin-prompt {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.cloud-auth-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cloud-last-backup {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.75rem 0 0.5rem 0;
}

.restore-warning {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.restore-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reconcile-text {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.reconcile-timestamps {
    margin-bottom: 1rem;
}

.reconcile-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.reconcile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reconcile-actions .btn-primary,
.reconcile-actions .btn-secondary {
    width: 100%;
}

.backup-suggestion-text {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.form-error {
    color: #c92a2a;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 45px;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, var(--bg-paper) 0%, var(--bg-cream) 100%);
    backdrop-filter: blur(20px);
    border-top: 2px solid var(--border-color);
    border-bottom: none;
    display: flex;
    justify-content: space-around;
    padding: 0.875rem 0;
    box-shadow: 0 -4px 20px rgba(26, 31, 46, 0.08);
    z-index: 1000;
    border-radius: 0;
}

/* Footer */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, var(--bg-paper) 0%, var(--bg-cream) 100%);
    backdrop-filter: blur(20px);
    border-top: none;
    padding: 0.5rem 1rem;
    text-align: center;
    z-index: 999;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.10rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
}

.footer-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.footer-separator {
    margin: 0 0.5rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    position: relative;
    border-radius: 12px;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 0 0 3px 3px;
    transition: width 0.3s ease;
}

.nav-btn.active {
    color: var(--primary-color);
    font-weight: 700;
}

.nav-btn.active::before {
    width: 60%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

/* Share Options Modal */
.share-option-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.share-option-btn {
    background: linear-gradient(135deg, #fff8f0 0%, #ffe8cc 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}

.share-option-btn:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 31, 46, 0.08);
}

.share-option-icon {
    font-size: 2rem;
    line-height: 1;
}

.share-option-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

@media (max-width: 480px) {
    .share-option-buttons {
        grid-template-columns: 1fr;
    }
}

.modal-content {
    background: linear-gradient(180deg, var(--bg-paper) 0%, var(--bg-cream) 100%);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border-color);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content-narrow {
    max-width: 420px;
}

.hero-login-explainer {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.hero-login-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hero-login-actions .btn-primary,
.hero-login-actions .btn-secondary {
    width: 100%;
}

.hero-login-divider {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    flex: 1;
}

/* Legal Content */
.legal-content {
    line-height: 1.8;
    color: var(--text-primary);
}

.legal-content p {
    margin-bottom: 1rem;
}

.legal-content p:last-child {
    margin-bottom: 0;
}

.legal-content strong {
    color: var(--text-primary);
    font-weight: 700;
    display: block;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.legal-content strong:first-child {
    margin-top: 0;
}

.legal-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
    list-style-type: disc;
}

.legal-content em {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: block;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (min-width: 768px) {
    .content {
        padding: 2rem;
    }

    .mood-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 500px;
        margin: 0 auto 1.5rem;
    }

    .bottom-nav {
        max-width: 960px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 12px 12px 0 0;
        bottom: 45px;
        border: 1px solid var(--border-warm);
        border-bottom: none;
    }

    .app-footer {
        max-width: 960px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0 0 12px 12px;
        border: 1px solid var(--border-warm);
        border-top: none;
    }
}

@media (min-width: 1200px) {
    .bottom-nav {
        max-width: 92%;
    }
    .app-footer {
        max-width: 92%;
    }
}

/* Landing Page */
.landing-page {
    min-height: 100vh;
    background: var(--bg-warm);
    background-image:
        radial-gradient(ellipse 100% 60% at 50% 0%, rgba(245, 242, 235, 0.95) 0%, transparent 70%),
        linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-cream) 100%);
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(100px, -50px) rotate(90deg); }
    50% { transform: translate(-50px, 100px) rotate(180deg); }
    75% { transform: translate(50px, -100px) rotate(270deg); }
}

.landing-container {
    max-width: 1200px;
    width: 100%;
    background: linear-gradient(180deg, var(--bg-paper) 0%, var(--bg-cream) 100%);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-warm);
    position: relative;
    z-index: 1;
}

.login-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: 1px solid var(--border-warm);
    color: var(--ink);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Lora', Georgia, serif;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.login-btn:hover {
    border-color: var(--gold-soft);
    color: var(--ink);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-top: 2rem;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-logo {
    margin-bottom: 0.5rem;
}

.logo-img {
    height: 120px;
    width: auto;
    display: block;
}

.hero-headline {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.25;
    margin: 0;
    font-family: 'Lora', Georgia, serif;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
    font-style: italic;
}

.cta-button {
    background: var(--ink);
    color: var(--bg-paper);
    border: 1px solid var(--ink);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'Lora', Georgia, serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    width: fit-content;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
}

.cta-button:hover {
    background: var(--ink-soft);
    box-shadow: 0 12px 32px rgba(26, 31, 46, 0.18);
}

.cta-icon {
    font-size: 1.5rem;
}

.cta-subtext {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0 0;
}

.hero-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-warm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.hero-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.hero-footer-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.hero-footer .footer-link {
    font-size: 0.75rem;
}

.hero-right {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-mockup {
    position: relative;
    z-index: 2;
    width: 320px;
    max-width: 100%;
}

.phone-screen {
    background: white;
    border-radius: 32px;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 8px solid #2d2d2d;
}

.mockup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.mockup-menu {
    font-size: 1.2rem;
    color: #6b7280;
}

.mockup-logo-small {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.mockup-pet-select {
    border: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.mockup-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mockup-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mockup-question {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.mockup-moods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mockup-mood {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mockup-mood.selected {
    background: #fef3c7;
    border-color: #fbbf24;
    color: var(--text-primary);
}

.mockup-notes {
    margin-top: 0.5rem;
}

.mockup-notes label,
.mockup-tags label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.mockup-notes textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    resize: none;
    background: #f9fafb;
}

.pet-illustrations {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.pet-cat {
    position: absolute;
    left: -80px;
    top: 20%;
    font-size: 4rem;
    transform: rotate(-15deg);
    animation: floatPet 6s ease-in-out infinite;
}

.pet-dog {
    position: absolute;
    right: -60px;
    top: 30%;
    font-size: 4rem;
    transform: rotate(15deg);
    animation: floatPet 8s ease-in-out infinite;
}

.pet-bowl {
    position: absolute;
    left: -60px;
    bottom: 10%;
    font-size: 3rem;
    animation: floatPet 7s ease-in-out infinite;
}

@keyframes floatPet {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.app-container {
    display: none;
}

/* Hide landing page when app is shown */
body.show-app .landing-page {
    display: none;
}

body.show-app .app-container {
    display: block;
}

body.show-landing .app-container {
    display: none;
}

/* Landing page responsive */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-right {
        order: -1;
    }

    .phone-mockup {
        width: 280px;
    }

    .pet-illustrations {
        display: none;
    }
}

@media (max-width: 768px) {
    .landing-container {
        padding: 2rem 1.5rem;
    }

    .login-btn {
        top: 1.5rem;
        right: 1.5rem;
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }

    .hero-headline {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .cta-button {
        width: 100%;
        justify-content: center;
    }

    .phone-mockup {
        width: 260px;
    }
}

/* Mon Carnet: template entry forms — nearly full width on wide screens */
.today-entry-form {
    margin-bottom: 1.5rem;
    width: 100%;
}
.today-entry-form input,
.today-entry-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.today-entry-form textarea {
    min-height: 120px;
}
@media (min-width: 900px) {
    .today-entry-form textarea#today-body {
        min-height: 280px;
    }
}
.gratitude-form details.gratitude-section {
    margin-bottom: 1rem;
    border: 1px solid var(--border-warm);
    border-radius: 8px;
    padding: 0.75rem;
}
.gratitude-form summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--ink);
}
.ritual-form .ritual-prompt {
    margin-bottom: 0.75rem;
}
.songbook-form .form-section textarea {
    min-height: 100px;
}
.notebook-selector select {
    min-width: 140px;
}
