:root {
    --pink: #ffc8dd;
    --pink-dark: #ff9ebb;
    --peach: #ffdab9;
    --peach-dark: #ffb8a0;
    --lemon: #fff5ba;
    --lemon-dark: #f3e078;
    --lavender: #e0c3fc;
    --lavender-dark: #c49dfc;
    --mint: #caffbf;
    --mint-dark: #9ef58e;
    --rose: #ffadad;
    --rose-dark: #ff8282;
    --sky: #a0c4ff;
    --sky-dark: #78aaff;
    --dream: #bdb2ff;
    --dream-dark: #9b8aff;
    --cream: #fffaf5;
    --text: #5d4e6d;
    --text-light: #8c7aa3;
    --shadow: rgba(93, 78, 109, 0.12);
    --shadow-hover: rgba(93, 78, 109, 0.18);
    --shadow-color: 93, 78, 109;

    --surface: rgba(255, 255, 255, 0.92);
    --surface-soft: rgba(255, 255, 255, 0.85);
    --surface-hover: rgba(255, 255, 255, 0.98);

    --accent-1: #ff9ebb;
    --accent-2: #c49dfc;
    --accent-3: #8ce99a;
    --accent-4: #06d6a0;

    --input-border: #f3e7ff;
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-focus-bg: white;
    --placeholder: #cdb8d8;

    --error: #e85d75;
    --success: #06d6a0;

    --card-bg-base: #ffffff;
    --card-icon-shadow: rgba(157, 78, 221, 0.12);

    --modal-backdrop: rgba(93, 78, 109, 0.45);
    --modal-shadow: rgba(93, 78, 109, 0.25);

    --rating-border: var(--pink);
    --rating-bg: #fff8fb;
    --rating-hover-bg: #ffeff5;
    --rating-hover-shadow: rgba(255, 158, 187, 0.25);

    --highlight-item-bg: rgba(255, 248, 251, 0.85);
    --highlight-item-hover: rgba(255, 240, 246, 0.9);
    --highlight-focus-bg: #fff0f6;
    --highlight-focus-border: var(--pink-dark);

    --option-row-bg: rgba(243, 231, 255, 0.4);

    --sun-shadow: rgba(255, 183, 77, 0.25);
    --sun-shadow-strong: rgba(255, 183, 77, 0.4);
}

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

body {
    font-family: 'Nunito', 'Quicksand', sans-serif;
    background: linear-gradient(-45deg, #fff0f5, #f3e7ff, #e8f7ff, #fff5f8);
    background-size: 400% 400%;
    animation: dreamyGradient 16s ease infinite;
    min-height: 100vh;
    color: var(--text);
    position: relative;
    overflow-x: hidden;
}

@keyframes dreamyGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating decorations */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cloud, .sun, .star, .heart {
    position: absolute;
    opacity: 0.5;
    filter: drop-shadow(0 6px 14px rgba(157, 78, 221, 0.12));
    user-select: none;
}

.cloud { font-size: 3.2rem; animation: drift 14s ease-in-out infinite; }
.sun { font-size: 2.2rem; animation: sunSpin 8s ease-in-out infinite; }
.moon { font-size: 2rem; animation: sunSpin 10s ease-in-out infinite reverse; }
.star { font-size: 1.5rem; animation: twinkle 5s ease-in-out infinite; }
.heart { font-size: 1.4rem; animation: heartbeat 4s ease-in-out infinite; }

.cloud-1 { top: 8%; left: 6%; animation-delay: 0s; }
.cloud-2 { top: 28%; right: 10%; animation-delay: 3s; }
.cloud-3 { top: 62%; left: 4%; animation-delay: 5s; }
.cloud-4 { bottom: 15%; right: 30%; animation-delay: 2s; }
.sun-1 { top: 5%; right: 42%; animation-delay: 0s; }
.sun-2 { top: 18%; left: 26%; animation-delay: 2s; }
.sun-3 { bottom: 38%; right: 8%; animation-delay: 4s; }
.moon-1 { top: 12%; right: 34%; animation-delay: 1s; }
.moon-2 { bottom: 42%; left: 12%; animation-delay: 3s; }
.star-1 { top: 14%; right: 18%; animation-delay: 1s; }
.star-2 { bottom: 22%; left: 8%; animation-delay: 3s; }
.star-3 { top: 48%; left: 2%; animation-delay: 5s; }
.star-4 { top: 36%; right: 4%; animation-delay: 2s; }
.star-5 { bottom: 32%; left: 26%; animation-delay: 4s; }
.heart-1 { bottom: 12%; right: 14%; animation-delay: 2.5s; }
.heart-2 { top: 66%; right: 18%; animation-delay: 4s; }
.heart-3 { bottom: 26%; left: 16%; animation-delay: 1.5s; }
.heart-4 { top: 44%; right: 36%; animation-delay: 0s; }

@keyframes drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(12px, -16px) rotate(3deg); }
    66% { transform: translate(-8px, -10px) rotate(-2deg); }
}

@keyframes sunSpin {
    0%, 100% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 6px 14px rgba(255, 183, 77, 0.25)); }
    25% { transform: rotate(12deg) scale(1.1); }
    50% { transform: rotate(0deg) scale(1.15); filter: drop-shadow(0 10px 22px rgba(255, 183, 77, 0.4)); }
    75% { transform: rotate(-12deg) scale(1.1); }
}

@keyframes twinkle {
    0%, 100% { transform: scale(0.9) rotate(-8deg); opacity: 0.4; }
    25% { transform: scale(1.15) rotate(8deg); opacity: 0.8; }
    50% { transform: scale(1.3) rotate(0deg); opacity: 1; }
    75% { transform: scale(1.1) rotate(-5deg); opacity: 0.7; }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.12); }
}

/* Login page */
.login-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    padding: 44px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(157, 78, 221, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    text-align: center;
    animation: cardFadeUp 0.8s ease both;
    border: 1px solid rgba(var(--shadow-color), 0.08);
}

[data-mode="night"] .login-card {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.login-header {
    margin-bottom: 32px;
}

.login-header h1 {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    text-shadow: 2px 2px 0 rgba(255, 200, 221, 0.4);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    padding-left: 6px;
}

.form-group input {
    border: 2px solid var(--input-border);
    border-radius: 16px;
    padding: 14px 18px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--input-bg);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.form-group input:focus {
    border-color: var(--lavender-dark);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 4px rgba(196, 157, 252, 0.15);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.login-btn {
    background: linear-gradient(135deg, #ff9ebb 0%, #c49dfc 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(196, 157, 252, 0.35);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    margin-top: 8px;
}

.login-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 14px 32px rgba(196, 157, 252, 0.45);
}

.login-message {
    min-height: 24px;
    margin-top: 16px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-light);
}

.login-message.error {
    color: #e85d75;
}

.login-message.success {
    color: #06d6a0;
}

.login-hint {
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
    line-height: 1.5;
}

/* Home page */
.home-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.current-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 3px 8px rgba(var(--shadow-color), 0.25);
    flex-shrink: 0;
}

.user-name {
    color: var(--text-light);
    font-weight: 700;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    border: none;
    border-radius: 50px;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.logout-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(157, 78, 221, 0.15);
    background: rgba(255, 255, 255, 0.98);
}

.home-header {
    text-align: center;
    margin-bottom: 24px;
    flex-shrink: 0;
    animation: fadeInDown 0.9s ease both;
}

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

.title-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.badge {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 6px 18px rgba(157, 78, 221, 0.12);
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.badge:nth-child(1) { animation-delay: 0.1s; }
.badge:nth-child(2) { animation-delay: 0.2s; }
.badge:nth-child(3) { animation-delay: 0.3s; }

.badge:hover {
    transform: translateY(-4px) scale(1.15) rotate(8deg);
    box-shadow: 0 10px 24px rgba(157, 78, 221, 0.18);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.4) rotate(-12deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}

.home-header h1 {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1px;
    margin-bottom: 8px;
    text-shadow: 3px 3px 0 rgba(255, 200, 221, 0.45), 0 8px 20px rgba(157, 78, 221, 0.12);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 600;
    animation: fadeIn 1s ease 0.3s both;
}

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

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    flex-shrink: 0;
}

.journal-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 20px 16px;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 8px 24px rgba(157, 78, 221, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease, background 0.35s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-top: 5px solid transparent;
    position: relative;
    overflow: hidden;
    animation: cardFadeUp 0.7s ease both;
}

.journal-card:nth-child(1) { animation-delay: 0.05s; }
.journal-card:nth-child(2) { animation-delay: 0.1s; }
.journal-card:nth-child(3) { animation-delay: 0.15s; }
.journal-card:nth-child(4) { animation-delay: 0.2s; }
.journal-card:nth-child(5) { animation-delay: 0.25s; }
.journal-card:nth-child(6) { animation-delay: 0.3s; }
.journal-card:nth-child(7) { animation-delay: 0.35s; }
.journal-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes cardFadeUp {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.journal-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.7) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.journal-card:hover {
    transform: translateY(-10px) scale(1.03) rotate(1deg);
    box-shadow: 0 20px 44px rgba(157, 78, 221, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.98);
}

.journal-card:hover::before {
    opacity: 1;
}

.journal-card:hover .card-icon {
    transform: scale(1.2) rotate(-6deg);
}

.card-pink { border-top-color: var(--pink-dark); background: linear-gradient(180deg, #fff5f8 0%, #ffffff 100%); }
.card-peach { border-top-color: var(--peach-dark); background: linear-gradient(180deg, #fff7f2 0%, #ffffff 100%); }
.card-lemon { border-top-color: var(--lemon-dark); background: linear-gradient(180deg, #fffdf2 0%, #ffffff 100%); }
.card-lavender { border-top-color: var(--lavender-dark); background: linear-gradient(180deg, #f9f4ff 0%, #ffffff 100%); }
.card-mint { border-top-color: var(--mint-dark); background: linear-gradient(180deg, #f4fff2 0%, #ffffff 100%); }
.card-rose { border-top-color: var(--rose-dark); background: linear-gradient(180deg, #fff4f4 0%, #ffffff 100%); }
.card-sky { border-top-color: var(--sky-dark); background: linear-gradient(180deg, #f3f8ff 0%, #ffffff 100%); }
.card-dream { border-top-color: var(--dream-dark); background: linear-gradient(180deg, #f6f4ff 0%, #ffffff 100%); }

.card-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(157, 78, 221, 0.12));
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.journal-card h2 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.journal-card p {
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.4;
}

.home-footer {
    text-align: center;
    margin-top: 36px;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    animation: fadeIn 1s ease 0.6s both;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 28px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    color: var(--text-light);
    font-weight: 600;
    animation: fadeIn 0.8s ease both;
}

.empty-state p {
    margin: 6px 0;
}

/* Tracker / Calendar pages */
.page-container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 24px 50px;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    color: var(--text);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(157, 78, 221, 0.1);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.25s ease;
}

.back-btn:hover {
    transform: translateX(-6px) scale(1.03);
    box-shadow: 0 12px 28px rgba(157, 78, 221, 0.16);
    background: rgba(255, 255, 255, 0.98);
}

.year-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 8px 18px;
    border-radius: 50px;
    box-shadow: 0 6px 18px rgba(157, 78, 221, 0.1);
    font-weight: 700;
}

.year-picker select {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    cursor: pointer;
    outline: none;
}

.page-header {
    text-align: center;
    margin-bottom: 32px;
    animation: fadeInDown 0.8s ease both;
}

.page-header h1 {
    font-family: 'Quicksand', sans-serif;
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 2px 2px 0 rgba(255, 200, 221, 0.35);
}

.page-header p {
    color: var(--text-light);
    font-weight: 600;
}

.save-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    gap: 16px;
    margin-bottom: 28px;
    min-height: 40px;
}

.save-status {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.95rem;
}

.streak-status {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 6px 18px rgba(var(--shadow-color), 0.25);
    animation: fadeIn 0.5s ease both;
}

@media (max-width: 640px) {
    .save-bar {
        justify-content: center;
        padding-top: 28px;
    }

    .save-status {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
}

.save-btn {
    background: linear-gradient(135deg, #ff9ebb 0%, #c49dfc 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(196, 157, 252, 0.35);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.save-btn:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 14px 32px rgba(196, 157, 252, 0.45);
}

.save-btn:active {
    transform: translateY(0) scale(1);
}

.card-streak {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(var(--shadow-color), 0.25);
    z-index: 2;
}

.year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.month-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(157, 78, 221, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.month-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 18px 40px rgba(157, 78, 221, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.month-title {
    text-align: center;
    font-family: 'Quicksand', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 14px;
    color: var(--text);
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.day-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.15s ease;
}

.day-cell.empty {
    background: transparent;
}

.day-cell input[type="checkbox"] {
    appearance: none;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    border: 2px solid var(--pink);
    background: #fff8fb;
    cursor: pointer;
    position: relative;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.day-cell input[type="checkbox"]:hover {
    background: #ffeff5;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(255, 158, 187, 0.25);
}

.day-cell input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--pink-dark), var(--lavender-dark));
    border-color: transparent;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(196, 157, 252, 0.35);
}

.day-cell input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    font-weight: 800;
}

.day-cell .day-number {
    position: absolute;
    top: 4px;
    left: 5px;
    pointer-events: none;
    font-size: 0.6rem;
    color: var(--text-light);
    z-index: 2;
}

.day-cell input[type="checkbox"]:checked ~ .day-number {
    color: rgba(255, 255, 255, 0.95);
}

/* Rating mode for Rate My Day */
.tracker-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    color: var(--text);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(157, 78, 221, 0.1);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.25s ease;
    max-width: 48%;
}

.nav-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 28px rgba(157, 78, 221, 0.16);
    background: rgba(255, 255, 255, 0.98);
}

.next-btn {
    margin-left: auto;
}

.tracker-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.tracker-layout .year-grid {
    flex: 1;
    min-width: 0;
}

.rating-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 180px;
    max-width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 24px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    padding: 10px 14px;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(157, 78, 221, 0.08);
    font-size: 0.85rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
}

.legend-item:hover {
    transform: translateX(4px) scale(1.03);
    box-shadow: 0 8px 20px rgba(157, 78, 221, 0.14);
}

.legend-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.legend-item:hover .legend-swatch {
    transform: scale(1.2);
}

.rating-btn {
    width: 100%;
    height: 100%;
    border: 2px solid var(--pink);
    background: #fff8fb;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    padding: 0;
}

.rating-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 16px rgba(157, 78, 221, 0.18);
    z-index: 2;
}

.rating-btn:active {
    transform: scale(0.95);
}

.future-disabled {
    opacity: 0.45;
    cursor: not-allowed !important;
    filter: grayscale(0.6);
}

.rating-btn.future-disabled:hover {
    transform: none;
    box-shadow: none;
}

.rating-btn::after {
    content: '';
    pointer-events: none;
    z-index: 1;
}

.rating-btn[aria-label="not set"]::after,
.rating-btn[aria-label="not rated"]::after {
    content: '—';
    color: var(--text-light);
    opacity: 0.5;
    font-size: 0.85rem;
    font-weight: 800;
}

.rating-day-number {
    position: absolute;
    top: 3px;
    left: 4px;
    font-size: 0.55rem;
    font-weight: 800;
    opacity: 0.9;
    pointer-events: none;
    z-index: 2;
    color: var(--text-light);
}

/* Highlights page */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.highlight-month {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(157, 78, 221, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.highlight-month:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 38px rgba(157, 78, 221, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.highlight-days {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.highlight-days::-webkit-scrollbar {
    width: 6px;
}

.highlight-days::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--pink-dark), var(--lavender-dark));
    border-radius: 10px;
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255, 248, 251, 0.85);
    border-radius: 16px;
    padding: 10px 12px;
    border: 2px solid transparent;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.highlight-item:hover {
    transform: translateX(4px);
    background: rgba(255, 240, 246, 0.9);
    box-shadow: 0 6px 16px rgba(157, 78, 221, 0.08);
}

.highlight-item:focus-within {
    border-color: var(--pink-dark);
    background: #fff0f6;
    transform: translateX(4px) scale(1.01);
    box-shadow: 0 6px 16px rgba(157, 78, 221, 0.1);
}

.highlight-date {
    min-width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.08);
    font-weight: 800;
    line-height: 1.1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.highlight-item:hover .highlight-date {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 6px 16px rgba(157, 78, 221, 0.12);
}

.highlight-date .dow {
    font-size: 0.65rem;
    color: var(--text-light);
    text-transform: uppercase;
}

.highlight-date .dom {
    font-size: 1.1rem;
    color: var(--text);
}

.highlight-item textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text);
    outline: none;
    min-height: 52px;
    line-height: 1.45;
}

.highlight-item textarea::placeholder {
    color: #cdb8d8;
}

.stats-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    padding: 8px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 12px var(--shadow);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

/* Desktop: keep home page on one screen */
@media (min-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }

    .journal-card {
        padding: 18px 14px;
    }
}

/* Edit mode on home page */
.home-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-btn {
    background: var(--surface);
    border: 2px solid var(--lavender-dark);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.edit-btn:hover {
    background: var(--lavender-dark);
    color: white;
    transform: translateY(-2px);
}

.edit-mode-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 50px;
    box-shadow: 0 4px 14px var(--shadow);
}

.add-page-btn, .done-edit-btn {
    border: none;
    padding: 8px 18px;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.add-page-btn {
    background: linear-gradient(135deg, #8ce99a 0%, #06d6a0 100%);
    color: white;
}

.add-page-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
}

.add-page-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.done-edit-btn {
    background: linear-gradient(135deg, #ff9ebb 0%, #c49dfc 100%);
    color: white;
}

.edit-card {
    position: relative;
    pointer-events: none;
}

.edit-card h2, .edit-card p, .edit-card .card-icon {
    pointer-events: none;
}

.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    pointer-events: auto;
}

.card-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s ease;
}

.card-action-btn:hover {
    transform: scale(1.15);
}

.card-action-btn.delete-btn:hover {
    background: #ff8fa3;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(93, 78, 109, 0.45);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 28px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(93, 78, 109, 0.25);
    animation: cardFadeUp 0.4s ease both;
}

.modal-card h2 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 6px;
    color: var(--text);
}

.modal-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.modal-message {
    min-height: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 10px;
}

.modal-message.error { color: #e85d75; }
.modal-message.success { color: #06d6a0; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #ff9ebb 0%, #c49dfc 100%);
    color: white;
}

.modal-btn.secondary {
    background: var(--surface-soft);
    color: var(--text);
}

.modal-btn:hover {
    transform: translateY(-2px);
}

/* Options editor */
.options-modal-card {
    max-width: 540px;
}

.options-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 6px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(243, 231, 255, 0.4);
    padding: 10px;
    border-radius: 16px;
}

.option-label-input, .option-value-input {
    flex: 1;
    border: 2px solid #f3e7ff;
    border-radius: 12px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    outline: none;
}

.option-label-input:focus, .option-value-input:focus {
    border-color: var(--lavender-dark);
}

.option-color-input {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: none;
}

.option-remove-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #ff8fa3;
    color: white;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.option-remove-btn:hover {
    transform: scale(1.1);
}

.add-option-btn {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border: 2px dashed var(--lavender-dark);
    background: rgba(255, 255, 255, 0.6);
    color: var(--text);
    border-radius: 16px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
}

.add-option-btn:hover:not(:disabled) {
    background: rgba(196, 157, 252, 0.15);
}

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

.no-options {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 700;
}

/* Login/register links */
.login-hint a {
    color: var(--lavender-dark);
    font-weight: 800;
    text-decoration: none;
}

.login-hint a:hover {
    text-decoration: underline;
}

.auth-switch {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.auth-switch .login-hint {
    margin: 0;
}

.auth-switch-btn {
    display: inline-block;
    background: linear-gradient(135deg, #8ce99a 0%, #06d6a0 100%);
    color: white;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 8px 24px rgba(6, 214, 160, 0.3);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.auth-switch-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 30px rgba(6, 214, 160, 0.4);
}

.auth-switch-btn.secondary-switch {
    background: linear-gradient(135deg, #ffd166 0%, #ff9f68 100%);
    box-shadow: 0 8px 24px rgba(255, 159, 104, 0.3);
}

.auth-switch-btn.secondary-switch:hover {
    box-shadow: 0 12px 30px rgba(255, 159, 104, 0.4);
}

/* User avatar dropdown menu */
.user-menu {
    position: relative;
}

.avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(157, 78, 221, 0.15);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.25s ease;
}

.avatar-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 26px rgba(157, 78, 221, 0.22);
    background: var(--surface-hover);
}

.avatar-btn .user-avatar {
    width: 34px;
    height: 34px;
    font-size: 1rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 16px 40px rgba(93, 78, 109, 0.2);
    z-index: 200;
    animation: dropdownIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    overflow: hidden;
    border: 1px solid rgba(var(--shadow-color), 0.08);
}

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

.user-dropdown a,
.user-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    text-align: left;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background: var(--surface-hover);
    transform: translateX(4px);
}

.user-dropdown .logout-btn-in-dropdown:hover {
    background: rgba(255, 143, 163, 0.15);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--input-border);
    margin: 6px 10px;
}

/* Profile page */
.profile-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 36px 24px 50px;
}

.profile-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 16px 44px rgba(157, 78, 221, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
    border: 1px solid rgba(var(--shadow-color), 0.08);
}

[data-mode="night"] .profile-card {
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-card h2 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 24px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.profile-grid .form-group {
    margin: 0;
}

.profile-grid .form-group.full-width {
    grid-column: 1 / -1;
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.profile-avatar,
.profile-page-avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
    color: white;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(var(--shadow-color), 0.25);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    font-size: 2rem;
    margin-bottom: 16px;
}

.profile-page-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.8rem;
    margin: 0 auto 12px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.profile-header-info h1 {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.profile-header-info p {
    color: var(--text-light);
    font-weight: 600;
}

.form-group select,
.form-group textarea {
    border: 2px solid var(--input-border);
    border-radius: 16px;
    padding: 14px 18px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--input-bg);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    width: 100%;
}

.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--lavender-dark);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 4px rgba(196, 157, 252, 0.15);
}

.form-group option {
    background: var(--input-focus-bg);
    color: var(--text);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Comprehensive responsive styles */
@media (max-width: 640px) {
    .home-container, .page-container, .profile-container {
        padding: 20px 14px 32px;
    }

    .home-top-bar {
        margin-bottom: 16px;
    }

    .top-bar {
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 20px;
    }

    .back-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .year-picker {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .avatar-btn {
        width: 40px;
        height: 40px;
    }

    .user-dropdown {
        right: 0;
        min-width: 180px;
        max-width: calc(100vw - 28px);
    }

    .home-header {
        margin-bottom: 18px;
    }

    .home-header h1 {
        font-size: clamp(1.8rem, 8vw, 2.6rem);
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .title-badges .badge {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .journal-card {
        padding: 16px 14px;
        border-radius: 20px;
    }

    .journal-card h2 {
        font-size: 1rem;
    }

    .journal-card p {
        font-size: 0.8rem;
    }

    .card-icon {
        font-size: 1.7rem;
    }

    .page-header {
        margin-bottom: 22px;
    }

    .page-header h1 {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
    }

    .page-header p {
        font-size: 0.85rem;
    }

    .save-bar {
        padding-top: 26px;
        margin-bottom: 22px;
    }

    .save-status {
        font-size: 0.8rem;
    }

    .streak-status {
        font-size: 0.85rem;
        padding: 6px 14px;
    }

    .tracker-nav {
        flex-direction: column;
        gap: 10px;
    }

    .nav-btn {
        max-width: 100%;
        width: 100%;
        justify-content: center;
    }

    .tracker-layout {
        flex-direction: column;
        gap: 18px;
    }

    .rating-legend {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
        min-width: auto;
        position: static;
        gap: 8px;
    }

    .legend-item {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .year-grid, .highlights-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .month-card {
        padding: 16px;
        border-radius: 20px;
    }

    .month-title {
        font-size: 1rem;
    }

    .weekdays {
        font-size: 0.6rem;
    }

    .day-cell {
        font-size: 0.75rem;
    }

    .day-cell input[type="checkbox"],
    .rating-btn {
        border-radius: 8px;
    }

    .highlight-item {
        padding: 8px 10px;
    }

    .highlight-date {
        min-width: 48px;
        height: 48px;
    }

    .highlight-item textarea {
        font-size: 0.88rem;
        min-height: 44px;
    }

    .modal-card {
        padding: 22px;
        border-radius: 24px;
    }

    .modal-card h2 {
        font-size: 1.3rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    .modal-actions .modal-btn {
        width: 100%;
        justify-content: center;
    }

    .option-row {
        flex-wrap: wrap;
    }

    .option-label-input, .option-value-input {
        min-width: calc(50% - 4px);
    }

    .home-top-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .edit-mode-bar {
        flex-direction: column;
        border-radius: 20px;
        gap: 10px;
    }

    .profile-card {
        padding: 22px;
        border-radius: 24px;
    }

    .profile-card h2 {
        font-size: 1.2rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }

    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.7rem;
    }

    .profile-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .profile-grid .form-group.full-width {
        grid-column: 1;
    }

    .profile-actions {
        flex-direction: column;
        gap: 8px;
    }

    .profile-actions .modal-btn {
        width: 100%;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .login-container {
        padding: 16px;
    }

    .login-card {
        padding: 28px 22px;
        border-radius: 28px;
    }

    .login-header {
        margin-bottom: 24px;
    }

    .login-header h1 {
        font-size: clamp(1.6rem, 6vw, 2rem);
    }

    .login-form {
        gap: 14px;
    }

    .login-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .analysis-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 12px;
    }

    .control-group {
        min-width: auto;
    }

    .control-group select {
        padding: 10px 12px;
    }

    .analysis-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .summary-card {
        padding: 16px;
    }

    .summary-value {
        font-size: 1.3rem;
    }

    .bar-label {
        min-width: 70px;
        max-width: 90px;
        font-size: 0.75rem;
    }

    .bar-track {
        height: 24px;
    }

    .bar-value {
        font-size: 0.7rem;
    }

    .bar-count {
        min-width: 40px;
        font-size: 0.75rem;
    }

    .theme-grid {
        grid-template-columns: 1fr;
    }

    .theme-option {
        padding: 12px;
    }

    .day-night-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .home-container, .page-container, .profile-container {
        padding: 16px 12px 24px;
    }

    .home-header h1 {
        font-size: clamp(1.6rem, 9vw, 2rem);
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .journal-card {
        padding: 14px 12px;
        border-radius: 18px;
    }

    .card-icon {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .journal-card h2 {
        font-size: 0.95rem;
    }

    .journal-card p {
        font-size: 0.75rem;
    }

    .top-bar {
        gap: 10px;
    }

    .back-btn {
        padding: 7px 12px;
        font-size: 0.8rem;
    }

    .year-picker {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .year-picker select {
        font-size: 0.9rem;
    }

    .avatar-btn {
        width: 36px;
        height: 36px;
    }

    .avatar-btn .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .user-dropdown {
        min-width: 160px;
    }

    .user-dropdown a,
    .user-dropdown button {
        padding: 10px 12px;
        font-size: 0.88rem;
    }

    .page-header h1 {
        font-size: clamp(1.4rem, 8vw, 1.8rem);
    }

    .weekdays {
        gap: 4px;
        font-size: 0.55rem;
    }

    .days-grid {
        gap: 4px;
    }

    .day-cell {
        font-size: 0.7rem;
    }

    .day-cell input[type="checkbox"],
    .rating-btn {
        border-radius: 6px;
    }

    .month-card {
        padding: 12px;
    }

    .highlight-item {
        gap: 8px;
    }

    .highlight-date {
        min-width: 44px;
        height: 44px;
    }

    .highlight-date .dom {
        font-size: 1rem;
    }

    .highlight-item textarea {
        font-size: 0.85rem;
    }

    .profile-card {
        padding: 18px;
    }

    .profile-card h2 {
        font-size: 1.1rem;
        margin-bottom: 18px;
    }

    .profile-avatar {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }

    .profile-page-avatar {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }

    .profile-header-info h1 {
        font-size: 1.3rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .login-container {
        padding: 12px;
    }

    .login-card {
        padding: 24px 18px;
        border-radius: 24px;
    }

    .login-header h1 {
        font-size: clamp(1.4rem, 7vw, 1.7rem);
    }

    .login-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .modal-card {
        padding: 18px;
    }

    .modal-card h2 {
        font-size: 1.15rem;
    }

    .modal-subtitle {
        font-size: 0.85rem;
    }

    .analysis-summary {
        grid-template-columns: 1fr;
    }

    .bar-label {
        min-width: 60px;
        max-width: 80px;
        font-size: 0.7rem;
    }

    .bar-count {
        min-width: 34px;
        font-size: 0.7rem;
    }

    .vision-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .vision-actions {
        flex-direction: column;
        gap: 8px;
    }

    .vision-actions button {
        width: 100%;
    }

    .vision-board-title input {
        min-width: auto;
        width: 100%;
    }

    .vision-board-wrapper {
        padding: 14px;
    }

    .vision-board-title {
        flex-direction: column;
        gap: 8px;
    }

    .vision-board-title button {
        width: 100%;
    }
}
