@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Variables ── */
:root {
    /* App / dashboard */
    --bg:           #e0ddc7;
    --brown:        #5a4a3a;
    --brown-dark:   #3d3028;
    --brown-mid:    #8b7355;
    --input-bg:     #faf9f7;
    --text-muted:   #6b6559;
    --text-hint:    #9e9890;

    /* Shared analysis + app */
    --text:         #2A2420;
    --border:       #DDD5CA;

    /* Analysis palette */
    --terra:        #C0573A;
    --teal:         #3D6B6B;
    --beige:        #F2EDE4;
    --beige-dark:   #E8E0D4;
    --terra-pale:   #F5E8E4;
    --teal-pale:    #E4EDED;
    --muted:        #8A7E78;
    --night:        #3A3A4A;
    --night-pale:   #EEEEF2;

    /* Measurements */
    --green:        #3A7A5A;
    --green-pale:   #E4F0EA;
    --red:          #B84040;
    --red-pale:     #F5E4E4;
    --amber:        #9A7A30;
    --amber-pale:   #FFF3DC;
}

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

/* ── Animations ── */
@keyframes fadeDown { from { opacity:0; transform:translateY(-12px) } to { opacity:1; transform:translateY(0) } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(16px)  } to { opacity:1; transform:translateY(0) } }

/* ── Body ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--beige);
    color: var(--text);
    min-height: 100vh;
}

.analysis-page {
    font-family: 'DM Sans', sans-serif;
    background: var(--beige);
    color: var(--text);
    min-height: 100vh;
    padding: 24px 16px 48px;
}

.measurements-page { padding-bottom: 60px; }


/* ══════════════════════════════════════
   WELCOME / LOGIN PAGE
══════════════════════════════════════ */
.welcome-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.card {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo { width: 180px; height: 180px; object-fit: contain; margin-bottom: 1.8rem; }

.intro { text-align: center; margin-bottom: 2rem; }
.intro h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: .5rem; letter-spacing: -.3px; }
.intro p  { font-size: .95rem; color: var(--text-muted); line-height: 1.55; }

.login-box { width: 100%; background: #fff; border-radius: 16px; padding: 1.4rem; box-shadow: 0 2px 16px rgba(0,0,0,.07); }

.token-input {
    width: 100%; padding: .85rem 1rem; font-size: 1rem;
    border: 1.5px solid var(--border); border-radius: 10px;
    outline: none; background: var(--input-bg); color: var(--text); transition: border-color .15s;
}
.token-input::placeholder { color: #b0aa9f; }
.token-input:focus { border-color: var(--brown-mid); background: #fff; }

.token-submit {
    margin-top: .75rem; width: 100%; padding: .85rem; font-size: 1rem;
    font-weight: 600; background: var(--brown); color: #fff; border: none;
    border-radius: 10px; cursor: pointer; transition: background .15s;
}
.token-submit:hover { background: var(--brown-dark); }

.hint { margin-top: .9rem; font-size: .82rem; color: var(--text-hint); text-align: center; line-height: 1.5; }

.alert-error {
    width: 100%; margin-bottom: 1rem; padding: .8rem 1rem;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px;
    color: #b91c1c; font-size: .9rem; text-align: center;
}

.powered { margin-top: 2.2rem; font-size: .8rem; color: #a09890; }


/* ══════════════════════════════════════
   SITE HEADER (dashboard / history)
══════════════════════════════════════ */
.site-header { background: #fff; border-bottom: 1px solid var(--border); padding: 0.75rem 1rem; }

.site-header-inner {
    max-width: 64rem; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.site-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.site-logo img { width: 36px; height: 36px; object-fit: contain; }
.site-logo-name { font-size: 1.1rem; font-weight: 700; color: var(--brown); letter-spacing: -.3px; }


/* ══════════════════════════════════════
   USER MENU DROPDOWN (component)
══════════════════════════════════════ */
.user-menu { position: relative; }

.user-menu-btn {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-family: inherit;
    color: #374151; background: none; border: none; cursor: pointer; padding: 0;
}
.user-menu-btn:hover { color: #111827; }
.user-menu-btn:focus { outline: none; }

.user-menu-arrow {
    width: 16px; height: 16px; color: #9ca3af;
    transition: transform 0.2s; flex-shrink: 0;
}
.user-menu-arrow.open { transform: rotate(180deg); }

.user-menu-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    width: 192px; background: #fff;
    border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
    border: 1px solid #f3f4f6; padding: 4px 0; z-index: 50;
}

.user-menu-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; font-size: 13px; font-family: inherit;
    color: #374151; text-decoration: none;
    width: 100%; text-align: left; background: none; border: none; cursor: pointer;
}
.user-menu-item:hover { background: #f9fafb; }

.user-menu-divider { border-top: 1px solid #f3f4f6; margin: 4px 0; }


/* ══════════════════════════════════════
   ANALYSIS PAGES — SHARED HEADER
══════════════════════════════════════ */
.header {
    display: flex; align-items: center;
    margin-bottom: 28px; animation: fadeDown .5s ease both;
}
.breakfast-page .header,
.lunch-page .header,
.dinner-page .header { gap: 14px; }
.report-page .header,
.measurements-page .header { justify-content: space-between; }

.logo-group { display: flex; align-items: center; gap: 12px; }
.logo-pair  { display: flex; gap: 3px; }

.logo-b {
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Cormorant Garamond', serif; font-size: 17px; font-weight: 600; color: #fff;
}
.logo-b.terra { background: var(--terra); }
.logo-b.teal  { background: var(--teal); }

.header-text h1 { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 600; line-height: 1; }
.header-text p  { font-size: 11px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }
.header-back    { margin-left: auto; font-size: 13px; color: var(--muted); text-decoration: none; }
.header-back:hover { color: var(--text); }

.date-chip {
    font-size: 11px; color: var(--muted); background: #fff;
    border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px;
}


/* ══════════════════════════════════════
   ANALYSIS PAGES — MEAL TAG
══════════════════════════════════════ */
.meal-tag {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--terra); color: #fff;
    border-radius: 20px; padding: 6px 16px;
    font-size: 12px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase;
    margin-bottom: 20px; animation: fadeDown .5s .1s ease both;
}
.lunch-page  .meal-tag { background: var(--teal); }
.dinner-page .meal-tag { background: var(--night); }
.drink-page  .meal-tag { background: #2196a8; }


/* ══════════════════════════════════════
   FOOD ANALYSIS — SCORE CARD
══════════════════════════════════════ */
.score-card {
    background: var(--terra); border-radius: 24px; padding: 24px 22px;
    color: #fff; margin-bottom: 14px; position: relative; overflow: hidden;
    animation: fadeUp .5s .15s ease both;
}
.lunch-page  .score-card { background: var(--teal); }
.drink-page  .score-card { background: #2196a8; }
.score-card::before { position: absolute; right: 20px; top: 16px; font-size: 48px; opacity: .15; }
.breakfast-page .score-card::before { content: '☀️'; }
.lunch-page     .score-card::before { content: '🌞'; }
.drink-page     .score-card::before { content: '🥤'; }

.sc-top     { display: flex; justify-content: space-between; align-items: flex-start; }
.sc-score   { font-family: 'Cormorant Garamond', serif; font-size: 56px; font-weight: 600; line-height: 1; }
.sc-score span { font-size: 20px; opacity: .7; }
.sc-label   { font-size: 11px; opacity: .7; letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }
.sc-verdict { font-size: 18px; font-weight: 500; margin-top: 14px; }
.sc-time    { font-size: 12px; opacity: .65; margin-top: 4px; }


/* ══════════════════════════════════════
   FOOD ANALYSIS — CALORIES BAR
══════════════════════════════════════ */
.cal-row { background: #fff; border-radius: 18px; padding: 18px 20px; margin-bottom: 14px; animation: fadeUp .5s .2s ease both; }
.cal-row-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

.cal-numbers { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.cal-big     { font-family: 'Cormorant Garamond', serif; font-size: 36px; font-weight: 600; color: var(--terra); line-height: 1; }
.cal-big span { font-size: 14px; font-weight: 400; color: var(--muted); font-family: 'DM Sans', sans-serif; }
.cal-remain  { font-size: 13px; color: var(--teal); font-weight: 500; }

.lunch-page .cal-big    { color: var(--teal); }
.lunch-page .cal-remain { color: var(--terra); }

.bar-bg   { height: 8px; background: var(--beige-dark); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal), #5D9B9B); border-radius: 99px; }
.breakfast-page .bar-fill { background: linear-gradient(90deg, var(--terra), #D4795E); }

.cal-sub { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--muted); }

.meal-chips { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.meal-chip  { font-size: 10px; padding: 3px 10px; border-radius: 20px; background: var(--teal-pale); color: var(--teal); font-weight: 500; }
.meal-chip.current { background: var(--teal); color: #fff; }


/* ══════════════════════════════════════
   FOOD ANALYSIS — BJU GRID (cards)
══════════════════════════════════════ */
.bju-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; animation: fadeUp .5s .25s ease both; }

.bju-card   { border-radius: 16px; padding: 16px 12px; text-align: center; }
.bju-card.p { background: var(--teal-pale); }
.bju-card.f { background: var(--terra-pale); }
.bju-card.c { background: var(--beige-dark); }

.bju-val    { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; line-height: 1; }
.bju-card.p .bju-val { color: var(--teal); }
.bju-card.f .bju-val { color: var(--terra); }
.bju-card.c .bju-val { color: #7A6A50; }

.bju-unit { font-size: 11px; color: var(--muted); margin-top: 2px; }

.bju-card .bju-name { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 5px; }

.bju-bar      { height: 3px; border-radius: 99px; margin-top: 8px; background: var(--border); overflow: hidden; }
.bju-bar-fill { height: 100%; border-radius: 99px; }
.bju-card.p .bju-bar-fill { background: var(--teal); }
.bju-card.f .bju-bar-fill { background: var(--terra); }
.bju-card.c .bju-bar-fill { background: #7A6A50; }


/* ══════════════════════════════════════
   PHOTO DESCRIPTION CARD
══════════════════════════════════════ */
.photo-desc-card { display: flex; gap: 10px; align-items: flex-start; background: var(--beige-dark); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; animation: fadeUp .4s .1s ease both; }
.photo-desc-icon { font-size: 18px; flex-shrink: 0; }
.photo-desc-text { font-size: 14px; color: var(--text); line-height: 1.5; }


/* ══════════════════════════════════════
   DRINK ANALYSIS CARD
══════════════════════════════════════ */
.drink-card { background: #fff; border-radius: 20px; padding: 20px; margin-bottom: 14px; animation: fadeUp .5s .2s ease both; text-align: center; }
.drink-name { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.drink-type-badge { display: inline-block; background: #e8f4f5; color: #2196a8; border-radius: 20px; padding: 4px 14px; font-size: 13px; font-weight: 500; margin-bottom: 18px; }
.drink-stats { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 12px; }
.drink-stat { flex: 1; }
.drink-stat-val { font-family: 'Cormorant Garamond', serif; font-size: 36px; font-weight: 600; color: #2196a8; line-height: 1; }
.drink-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.drink-stat-div { width: 1px; height: 40px; background: var(--beige-dark); margin: 0 4px; }
.drink-macros { display: flex; justify-content: center; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 4px; }


/* ══════════════════════════════════════
   FOOD ANALYSIS — ITEMS LIST
══════════════════════════════════════ */
.items-card { background: #fff; border-radius: 18px; padding: 18px 20px; margin-bottom: 14px; animation: fadeUp .5s .3s ease both; }
.card-title { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }

.item-row        { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--beige-dark); }
.item-row:last-child { border-bottom: none; padding-bottom: 0; }
.item-icon       { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.item-info       { flex: 1; }
.item-name       { font-size: 14px; font-weight: 500; }
.item-gram       { font-size: 12px; color: var(--muted); margin-top: 1px; }
.item-badge      { font-size: 10px; padding: 3px 8px; border-radius: 20px; font-weight: 500; flex-shrink: 0; }
.badge-good      { background: var(--teal-pale); color: var(--teal); }
.badge-ok        { background: #FFF3DC; color: #9A7A30; }
.badge-warn      { background: var(--terra-pale); color: var(--terra); }

.item-kcal                  { font-size: 14px; font-weight: 600; flex-shrink: 0; }
.breakfast-page .item-kcal  { color: var(--terra); }
.lunch-page     .item-kcal  { color: var(--teal); }
.dinner-page    .item-kcal  { color: var(--night); }


/* ══════════════════════════════════════
   FOOD ANALYSIS — ALERTS
══════════════════════════════════════ */
.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; animation: fadeUp .5s .35s ease both; }
.alert  { display: flex; gap: 12px; align-items: flex-start; border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.alert.success { background: var(--teal-pale); }
.alert.warning { background: #FFF3DC; }
.alert.danger  { background: var(--terra-pale); }
.alert.info    { background: var(--beige-dark); }
.alert-icon    { font-size: 16px; flex-shrink: 0; }
.alert strong  { display: block; font-weight: 600; margin-bottom: 2px; font-size: 13px; }


/* ══════════════════════════════════════
   FOOD ANALYSIS — NEXT MEAL / WATER ROW
══════════════════════════════════════ */
.next-card  { background: var(--teal); border-radius: 18px; padding: 20px; color: #fff; animation: fadeUp .5s .4s ease both; }
.lunch-page .next-card { background: var(--terra); }
.next-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; opacity: .65; margin-bottom: 10px; }
.next-title { font-family: 'Cormorant Garamond', serif; font-size: 20px; margin-bottom: 6px; }
.next-desc  { font-size: 13px; opacity: .8; line-height: 1.5; }
.next-time  { font-size: 22px; font-weight: 600; margin-top: 12px; opacity: .9; }

.water-row { background: #fff; border-radius: 18px; padding: 14px 20px; margin-top: 14px; display: flex; align-items: center; justify-content: space-between; animation: fadeUp .5s .45s ease both; }
.water-row span { font-size: 13px; color: var(--muted); }
.water-val  { font-family: 'Cormorant Garamond', serif; font-size: 22px; color: var(--teal); font-weight: 600; }

.lunch-page .ctx-card { background: #fff; border-radius: 18px; padding: 16px 20px; margin-bottom: 14px; animation: fadeUp .5s .2s ease both; border-left: 4px solid var(--terra); }
.ctx-label  { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.ctx-row    { display: flex; justify-content: space-between; align-items: center; }
.ctx-score  { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; color: var(--terra); line-height: 1; }
.ctx-score span { font-size: 12px; opacity: .6; font-family: 'DM Sans', sans-serif; }
.ctx-stats  { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.ctx-stats strong { color: var(--text); font-weight: 500; }
.ctx-alert  { margin-top: 8px; font-size: 12px; color: var(--terra); background: var(--terra-pale); border-radius: 8px; padding: 6px 10px; }


/* ══════════════════════════════════════
   DINNER — TIMELINE
══════════════════════════════════════ */
.timeline-card { background: #fff; border-radius: 18px; padding: 18px 20px; margin-bottom: 14px; animation: fadeUp .5s .12s ease both; }
.tl-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.tl-row   { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--beige-dark); }
.tl-row:last-child { border-bottom: none; }
.tl-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tl-dot.good   { background: var(--teal); }
.tl-dot.ok     { background: #D4A030; }
.tl-dot.warn   { background: var(--terra); }
.tl-dot.active { background: var(--night); box-shadow: 0 0 0 3px var(--night-pale); }
.tl-meal        { flex: 1; font-size: 13px; }
.tl-meal strong { font-weight: 600; }
.tl-meal span   { font-size: 12px; color: var(--muted); display: block; }
.tl-kcal        { font-size: 14px; font-weight: 600; color: var(--muted); }
.tl-kcal.active { color: var(--night); }


/* ══════════════════════════════════════
   DINNER — DAY CLOSING SCORE
══════════════════════════════════════ */
.close-card {
    border-radius: 24px; padding: 24px 22px; color: #fff; margin-bottom: 14px;
    position: relative; overflow: hidden; animation: fadeUp .5s .15s ease both;
    background: linear-gradient(135deg, #3A3A4A 0%, #2A2A38 100%);
}
.close-card::before { content: '🌙'; position: absolute; right: 20px; top: 16px; font-size: 48px; opacity: .2; }
.cc-top        { display: flex; justify-content: space-between; align-items: flex-start; }
.cc-score-pair { display: flex; gap: 20px; }
.cc-score-block { text-align: center; }
.cc-score      { font-family: 'Cormorant Garamond', serif; font-size: 48px; font-weight: 600; line-height: 1; }
.cc-score span { font-size: 18px; opacity: .7; }
.cc-score-label { font-size: 10px; opacity: .6; letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
.cc-divider    { width: 1px; background: rgba(255,255,255,.2); align-self: stretch; }
.cc-verdict    { font-size: 17px; font-weight: 500; margin-top: 14px; line-height: 1.4; }
.cc-sub        { font-size: 12px; opacity: .6; margin-top: 6px; }


/* ══════════════════════════════════════
   DINNER — FINAL BJU BARS
══════════════════════════════════════ */
.final-bju { background: #fff; border-radius: 18px; padding: 18px 20px; margin-bottom: 14px; animation: fadeUp .5s .2s ease both; }
.fb-title   { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.fb-row     { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fb-row:last-child { margin-bottom: 0; }
.fb-name    { font-size: 12px; color: var(--muted); width: 70px; flex-shrink: 0; }
.fb-bar-bg  { flex: 1; height: 8px; background: var(--beige-dark); border-radius: 99px; overflow: hidden; }
.fb-bar-fill { height: 100%; border-radius: 99px; }
.fb-row.p .fb-bar-fill { background: var(--teal); }
.fb-row.f .fb-bar-fill { background: var(--terra); }
.fb-row.c .fb-bar-fill { background: #7A6A50; }
.fb-nums    { font-size: 12px; font-weight: 600; width: 80px; text-align: right; flex-shrink: 0; }
.fb-row.p .fb-nums { color: var(--teal); }
.fb-row.f .fb-nums { color: var(--terra); }
.fb-row.c .fb-nums { color: #7A6A50; }


/* ══════════════════════════════════════
   DINNER — WATER WITH CUPS
══════════════════════════════════════ */
.water-card  { background: var(--teal-pale); border-radius: 16px; padding: 16px 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; animation: fadeUp .5s .3s ease both; }
.water-icon  { font-size: 28px; }
.water-info  { flex: 1; }
.water-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--teal); }
.water-cups  { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.cup         { width: 18px; height: 22px; border-radius: 3px 3px 5px 5px; border: 1.5px solid var(--border); }
.cup.full    { border-color: var(--teal); background: rgba(61,107,107,.2); }
.water-text  { font-size: 13px; font-weight: 600; color: var(--teal); margin-top: 6px; }


/* ══════════════════════════════════════
   DINNER — TOMORROW CARD
   (scoped to avoid conflict with daily-report's .tomorrow)
══════════════════════════════════════ */
.tomorrow-card { background: var(--terra); border-radius: 18px; padding: 20px; color: #fff; animation: fadeUp .5s .38s ease both; }
.tomorrow-card .tm-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; opacity: .65; margin-bottom: 10px; }
.tomorrow-card .tm-title { font-family: 'Cormorant Garamond', serif; font-size: 20px; margin-bottom: 12px; }
.tomorrow-card .tm-row   { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.15); }
.tomorrow-card .tm-row:last-child { border-bottom: none; }
.tomorrow-card .tm-icon  { font-size: 16px; width: 24px; text-align: center; }
.tomorrow-card .tm-text  { font-size: 13px; opacity: .9; }


/* ══════════════════════════════════════
   RE-ANALYZE FORM + DAY REPORT LINK
══════════════════════════════════════ */
.report-day-section  { margin-top: 16px; animation: fadeUp .5s .5s ease both; }
.report-day-link {
    display: block; text-align: center; padding: 14px;
    border: 1px solid var(--border); border-radius: 14px;
    background: var(--beige-dark); font-size: 13px; color: var(--muted); text-decoration: none;
}
.reanalyze-section   { margin-top: 10px; animation: fadeUp .5s .6s ease both; }
.reanalyze-hint      { font-size: 11px; color: var(--muted); text-align: center; margin-bottom: 8px; }
.reanalyze-photo-label {
    display: block; margin-bottom: 8px; padding: 10px 14px;
    border: 1px dashed var(--border); border-radius: 12px;
    background: #fff; cursor: pointer; text-align: center; font-size: 12px; color: var(--muted);
}
.reanalyze-photo-label input[type="file"] { display: none; }
.reanalyze-btn {
    width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--beige-dark); font-family: 'DM Sans', sans-serif;
    font-size: 13px; color: var(--muted); cursor: pointer;
}


/* ══════════════════════════════════════
   DAILY REPORT PAGE
══════════════════════════════════════ */
.report-tag {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, var(--terra), var(--teal)); color: #fff;
    border-radius: 20px; padding: 6px 18px;
    font-size: 12px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase;
    margin-bottom: 20px; animation: fadeDown .5s .1s ease both;
}

.empty-card  { background: #fff; border-radius: 22px; padding: 36px 24px; text-align: center; animation: fadeUp .5s .15s ease both; }
.empty-icon  { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; margin-bottom: 8px; }
.empty-sub   { font-size: 13px; color: var(--muted); line-height: 1.6; }
.gen-btn     { display: block; margin: 20px auto 0; background: var(--terra); color: #fff; border: none; border-radius: 14px; padding: 14px 28px; font-size: 14px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; }

.hero     { border-radius: 26px; overflow: hidden; margin-bottom: 14px; animation: fadeUp .5s .15s ease both; }
.hero-top { background: linear-gradient(135deg, #2E3B3B 0%, #3D6B6B 100%); padding: 28px 22px 24px; color: #fff; position: relative; }
.hero-top::before { content: '📋'; position: absolute; right: 20px; top: 18px; font-size: 52px; opacity: .15; }
.hero-date  { font-size: 11px; opacity: .6; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.hs-num     { font-family: 'Cormorant Garamond', serif; font-size: 64px; font-weight: 600; line-height: 1; }
.hs-num span { font-size: 22px; opacity: .6; }
.hs-label   { font-size: 11px; opacity: .6; letter-spacing: 1px; text-transform: uppercase; }
.hs-verdict { font-size: 17px; font-weight: 500; margin-top: 14px; line-height: 1.3; }
.hero-meals { background: rgba(255,255,255,.08); display: flex; }
.hm-col     { flex: 1; padding: 14px 16px; border-right: 1px solid rgba(255,255,255,.1); }
.hm-col:last-child { border-right: none; }
.hm-meal    { font-size: 10px; opacity: .6; letter-spacing: .5px; text-transform: uppercase; }
.hm-score   { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; color: #fff; margin-top: 2px; }
.hm-kcal    { font-size: 11px; opacity: .55; margin-top: 1px; }

.cal-summary { background: #fff; border-radius: 18px; padding: 20px; margin-bottom: 14px; animation: fadeUp .5s .2s ease both; }
.cs-title    { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.cs-big      { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.cs-num      { font-family: 'Cormorant Garamond', serif; font-size: 40px; font-weight: 600; color: var(--teal); }
.cs-num span { font-size: 14px; font-weight: 400; color: var(--muted); font-family: 'DM Sans', sans-serif; }
.cs-diff     { font-size: 13px; color: var(--terra); font-weight: 500; }
.report-page .bar-bg   { height: 10px; }
.report-page .bar-fill { background: linear-gradient(90deg, var(--teal), #5A9090); }
.cs-breakdown  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.cs-meal       { background: var(--beige-dark); border-radius: 12px; padding: 10px; text-align: center; }
.cs-meal-icon  { font-size: 16px; }
.cs-meal-kcal  { font-size: 16px; font-weight: 700; margin-top: 3px; }
.cs-meal-name  { font-size: 10px; color: var(--muted); margin-top: 2px; }

.bju-section { background: #fff; border-radius: 18px; padding: 20px; margin-bottom: 14px; animation: fadeUp .5s .25s ease both; }
.bju-title   { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.bju-row     { margin-bottom: 14px; }
.bju-row:last-child { margin-bottom: 0; }
.bju-top     { display: flex; justify-content: space-between; margin-bottom: 6px; }
.bju-row .bju-name { font-size: 13px; font-weight: 500; }
.bju-nums    { font-size: 13px; font-weight: 600; }
.bju-row.p .bju-nums { color: var(--teal); }
.bju-row.f .bju-nums { color: var(--terra); }
.bju-row.c .bju-nums { color: #7A6A50; }
.bju-bar-bg  { height: 8px; background: var(--beige-dark); border-radius: 99px; overflow: hidden; }
.bju-row.p .bju-bar-fill { background: var(--teal); }
.bju-row.f .bju-bar-fill { background: var(--terra); }
.bju-row.c .bju-bar-fill { background: #7A6A50; }

.dr-activity-card { display: flex; gap: 14px; align-items: center; background: var(--teal-pale); border-radius: 16px; padding: 16px; margin-bottom: 14px; animation: fadeUp .5s .28s ease both; }
.dr-activity-icon { font-size: 28px; flex-shrink: 0; }
.dr-activity-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--teal); font-weight: 600; margin-bottom: 4px; }
.dr-activity-text { font-size: 14px; color: var(--text); line-height: 1.45; }

.dr-drinks-card { background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 14px; animation: fadeUp .5s .29s ease both; }
.dr-drinks-title { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.dr-drinks-stats { display: flex; gap: 20px; margin-bottom: 10px; }
.dr-drinks-val { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; color: #2196a8; line-height: 1; }
.dr-drinks-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.dr-drinks-feedback { font-size: 13px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--beige-dark); padding-top: 10px; }

.wm-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; animation: fadeUp .5s .3s ease both; }
.wm-card  { border-radius: 16px; padding: 16px; }
.wm-card.wins { background: var(--teal-pale); }
.wm-card.miss { background: var(--terra-pale); }
.wm-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.wm-card.wins .wm-title { color: var(--teal); }
.wm-card.miss .wm-title { color: var(--terra); }
.wm-item  { font-size: 12px; line-height: 1.5; padding: 4px 0; border-bottom: 1px solid rgba(0,0,0,.06); }
.wm-item:last-child { border-bottom: none; }

.tomorrow { background: var(--terra); border-radius: 18px; padding: 22px; color: #fff; margin-bottom: 14px; animation: fadeUp .5s .35s ease both; }
.tomorrow .tm-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; opacity: .65; margin-bottom: 12px; }
.tomorrow .tm-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; margin-bottom: 16px; }
.tm-rows  { display: flex; flex-direction: column; gap: 10px; }
.tm-item  { display: flex; gap: 12px; align-items: flex-start; }
.tomorrow .tm-icon { font-size: 18px; flex-shrink: 0; width: 24px; }
.tomorrow .tm-text { font-size: 13px; line-height: 1.5; opacity: .9; }
.tomorrow .tm-text strong { font-weight: 600; display: block; }

.back-link       { display: block; text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); text-decoration: none; animation: fadeUp .5s .4s ease both; }
.back-link:hover { color: var(--text); }


/* ══════════════════════════════════════
   MEASUREMENTS PAGE
══════════════════════════════════════ */
.tabs { display: flex; background: #fff; border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 20px; border: 1px solid var(--border); animation: fadeDown .5s .1s ease both; }
.tab  { flex: 1; padding: 10px; border-radius: 10px; font-size: 13px; font-weight: 500; text-align: center; cursor: pointer; border: none; background: transparent; color: var(--muted); transition: all .2s; }
.tab.active { background: var(--terra); color: #fff; }

.view        { display: none; }
.view.active { display: block; }

.input-hero { background: var(--terra); border-radius: 22px; padding: 22px 20px; color: #fff; margin-bottom: 16px; position: relative; overflow: hidden; animation: fadeUp .5s .15s ease both; }
.input-hero::before { content: '📏'; position: absolute; right: 16px; top: 14px; font-size: 52px; opacity: .15; }
.ih-label { font-size: 11px; opacity: .65; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.ih-title { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 600; }
.ih-sub   { font-size: 13px; opacity: .75; margin-top: 6px; }

.prev-card  { background: #fff; border-radius: 16px; padding: 14px 18px; margin-bottom: 16px; border-left: 4px solid var(--teal); animation: fadeUp .5s .18s ease both; }
.prev-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--teal); margin-bottom: 8px; }
.prev-row   { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.prev-key   { color: var(--muted); }
.prev-val   { font-weight: 600; }

.metrics-form { display: flex; flex-direction: column; gap: 12px; animation: fadeUp .5s .2s ease both; }

.metric-input-card { background: #fff; border-radius: 16px; padding: 16px 18px; border: 1.5px solid var(--border); transition: border-color .2s, box-shadow .2s; }
.metric-input-card:focus-within { border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-pale); }
.mic-top  { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mic-icon { font-size: 22px; }
.mic-info { flex: 1; }
.mic-name { font-size: 14px; font-weight: 600; }
.mic-desc { font-size: 11px; color: var(--muted); margin-top: 1px; }
.mic-prev { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--beige-dark); border-radius: 8px; padding: 3px 9px; white-space: nowrap; }
.mic-input-row { display: flex; align-items: center; gap: 10px; }
.mic-input {
    flex: 1; height: 44px; border-radius: 10px; border: 1.5px solid var(--border);
    background: var(--beige); font-family: 'DM Sans', sans-serif; font-size: 22px;
    font-weight: 600; color: var(--text); text-align: center; outline: none;
    transition: border-color .2s; -moz-appearance: textfield;
}
.mic-input::-webkit-outer-spin-button,
.mic-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.mic-input:focus { border-color: var(--terra); background: #fff; }
.mic-unit { font-size: 13px; color: var(--muted); font-weight: 500; width: 36px; }
.mic-diff { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; min-width: 60px; text-align: center; }
.diff-down { background: var(--green-pale); color: var(--green); }
.diff-up   { background: var(--red-pale);   color: var(--red); }
.diff-zero { background: var(--beige-dark); color: var(--muted); }

.save-btn { background: var(--terra); color: #fff; border: none; border-radius: 14px; padding: 16px; font-size: 16px; font-weight: 600; font-family: 'DM Sans', sans-serif; cursor: pointer; width: 100%; margin-top: 4px; transition: opacity .2s; }
.save-btn:active { opacity: .85; }
.save-btn-spaced { margin-top: 8px; }

.report-hero { border-radius: 22px; overflow: hidden; margin-bottom: 14px; animation: fadeUp .5s .15s ease both; box-shadow: 0 6px 24px rgba(44,30,26,.1); }
.rh-top      { background: linear-gradient(150deg, var(--teal) 0%, #2A4E4E 100%); padding: 26px 20px 20px; color: #fff; position: relative; overflow: hidden; }
.rh-top::before { content: '📊'; position: absolute; right: 16px; top: 14px; font-size: 52px; opacity: .15; }
.rh-eyebrow  { font-size: 11px; opacity: .6; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
.rh-date     { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; }
.rh-prev     { font-size: 12px; opacity: .6; margin-top: 4px; }
.rh-summary  { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.rh-chip     { font-size: 11px; padding: 4px 12px; border-radius: 20px; font-weight: 600; }
.chip-improve { background: rgba(168,240,160,.2); color: #A8F0A0; border: 1px solid rgba(168,240,160,.3); }
.chip-stable  { background: rgba(255,209,102,.15); color: #FFD166; border: 1px solid rgba(255,209,102,.25); }
.chip-warn    { background: rgba(255,150,120,.15); color: #FF9678; border: 1px solid rgba(255,150,120,.25); }

.weight-card { background: #fff; border-radius: 18px; padding: 20px; margin-bottom: 12px; animation: fadeUp .5s .2s ease both; }
.wc-label    { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.wc-main     { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.wc-val      { font-family: 'Cormorant Garamond', serif; font-size: 52px; font-weight: 600; line-height: 1; }
.wc-val span { font-size: 18px; font-weight: 400; color: var(--muted); font-family: 'DM Sans', sans-serif; }
.wc-change      { padding-bottom: 8px; }
.wc-diff-big    { font-size: 22px; font-weight: 700; }
.wc-diff-big.down { color: var(--green); }
.wc-diff-big.up   { color: var(--red); }
.wc-diff-label  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.sparkline { height: 40px; background: linear-gradient(180deg, var(--teal-pale) 0%, transparent 100%); border-radius: 8px; display: flex; align-items: flex-end; gap: 3px; padding: 4px 6px; overflow: hidden; }
.spark-bar  { flex: 1; border-radius: 3px 3px 0 0; background: var(--teal); opacity: .6; }
.spark-bar.current { opacity: 1; background: var(--terra); }

.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; animation: fadeUp .5s .25s ease both; }
.metric-card  { background: #fff; border-radius: 16px; padding: 16px 14px; }
.mc-top       { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.mc-icon      { font-size: 22px; }
.mc-badge     { font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 600; }
.badge-down-good { background: var(--green-pale); color: var(--green); }
.badge-up-bad    { background: var(--red-pale);   color: var(--red); }
.badge-up-good   { background: var(--green-pale); color: var(--green); }
.badge-stable    { background: var(--beige-dark); color: var(--muted); }
.mc-val    { font-family: 'Cormorant Garamond', serif; font-size: 32px; font-weight: 600; line-height: 1; }
.mc-unit   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mc-name   { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 6px; }
.mc-prev   { font-size: 11px; color: var(--muted); margin-top: 4px; }
.mc-bar-bg { height: 4px; background: var(--beige-dark); border-radius: 99px; margin-top: 10px; overflow: hidden; }

.trend-card  { background: #fff; border-radius: 18px; padding: 20px; margin-bottom: 12px; animation: fadeUp .5s .3s ease both; }
.trend-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.trend-row   { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--beige-dark); }
.trend-row:last-child { border-bottom: none; }
.tr-icon  { font-size: 18px; width: 26px; text-align: center; flex-shrink: 0; }
.tr-name  { flex: 1; font-size: 13px; font-weight: 500; }
.tr-now   { font-size: 14px; font-weight: 700; width: 70px; text-align: right; }
.tr-diff  { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px; flex-shrink: 0; min-width: 60px; text-align: center; }
.td-down-good { background: var(--green-pale); color: var(--green); }
.td-up-good   { background: var(--green-pale); color: var(--green); }
.td-stable    { background: var(--beige-dark); color: var(--muted); }
.td-up-bad    { background: var(--red-pale);   color: var(--red); }

.insight-card { background: var(--terra); border-radius: 18px; padding: 20px; color: #fff; margin-bottom: 12px; animation: fadeUp .5s .35s ease both; }
.ic-label { font-size: 10px; opacity: .65; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; }
.ic-title { font-family: 'Cormorant Garamond', serif; font-size: 20px; margin-bottom: 12px; }
.ic-items { display: flex; flex-direction: column; gap: 8px; }
.ic-item  { display: flex; gap: 10px; font-size: 13px; opacity: .9; line-height: 1.5; }
.ic-item-icon { font-size: 16px; flex-shrink: 0; }

.history-card { background: #fff; border-radius: 18px; padding: 20px; animation: fadeUp .5s .4s ease both; }
.hc-label     { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.hist-row     { display: grid; grid-template-columns: 80px 1fr 1fr 1fr 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--beige-dark); font-size: 12px; align-items: center; }
.hist-row:last-child { border-bottom: none; }
.hist-row.header { font-size: 10px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; padding-bottom: 10px; }
.hist-date         { font-weight: 600; }
.hist-date.current { color: var(--terra); }
.hist-val          { text-align: center; font-weight: 500; }
.hist-val-current  { color: var(--green); font-weight: 700; }

.no-report       { background: #fff; border-radius: 18px; padding: 36px 24px; text-align: center; }
.no-report-icon  { font-size: 48px; margin-bottom: 12px; }
.no-report-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; margin-bottom: 8px; }
.no-report-text  { font-size: 13px; color: var(--muted); }

.add-field-btn { width: 100%; padding: 14px; border: 1.5px dashed var(--border); border-radius: 14px; background: transparent; font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--muted); cursor: pointer; margin-top: 4px; transition: border-color .2s, color .2s; }
.add-field-btn:hover { border-color: var(--teal); color: var(--teal); }

.metric-input-card-new { border-color: var(--teal); position: relative; }
.new-field-remove { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 18px; color: var(--muted); cursor: pointer; line-height: 1; }
.new-field-name   { width: 100%; border: none; outline: none; font-size: 14px; font-weight: 600; font-family: 'DM Sans', sans-serif; background: transparent; color: var(--text); }
.new-field-unit   { width: 48px; border: 1.5px solid var(--border); border-radius: 8px; padding: 4px 6px; font-size: 12px; font-family: 'DM Sans', sans-serif; text-align: center; background: var(--beige); }

.mc-bar-fill-fat     { background: var(--terra); }
.mc-bar-fill-vzh     { background: var(--amber); }
.mc-bar-fill-muscles { background: var(--teal); }
.mc-bar-fill-water   { background: #4A90D9; }


/* ══════════════════════════════════════
   ANALYSIS HISTORY PAGE
══════════════════════════════════════ */
.history-main { max-width: 640px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.history-nav  { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.history-nav a       { font-size: 13px; color: var(--text-hint); text-decoration: none; }
.history-nav a:hover { color: var(--text-muted); }
.history-nav h1 { font-size: 17px; font-weight: 600; }

.history-empty      { text-align: center; padding: 4rem 1rem; color: var(--text-hint); }
.history-empty .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.history-empty p    { font-size: 13px; }
.history-list       { display: flex; flex-direction: column; gap: 1rem; }

.h-card        { background: #fff; border-radius: 16px; border: 1px solid var(--border); overflow: hidden; }
.h-card-header { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f5f3ef; }
.h-meal-name   { font-size: 13px; font-weight: 500; }
.h-meal-date   { font-size: 11px; color: var(--text-hint); margin-left: 8px; }
.h-badge       { font-size: 11px; background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 20px; font-weight: 500; }

.h-version     { padding: 10px 16px; border-bottom: 1px solid #f5f3ef; }
.h-version:last-child { border-bottom: none; }
.h-version.old { opacity: 0.65; background: #fafaf8; }
.h-version-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.h-version-body { flex: 1; min-width: 0; }
.h-version-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.h-tag-current { font-size: 10px; background: #dcfce7; color: #166534; padding: 1px 6px; border-radius: 4px; font-weight: 500; }
.h-tag-version { font-size: 11px; color: var(--text-hint); }
.h-version-time { font-size: 11px; color: var(--text-hint); }
.h-verdict     { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.h-macros      { font-size: 11px; color: var(--text-hint); margin-top: 2px; }
.h-kcal        { font-size: 15px; font-weight: 600; flex-shrink: 0; text-align: right; }
.h-score       { font-size: 11px; color: var(--text-hint); text-align: right; }
.h-link        { margin-top: 6px; }
.h-link a      { font-size: 12px; color: var(--brown-mid); text-decoration: none; }
.h-link a:hover { color: var(--brown); }

.regen-section { margin-top: 20px; animation: fadeUp .5s .42s ease both; }
.regen-btn     { width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--beige-dark); font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--muted); cursor: pointer; }


/* ══════════════════════════════════════
   WEEKLY REPORT PAGE
══════════════════════════════════════ */
.week-hero     { border-radius: 26px; overflow: hidden; margin-bottom: 14px; animation: fadeUp .5s .15s ease both; }
.wh-top        { background: linear-gradient(135deg, #3A3A4A 0%, #5A4070 100%); padding: 28px 22px 24px; color: #fff; position: relative; }
.wh-top::before { content: '📅'; position: absolute; right: 20px; top: 18px; font-size: 52px; opacity: .15; }
.wh-range      { font-size: 11px; opacity: .6; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.wh-score      { font-family: 'Cormorant Garamond', serif; font-size: 64px; font-weight: 600; line-height: 1; }
.wh-score span { font-size: 22px; opacity: .6; }
.wh-label      { font-size: 11px; opacity: .6; letter-spacing: 1px; text-transform: uppercase; }
.wh-verdict    { font-size: 17px; font-weight: 500; margin-top: 14px; line-height: 1.3; }
.wh-stats      { background: rgba(255,255,255,.08); display: flex; }
.wh-stat       { flex: 1; padding: 14px 16px; text-align: center; color: #fff; }
.wh-stat-val   { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 600; line-height: 1; }
.wh-stat-lbl   { font-size: 10px; opacity: .6; letter-spacing: .5px; text-transform: uppercase; margin-top: 2px; }
.wh-stat-div   { width: 1px; background: rgba(255,255,255,.1); align-self: stretch; margin: 10px 0; }

.cs-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }

.week-activity-card { display: flex; gap: 14px; align-items: flex-start; background: var(--teal-pale); border-radius: 16px; padding: 16px; margin-bottom: 14px; animation: fadeUp .5s .28s ease both; }
.week-activity-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.week-activity-body { flex: 1; }
.week-activity-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--teal); font-weight: 600; margin-bottom: 8px; }
.week-activity-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.week-activity-type  { font-size: 12px; background: rgba(61,107,107,.15); color: var(--teal); border-radius: 20px; padding: 3px 10px; }
.week-activity-text  { font-size: 14px; color: var(--text); line-height: 1.45; }

.week-hydration-card    { background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 14px; animation: fadeUp .5s .29s ease both; }
.week-hydration-title   { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.week-alcohol-badge     { font-size: 11px; background: var(--terra-pale); color: var(--terra); border-radius: 20px; padding: 2px 10px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.week-hydration-stats   { display: flex; gap: 20px; margin-bottom: 10px; }
.week-hyd-val           { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; color: #4A90D9; line-height: 1; }
.week-hyd-lbl           { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.week-hydration-feedback { font-size: 13px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--beige-dark); padding-top: 10px; }

.week-meals-section  { margin-bottom: 14px; animation: fadeUp .5s .31s ease both; }
.week-meals-title    { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px; }
.week-meals-list     { display: flex; flex-direction: column; gap: 8px; }
.week-meal-card      { border-radius: 14px; padding: 14px 16px; }
.week-meal-best      { background: var(--teal-pale); }
.week-meal-worst     { background: var(--terra-pale); }
.week-meal-top       { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.week-meal-meta      { font-size: 11px; color: var(--muted); }
.week-meal-score     { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; }
.week-meal-best .week-meal-score  { color: var(--teal); }
.week-meal-worst .week-meal-score { color: var(--terra); }
.week-meal-name      { font-size: 14px; font-weight: 600; color: var(--text); }
.week-meal-reason    { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }


/* ══════════════════════════════════════
   PROFILE PAGE
══════════════════════════════════════ */
.profile-page { max-width: 480px; margin: 0 auto; }

.profile-success {
    background: var(--green-pale);
    color: var(--green);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    animation: fadeDown .3s ease;
}

.profile-section {
    background: white;
    border-radius: 18px;
    padding: 20px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.profile-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.profile-section-sub {
    font-size: 12px;
    color: var(--text-hint);
    margin-bottom: 16px;
}

.goal-cards { display: flex; flex-direction: column; gap: 10px; }

.goal-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--beige);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    text-align: left;
    transition: border-color .15s, background .15s;
}

.goal-card:hover { border-color: var(--teal); background: var(--teal-pale); }

.goal-card--active {
    border-color: var(--teal);
    background: var(--teal-pale);
}

.goal-card-icon { font-size: 22px; flex-shrink: 0; }

.goal-card-body { flex: 1; }

.goal-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.goal-card-desc {
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 2px;
}

.goal-card-check {
    font-size: 16px;
    font-weight: 700;
    color: var(--teal);
    flex-shrink: 0;
}

/* ── User menu dropdown ── */

.user-menu { position: relative; }

.user-menu-btn {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-family: inherit;
    color: #374151; background: none; border: none; cursor: pointer; padding: 0;
}
.user-menu-btn:hover { color: #111827; }
.user-menu-btn:focus { outline: none; }

.user-menu-arrow {
    width: 16px; height: 16px; color: #9ca3af;
    transition: transform 0.2s; flex-shrink: 0;
}
.user-menu-arrow.open { transform: rotate(180deg); }

.user-menu-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    width: 192px; background: #fff;
    border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
    border: 1px solid #f3f4f6; padding: 4px 0; z-index: 50;
}

.user-menu-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px; font-size: 13px; font-family: inherit;
    color: #374151; text-decoration: none;
    width: 100%; text-align: left; background: none; border: none; cursor: pointer;
}
.user-menu-item:hover { background: #f9fafb; }

.user-menu-divider { border-top: 1px solid #f3f4f6; margin: 4px 0; }
