/* ============================================================
   Wellbeing-Companion — Main Stylesheet
   Modern, warm design with glass-morphism, gradients, animations
   ============================================================ */

/* ---- CSS Custom Properties (Design Tokens) ---- */
:root {
    --primary: #43A047;
    --primary-dark: #2E7D32;
    --primary-light: #E8F5E9;
    --primary-glow: rgba(67, 160, 71, 0.25);
    --accent: #FF8F00;
    --accent-light: #FFF8E1;
    --bg: #f5f7fa;
    --bg-gradient: linear-gradient(160deg, #f0f4f8 0%, #e8edf5 30%, #f5f0eb 70%, #f0f4f8 100%);
    --card-bg: rgba(255, 255, 255, 0.82);
    --card-bg-solid: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --radius-pill: 999px;
    --nav-height: 72px;
    --header-height: 56px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Progress ring colors */
    --ring-bg: #e2e8f0;
    --mental-color: #7C3AED;
    --body-color: #2563EB;
    --food-color: #F59E0B;
    --study-color: #10B981;
}

/* Manual theme (replaces @media — JS sets data-theme) */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-gradient: linear-gradient(160deg, #0f172a 0%, #1a1f35 30%, #1a1725 70%, #0f172a 100%);
    --card-bg: rgba(30, 41, 59, 0.75);
    --card-bg-solid: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.55);
    --ring-bg: #334155;
    --primary-light: rgba(67, 160, 71, 0.15);
    --accent-light: rgba(255, 143, 0, 0.12);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-height) + 2rem);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle grid pattern overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, var(--primary-glow) 0%, transparent 50%),
        radial-gradient(circle at 80% 60%, rgba(255, 143, 0, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ---- Skip Link (Accessibility) ---- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
    text-decoration: none;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
    top: 0;
}

/* ---- App Header (Glass Morphism) ---- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.app-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.03em;
}

.current-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}
@media (max-width: 400px) {
    .current-date { display: none; }
    .app-header { padding: 0 0.6rem; }
    .app-title { font-size: 1rem; }
    .auth-btn { padding: 0.3rem 0.5rem; font-size: 0.7rem; }
    .theme-btn { font-size: 1rem; }
}

/* ---- Bottom Navigation (Floating Pill) ---- */
.bottom-nav {
    position: fixed !important;
    bottom: 12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: var(--nav-height);
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    border-radius: var(--radius-pill);
    padding: 0 0.5rem;
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: calc(100% - 2rem);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.3rem 0.3rem;
    transition: all var(--transition);
    min-width: 42px;
    border-radius: var(--radius-pill);
    position: relative;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -4px;
    width: 24px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--primary);
}

.nav-item .nav-icon {
    font-size: 1.35rem;
    transition: transform var(--transition);
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
}

/* ---- Main Content ---- */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1rem 1.5rem;
    position: relative;
    z-index: 1;
}

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

.section-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.25rem;
    letter-spacing: -0.02em;
}

/* ---- Card Component ---- */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card:hover::after {
    opacity: 1;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ---- Button Components ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-pill);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}
.btn-secondary:hover {
    filter: brightness(0.85);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

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

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font);
    background: var(--card-bg-solid);
    color: var(--text);
    transition: all var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.25rem;
}

/* ---- Feedback Message ---- */
.feedback-msg {
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.75rem;
    animation: fadeIn 0.3s ease;
}

.feedback-msg.success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.feedback-msg.error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Staggered card entrance */
.page-section > * {
    animation: slideUp 0.4s ease both;
}
.page-section > *:nth-child(1) { animation-delay: 0.05s; }
.page-section > *:nth-child(2) { animation-delay: 0.1s; }
.page-section > *:nth-child(3) { animation-delay: 0.15s; }
.page-section > *:nth-child(4) { animation-delay: 0.2s; }
.page-section > *:nth-child(5) { animation-delay: 0.25s; }
.page-section > *:nth-child(6) { animation-delay: 0.3s; }

/* ---- Grid Layout ---- */
.grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr 1fr;
}
@media (min-width: 500px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 700px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Quick Actions (Dashboard) ---- */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-btn {
    flex: 1;
    min-width: 100px;
    padding: 0.85rem 1rem;
}

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

/* ---- Wellness Score Ring ---- */
.wellness-score-card {
    text-align: center;
}

.wellness-score-card::after {
    background: linear-gradient(90deg, var(--mental-color), var(--body-color), var(--food-color), var(--study-color));
}

.score-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.score-ring {
    position: relative;
    width: 150px;
    height: 150px;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--ring-bg);
    stroke-width: 10;
}

.ring-fill {
    fill: none;
    stroke: url(#wellnessGradient);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 6px rgba(67, 160, 71, 0.35));
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.03em;
}

.score-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ---- Streak Cards ---- */
.streak-card {
    text-align: center;
    padding: 1.25rem 0.75rem;
    border-radius: var(--radius);
}

.streak-icon {
    font-size: 2rem;
    margin-bottom: 0.35rem;
    display: block;
}

.streak-count {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.03em;
    line-height: 1;
}

.streak-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.15rem;
}

/* ---- Quick Forms ---- */
.quick-form {
    margin-top: 0.25rem;
}

.water-quick-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0.75rem 0;
}

.water-count-display {
    font-size: 1.6rem;
    font-weight: 800;
    min-width: 2rem;
    text-align: center;
    color: var(--primary-dark);
}

/* ---- Mood Emoji Picker ---- */
.mood-emoji-picker {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.mood-btn {
    font-size: 2.2rem;
    background: none;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    padding: 0.35rem;
    transition: all var(--transition);
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.mood-btn:hover,
.mood-btn:focus {
    transform: scale(1.2);
    border-color: var(--border);
}

.mood-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.25);
    box-shadow: 0 2px 12px var(--primary-glow);
}

/* ---- Mood History Dots ---- */
.mood-history {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.mood-history h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mood-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.mood-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    background: var(--ring-bg);
    transition: all var(--transition);
}

.mood-dot.today {
    box-shadow: 0 0 0 3px var(--primary);
    background: var(--primary-light);
    transform: scale(1.1);
}

/* ---- Breathing Exercise ---- */
.breathing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.breathing-circle {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.6s ease,
                border-color 0.6s ease,
                box-shadow 0.6s ease;
    border: 4px solid var(--primary);
    box-shadow: 0 0 0 8px var(--primary-light);
}

.breathing-circle.inhale {
    transform: scale(1.2);
    background: #C8E6C9;
    box-shadow: 0 0 0 16px rgba(200, 230, 201, 0.5);
}

.breathing-circle.hold {
    transform: scale(1.2);
    background: #FFF9C4;
    border-color: #F59E0B;
    box-shadow: 0 0 0 16px rgba(255, 249, 196, 0.5);
}

.breathing-circle.hold .breathing-phase,
.breathing-circle.hold .breathing-timer { color: #1e293b; }

.breathing-circle.exhale {
    transform: scale(0.85);
    background: #BBDEFB;
    border-color: #2563EB;
    box-shadow: 0 0 0 12px rgba(187, 222, 251, 0.5);
}

.breathing-phase {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.breathing-timer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---- Crisis Resources ---- */
.crisis-resources {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.crisis-resources h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.resource-item {
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.resource-item strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.resource-phone {
    display: inline-block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    margin: 0.3rem 0;
    letter-spacing: -0.02em;
}

.resource-item p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.resource-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-style: italic;
    font-weight: 500;
}

/* ---- Water Glasses ---- */
.water-glasses {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1rem 0;
}

.glass-icon {
    font-size: 2.2rem;
    background: none;
    border: 3px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.glass-icon:hover {
    transform: scale(1.18);
    border-color: var(--primary);
}

.glass-icon.filled {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 2px 8px var(--primary-glow);
    animation: scaleIn 0.25s ease;
}

.water-count {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ---- Meal Rating Picker ---- */
.rating-picker {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
}

.rating-btn {
    font-size: 1.8rem;
    background: none;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    padding: 0.25rem;
    transition: all var(--transition);
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.rating-btn:hover {
    transform: scale(1.2);
}

.rating-btn.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: scale(1.18);
    box-shadow: 0 2px 12px rgba(255, 143, 0, 0.25);
}

/* ---- Progress Bars ---- */
.progress-container {
    margin: 0.75rem 0;
}

.progress-bar-bg {
    width: 100%;
    height: 14px;
    background: var(--ring-bg);
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 4px;
    right: 4px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.activity-fill {
    background: linear-gradient(90deg, #3B82F6, #60A5FA);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.study-fill {
    background: linear-gradient(90deg, #10B981, #34D399);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.progress-text {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

/* ---- Log Lists ---- */
.log-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.log-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 500;
}

.log-list li:last-child {
    border-bottom: none;
}

.log-empty {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 500;
    justify-content: center !important;
}

.log-item-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.log-item-icon {
    font-size: 1.2rem;
}

.log-item-detail {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: block;
}

/* ---- Pomodoro Timer ---- */
.pomodoro-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pomodoro-ring {
    position: relative;
    width: 210px;
    height: 210px;
}

.pomodoro-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pomodoro-bg {
    fill: none;
    stroke: var(--ring-bg);
    stroke-width: 8;
}

.pomodoro-fill {
    fill: none;
    stroke: #10B981;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s linear, stroke 0.3s ease;
    filter: drop-shadow(0 2px 6px rgba(16, 185, 129, 0.35));
}

.pomodoro-fill.break-mode {
    stroke: #F59E0B;
    filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.35));
}

.pomodoro-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.pomodoro-time {
    display: block;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    line-height: 1;
}

.pomodoro-session {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}

.pomodoro-controls {
    display: flex;
    gap: 0.5rem;
}

.pomodoro-stats {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---- Stretch Timer ---- */
.stretch-timer-container {
    text-align: center;
    margin: 1rem 0;
}

.stretch-timer-display {
    font-size: 3.8rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.stretch-state {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.stretch-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.stretch-exercises {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.stretch-exercises h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.stretch-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    text-align: center;
    transition: transform var(--transition);
}

.stretch-item:hover {
    transform: translateY(-2px);
}

.stretch-emoji {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 0.3rem;
}

.stretch-item p {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
    padding: 1rem;
}

.modal-card {
    background: var(--card-bg-solid);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    max-width: 360px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-emoji {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.modal-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.modal-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ---- Tips Accordion ---- */
.tips-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tip-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.tip-item:hover {
    box-shadow: var(--shadow-sm);
}

.tip-item summary {
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: -0.01em;
}

.tip-item summary:hover {
    background: var(--primary-light);
}

.tip-item p {
    padding: 0 1rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---- Wellness Tip (Dashboard) ---- */
.wellness-tip {
    background: var(--card-bg-solid);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.wellness-tip .tip-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary-dark);
    margin-bottom: 0.3rem;
}

.wellness-tip .tip-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.55;
}

/* ---- Responsive Breakpoints ---- */
@media (max-width: 400px) {
    html { font-size: 14px; }

    .app-title { font-size: 1.1rem; }

    .pomodoro-ring { width: 170px; height: 170px; }
    .pomodoro-time { font-size: 2.2rem; }

    .breathing-circle { width: 140px; height: 140px; }

    .mood-btn { font-size: 1.8rem; }

    .water-glasses { gap: 0.25rem; }
    .glass-icon { font-size: 1.8rem; }

    .score-ring { width: 120px; height: 120px; }
    .score-value { font-size: 2rem; }

    .bottom-nav { padding: 0 0.2rem; border-radius: 24px; width: calc(100% - 0.5rem); }
    .nav-item { min-width: 34px; padding: 0.25rem 0.15rem; font-size: 0.5rem; }
    .nav-item .nav-icon { font-size: 1.05rem; }
}

@media (min-width: 768px) {
    main { padding: 1.5rem 2rem 2rem; }
    .section-title { font-size: 1.8rem; }
    .bottom-nav { max-width: 500px; }
}

/* ---- Theme Toggle ---- */
.theme-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    line-height: 1;
    transition: transform var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.theme-btn:hover { transform: scale(1.2); }

/* ---- Auth Header Button ---- */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.auth-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 2px 12px var(--primary-glow);
    transform: translateY(-1px);
}

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

.auth-btn .auth-icon {
    font-size: 1rem;
}

.auth-btn.signed-in {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

/* ---- Auth Provider Picker (sign-in dropdown) ---- */
.auth-provider-wrapper {
    position: relative;
    display: inline-block;
}

.auth-provider-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    min-width: 220px;
    z-index: 150;
    overflow: hidden;
    animation: scaleIn 0.18s ease;
}

.auth-provider-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    background: none;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.auth-provider-btn:hover,
.auth-provider-btn:focus-visible {
    background: var(--primary-light);
}

.auth-provider-btn + .auth-provider-btn {
    border-top: 1px solid var(--border);
}

.auth-provider-btn .provider-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Google "G" */
.auth-provider-btn.google .provider-icon {
    background: #4285F4;
    color: #fff;
    font-size: 1rem;
}

/* Microsoft four-color square */
.auth-provider-btn.microsoft .provider-icon {
    background: #fff;
    border: 1px solid #d3d3d3;
}

.auth-provider-btn.microsoft .provider-icon .ms-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-provider-btn .provider-label {
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* ---- Auth User Menu (dropdown) ---- */
.auth-menu {
    position: relative;
    display: inline-block;
}

.auth-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-pill);
    border: 2px solid var(--primary);
    background: var(--primary-light);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: var(--font);
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.auth-user-btn:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 12px var(--primary-glow);
    transform: translateY(-1px);
}

.auth-user-btn .user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.auth-user-btn .user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.auth-user-btn .user-fallback {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
}

.auth-user-btn .user-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    min-width: 190px;
    z-index: 150;
    overflow: hidden;
    animation: scaleIn 0.18s ease;
}

.auth-dropdown .dropdown-user-info {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}

.auth-dropdown .dropdown-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.auth-dropdown .dropdown-email {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 3px;
}

.auth-dropdown .dropdown-signout {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    background: none;
    color: #DC2626;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    transition: background var(--transition);
}

.auth-dropdown .dropdown-signout:hover {
    background: #FEF2F2;
}

/* ---- Auth Page ---- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height) - var(--nav-height) - 3rem);
    padding: 1rem;
}

.auth-card {
    background: var(--card-bg-solid);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    padding: 2.25rem 1.75rem;
    max-width: 420px;
    width: 100%;
    animation: slideUp 0.4s ease;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo {
    font-size: 2.75rem;
    display: block;
    margin-bottom: 0.4rem;
}

.auth-app-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

/* ---- Social sign-in stack ---- */
.auth-social-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.25rem;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--card-bg-solid);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.auth-social-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.auth-social-btn:active {
    transform: scale(0.98);
}

.auth-social-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.auth-social-btn .social-svg {
    flex-shrink: 0;
}

/* ---- Divider ---- */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ---- Email form ---- */
.auth-email-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.auth-field input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    transition: all var(--transition);
}

.auth-field input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--card-bg-solid);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.auth-field input::placeholder {
    color: var(--text-muted);
}

.auth-error {
    background: #FEF2F2;
    color: #DC2626;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid #FECACA;
}

.auth-submit-btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px var(--primary-glow);
}

.auth-submit-btn:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 16px var(--primary-glow);
    transform: translateY(-1px);
}

.auth-submit-btn:active {
    transform: scale(0.98);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

/* ---- Switch between sign-in / sign-up ---- */
.auth-switch {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1.25rem;
}

.auth-switch-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font);
    text-decoration: underline;
    text-underline-offset: 3px;
    -webkit-tap-highlight-color: transparent;
}

.auth-switch-btn:hover {
    color: var(--primary-dark);
}

/* ---- Sleep Tracker ---- */
.sleep-summary {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.sleep-stat {
    text-align: center;
}

.sleep-stat-num {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.03em;
}

.sleep-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Achievements ---- */
.achievements-card {
    border: 1px solid #FCD34D;
    background: linear-gradient(135deg, var(--card-bg), #FFFBEB);
}

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

.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 0.4rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 1.5rem;
    transition: all var(--transition);
}

.achievement-badge span {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.achievement-badge.locked {
    background: var(--bg);
    filter: grayscale(1);
    opacity: 0.5;
}

.achievement-badge.unlocked {
    background: #FEF3C7;
    border: 2px solid #F59E0B;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
    animation: scaleIn 0.4s ease;
}

.achievement-badge.unlocked span {
    color: #92400E;
}

/* ---- AI Chatbot ---- */
.chat-fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 1.2rem);
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    z-index: 110;
    transition: all var(--transition);
    animation: scaleIn 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
    background: var(--primary-dark);
}

.chat-modal {
    position: fixed;
    bottom: calc(var(--nav-height) + 0.5rem);
    right: 0.5rem;
    width: calc(100% - 1rem);
    max-width: 380px;
    height: 420px;
    background: var(--card-bg-solid);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    z-index: 120;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-limit {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.2);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-msg {
    max-width: 85%;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.45;
    word-wrap: break-word;
}

.chat-msg.bot {
    align-self: flex-start;
    background: var(--bg);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg small { font-size: 0.7rem; opacity: 0.6; }

.chat-input-area {
    display: flex;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.chat-input-area input {
    flex: 1;
    padding: 0.5rem 0.7rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-family: var(--font);
    background: var(--card-bg-solid);
    color: var(--text);
}

.chat-input-area input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ---- Goals ---- */
.goals-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.goal-item { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0; }
.goal-item span { font-size: 0.85rem; font-weight: 600; }
.goal-item input { width: 70px; padding: 0.4rem 0.5rem; border: 2px solid var(--border); border-radius: var(--radius-sm); text-align: center; font-size: 0.9rem; font-family: var(--font); background: var(--bg); color: var(--text); }

/* ---- Smart Reminders ---- */
.reminders-card {
    border: 1px solid var(--primary-light);
    background: linear-gradient(135deg, var(--card-bg), #f0fdf4);
}

.reminder-toggles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reminder-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.reminder-toggle:hover {
    background: var(--primary-light);
}

.reminder-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.toggle-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.toggle-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.toggle-text strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.toggle-text small {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- AI Analysis Components ---- */
.ai-card {
    border: 1px solid var(--primary-light);
    background: linear-gradient(135deg, var(--card-bg), var(--primary-light));
}

.ai-spinner {
    text-align: center;
    padding: 1rem;
    font-weight: 600;
    color: var(--primary);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-preview {
    margin-top: 0.75rem;
    text-align: center;
}

.ai-preview img {
    max-width: 100%;
    max-height: 240px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    object-fit: cover;
}

.ai-preview-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.2rem;
}

.ai-result {
    margin-top: 0.75rem;
}

.ai-result-card {
    background: var(--card-bg-solid);
    border-radius: var(--radius-sm);
    padding: 1rem;
    border: 1px solid var(--border);
}

.ai-result-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.ai-macros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ai-macro {
    background: var(--bg);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.ai-macro strong {
    color: var(--text);
    font-size: 0.9rem;
}

.ai-score-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.ai-score-badge.score-1,
.ai-score-badge.score-2 { background: #FEE2E2; color: #DC2626; }
.ai-score-badge.score-3 { background: #FEF3C7; color: #D97706; }
.ai-score-badge.score-4,
.ai-score-badge.score-5 { background: #D1FAE5; color: #059669; }

.ai-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.ai-error {
    color: #DC2626;
    font-weight: 600;
    font-size: 0.85rem;
}

.ai-log-btn,
.ai-log-study,
.ai-log-water {
    margin-top: 0.5rem;
}

/* Water tracking */
.ai-water-btns {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ai-water-previews {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.ai-water-previews .ai-preview {
    flex: 1;
    max-width: 48%;
}

.ai-water-compare {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.ai-water-drank {
    font-size: 0.95rem;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Study suggestions */
.ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.ai-tip {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0.4rem 0.6rem;
    background: var(--bg);
    border-radius: var(--radius-xs);
    line-height: 1.4;
}

/* ---- Print Styles ---- */
@media print {
    .bottom-nav, .app-header, .quick-actions, .btn {
        display: none !important;
    }
    body {
        padding: 0;
        background: #fff;
        background-image: none;
    }
    body::before { display: none; }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        backdrop-filter: none;
    }
}
