/* ==================== ROOT ==================== */
:root {
    --bg: linear-gradient(150deg, #1a0f07 0%, #1c1108 30%, #0d0d12 70%, #0a0a10 100%);
    --glass-bg: rgba(255,255,255,0.06);
    --glass-bg-hover: rgba(255,255,255,0.1);
    --glass-border: rgba(255,255,255,0.1);
    --text: #f0ece4;
    --text-sec: rgba(240,236,228,0.6);
    --text-dim: rgba(240,236,228,0.35);
    --input-bg: rgba(0,0,0,0.3);

    --accent: #f97316;
    --accent-dim: rgba(249,115,22,0.15);
    --protein: #4a9eff;
    --protein-dim: rgba(74,158,255,0.12);
    --fat: #e5a638;
    --fat-dim: rgba(229,166,56,0.12);
    --carb: #3ecf8e;
    --carb-dim: rgba(62,207,142,0.12);
    --sugar: #e06caa;
    --sugar-dim: rgba(224,108,170,0.15);
    --water: #5bb8f5;
    --sleep: #a78bfa;
    --danger: #ef4444;
    --success: #22c55e;

    --r: 16px;
    --r-sm: 10px;
    --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --nav-h: 68px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html, body {
    font-family: var(--font);
    background: var(--bg);
    background-attachment: fixed;
    color: var(--text);
    height: 100%; overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ==================== BG ==================== */
.bg-animation { position:fixed; top:0; left:0; right:0; bottom:0; z-index:0; pointer-events:none; overflow:hidden; }
.bg-orb { position:absolute; border-radius:50%; filter:blur(90px); opacity:0.35; animation:orbF 25s ease-in-out infinite; }
.bg-orb-1 { width:340px; height:340px; background:radial-gradient(circle,#f97316,#dc2626); top:-100px; right:-80px; }
.bg-orb-2 { width:280px; height:280px; background:radial-gradient(circle,#d97706,#78350f); bottom:10%; left:-100px; animation-delay:-10s; }
@keyframes orbF { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(30px,-20px) scale(1.05)} }

/* ==================== GLASS ==================== */
.glass { background:var(--glass-bg); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); border:1px solid var(--glass-border); border-radius:var(--r); }

/* ==================== SCREENS ==================== */
.screen { position:fixed; top:0; left:0; right:0; bottom:0; z-index:1; display:none; flex-direction:column; padding-bottom:calc(var(--nav-h) + var(--safe-b)); }
.screen.active { display:flex; }
.screen-scroll { flex:1; overflow-y:auto; overflow-x:hidden; padding:12px 14px 28px; -webkit-overflow-scrolling:touch; }
.screen-scroll::-webkit-scrollbar { display:none; }

.screen-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; padding-top:env(safe-area-inset-top, 6px); }
.screen-title { font-size:26px; font-weight:800; letter-spacing:-0.5px; }
.screen-sub { font-size:12px; color:var(--text-sec); margin-top:2px; }

.icon-btn { width:38px; height:38px; border-radius:var(--r-sm); background:var(--glass-bg); border:1px solid var(--glass-border); color:var(--text-sec); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all .15s; }
.icon-btn:active { transform:scale(.9); background:var(--glass-bg-hover); }
.icon-btn svg { width:18px; height:18px; }
.icon-btn.sm { width:30px; height:30px; font-size:16px; font-weight:600; }

/* ==================== LIQUID CARDS ==================== */
.liquid-card {
    position: relative;
    border-radius: var(--r);
    overflow: hidden;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--glass-border);
}
.liquid-fill {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 0%;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.liquid-content {
    position: relative;
    z-index: 2;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}
.liquid-label {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.liquid-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 6px rgba(0,0,0,0.35);
    line-height: 1.2;
}
.liquid-value.small { font-size: 1.15rem; font-weight: 700; }
.liquid-of { font-weight: 400; opacity: 0.5; font-size: 0.7em; margin: 0 2px; }
.liquid-unit { font-size: 0.6em; font-weight: 500; opacity: 0.6; margin-left: 2px; }
.liquid-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    margin-top: 2px;
}
.liquid-percent {
    position: absolute;
    top: 10px; right: 12px;
    font-size: 11px; font-weight: 700;
    color: rgba(255,255,255,0.55);
    background: rgba(0,0,0,0.25);
    padding: 2px 7px;
    border-radius: 6px;
    z-index: 3;
}
.liquid-badge {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; color: #fff;
    margin-bottom: 6px;
    text-shadow: none;
}
.liquid-badge.protein { background: var(--protein); }
.liquid-badge.fat { background: var(--fat); }
.liquid-badge.carb { background: var(--carb); }
.liquid-label-sm {
    font-size: 10px; color: rgba(255,255,255,0.5);
    text-transform: uppercase; letter-spacing: 0.3px;
    margin-top: 2px;
}

/* HERO CALORIE CARD */
.liquid-card.hero {
    min-height: 130px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, rgba(249,115,22,0.08), rgba(220,38,38,0.05));
    border-color: rgba(249,115,22,0.18);
}
.liquid-card.hero .liquid-fill {
    background: linear-gradient(180deg, rgba(249,115,22,0.4), rgba(234,88,12,0.85));
    box-shadow: 0 0 30px rgba(249,115,22,0.2);
}
.liquid-card.hero .liquid-value { font-size: 2rem; }

/* MACRO LIQUID GRID */
.macro-liquid-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}
.macro-liquid-grid .liquid-card { min-height: 110px; }
.macro-protein { border-color: rgba(74,158,255,0.18); background: linear-gradient(135deg, rgba(74,158,255,0.06), rgba(0,0,0,0.35)); }
.macro-fat { border-color: rgba(229,166,56,0.18); background: linear-gradient(135deg, rgba(229,166,56,0.06), rgba(0,0,0,0.35)); }
.macro-carb { border-color: rgba(62,207,142,0.18); background: linear-gradient(135deg, rgba(62,207,142,0.06), rgba(0,0,0,0.35)); }

.macro-protein .liquid-fill { background: linear-gradient(180deg, rgba(74,158,255,0.35), rgba(37,99,235,0.85)); box-shadow: 0 0 20px rgba(74,158,255,0.15); }
.macro-fat .liquid-fill { background: linear-gradient(180deg, rgba(229,166,56,0.35), rgba(180,120,20,0.85)); box-shadow: 0 0 20px rgba(229,166,56,0.15); }
.macro-carb .liquid-fill { background: linear-gradient(180deg, rgba(62,207,142,0.35), rgba(16,150,90,0.85)); box-shadow: 0 0 20px rgba(62,207,142,0.15); }

/* SUGAR STRIP */
.sugar-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.sugar-label { font-size: 12px; font-weight: 600; color: var(--text-sec); white-space: nowrap; }
.sugar-bar-wrap { flex:1; height:6px; background:rgba(255,255,255,0.06); border-radius:3px; overflow:hidden; }
.sugar-bar { height:100%; width:0%; background: linear-gradient(90deg, var(--sugar), #f472b6); border-radius:3px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.sugar-val { font-size:12px; font-weight:600; color:var(--sugar); white-space:nowrap; font-variant-numeric:tabular-nums; }

/* ==================== QUICK ACTIONS ==================== */
.quick-actions { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-bottom:14px; }
.quick-btn {
    display:flex; flex-direction:column; align-items:center; gap:5px;
    padding:14px 6px; border:1px solid var(--glass-border);
    background:var(--glass-bg); color:var(--text);
    cursor:pointer; font-family:var(--font); font-size:11px; font-weight:500;
    transition:all .15s;
}
.quick-btn:active { transform:scale(.94); background:var(--glass-bg-hover); }
.qa-icon { font-size:22px; }

/* ==================== TRACKER ROW (Water + Sleep) ==================== */
.tracker-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:14px; }
.tracker-water, .tracker-sleep { min-height: 130px; display:flex; flex-direction:column; }
.tracker-water { border-color:rgba(91,184,245,0.18); background:linear-gradient(135deg,rgba(91,184,245,0.06),rgba(0,0,0,0.35)); }
.tracker-sleep { border-color:rgba(167,139,250,0.18); background:linear-gradient(135deg,rgba(167,139,250,0.06),rgba(0,0,0,0.35)); }
.tracker-water .liquid-fill { background:linear-gradient(180deg,rgba(91,184,245,0.35),rgba(37,130,210,0.85)); box-shadow:0 0 20px rgba(91,184,245,0.15); }
.tracker-sleep .liquid-fill { background:linear-gradient(180deg,rgba(167,139,250,0.35),rgba(109,60,230,0.85)); box-shadow:0 0 20px rgba(167,139,250,0.15); }

.water-btns {
    position:relative; z-index:2;
    display:grid; grid-template-columns:repeat(4,1fr); gap:4px;
    padding: 0 10px 10px;
    margin-top:auto;
}
.water-btns button {
    padding:5px 2px; border:1px solid rgba(255,255,255,0.12);
    background:rgba(0,0,0,0.25); color:rgba(255,255,255,0.75);
    border-radius:6px; font-size:10px; font-weight:600;
    cursor:pointer; font-family:var(--font); transition:all .12s;
}
.water-btns button:active { transform:scale(.9); background:rgba(91,184,245,0.3); }

.sleep-log-btn {
    position:relative; z-index:2;
    margin:auto 10px 10px;
    padding:7px;
    border:1px solid rgba(255,255,255,0.12);
    background:rgba(0,0,0,0.25);
    color:rgba(255,255,255,0.75);
    border-radius:6px; font-size:11px; font-weight:500;
    cursor:pointer; font-family:var(--font);
    text-align:center; transition:all .12s;
}
.sleep-log-btn:active { transform:scale(.95); background:rgba(167,139,250,0.3); }

/* ==================== SECTIONS ==================== */
.section-title-row { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.section-label { font-size:15px; font-weight:700; }

/* CARD */
.card { padding:16px; margin-bottom:12px; }
.card-title { font-size:14px; font-weight:700; margin-bottom:12px; display:flex; align-items:center; gap:6px; }
.card-icon { font-size:16px; }
.settings-note { font-size:11px; color:var(--text-dim); margin:-4px 0 12px; }

/* ==================== EMPTY STATE ==================== */
.empty-state { display:flex; flex-direction:column; align-items:center; padding:36px 16px; gap:8px; }
.empty-icon { font-size:36px; opacity:.45; }
.empty-text { font-size:13px; color:var(--text-sec); }

/* ==================== MEAL CARDS ==================== */
.meal-card { background:var(--glass-bg); border:1px solid var(--glass-border); border-radius:var(--r); padding:12px 14px; margin-bottom:8px; }
.meal-card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.meal-card-type { font-size:13px; font-weight:600; }
.meal-card-cal { font-size:12px; font-weight:700; color:var(--accent); }
.meal-card-items { display:flex; flex-direction:column; gap:3px; }
.meal-card-item { display:flex; justify-content:space-between; align-items:center; font-size:12px; padding:3px 0; }
.meal-card-item-name { flex:1; color:var(--text); }
.meal-card-item-macros { font-size:10px; color:var(--text-sec); display:flex; gap:4px; flex-shrink:0; margin-left:8px; }
.macro-pill { display:inline-flex; align-items:center; padding:2px 6px; border-radius:4px; font-size:10px; font-weight:700; letter-spacing:0.2px; }
.macro-pill.mp { background:var(--protein-dim); color:var(--protein); }
.macro-pill.mf { background:var(--fat-dim); color:var(--fat); }
.macro-pill.mc { background:var(--carb-dim); color:var(--carb); }
.macro-pill.ms { background:var(--sugar-dim); color:var(--sugar); }
.m-p { color:var(--protein); } .m-f { color:var(--fat); } .m-c { color:var(--carb); } .m-s { color:var(--sugar); }
.meal-card-actions { display:flex; gap:6px; margin-top:6px; padding-top:6px; border-top:1px solid var(--glass-border); }
.meal-action-btn { background:none; border:none; color:var(--text-dim); font-size:11px; font-family:var(--font); cursor:pointer; padding:3px 6px; border-radius:4px; }
.meal-action-btn.delete:active { color:var(--danger); }
.coach-comment-btn { color:var(--accent)!important; font-weight:600!important; width:100%; text-align:center; padding:6px!important; margin-bottom:4px; background:rgba(249,115,22,0.08)!important; border-radius:var(--r-sm)!important; }

/* HEADER ACTIONS */
.header-actions { display:flex; gap:8px; align-items:center; }

/* MESSAGE BELL */
.msg-bell-btn { position:relative; }
.msg-badge { position:absolute; top:-4px; right:-4px; min-width:18px; height:18px; border-radius:9px; background:var(--accent); color:#fff; font-size:10px; font-weight:800; display:flex; align-items:center; justify-content:center; padding:0 4px; border:2px solid rgba(26,15,7,0.95); line-height:1; font-family:var(--font); }

/* MESSAGES MODAL */
.messages-list { overflow-y:auto; max-height:calc(65vh - 80px); padding:4px 0 8px; -webkit-overflow-scrolling:touch; }
.messages-list::-webkit-scrollbar { display:none; }
.msg-item { padding:10px 12px; margin-bottom:6px; border-radius:var(--r-sm); background:var(--accent-dim); border:1px solid rgba(249,115,22,0.15); }
.msg-item.unread { border-color:rgba(249,115,22,0.35); background:rgba(249,115,22,0.12); }
.msg-item-row { display:flex; }
.msg-unread-dot { width:6px; height:6px; border-radius:50%; background:var(--accent); flex-shrink:0; margin-top:6px; margin-right:8px; }
.msg-item-content { flex:1; min-width:0; }
.msg-item-text { font-size:13px; line-height:1.5; color:var(--text); word-wrap:break-word; }
.msg-item-meta { font-size:10px; color:var(--text-dim); margin-top:4px; }
.messages-date-sep { text-align:center; font-size:11px; color:var(--text-dim); padding:8px 0 4px; font-weight:600; }
.messages-empty { text-align:center; padding:32px 16px; color:var(--text-dim); font-size:13px; }

/* ==================== BOTTOM NAV ==================== */
.bottom-nav {
    position:fixed; bottom:0; left:0; right:0; z-index:100;
    display:flex;
    height:calc(var(--nav-h) + var(--safe-b));
    padding-bottom:var(--safe-b);
    background:rgba(10,10,14,0.88);
    backdrop-filter:blur(30px); -webkit-backdrop-filter:blur(30px);
    border-top:1px solid var(--glass-border);
}
.nav-item {
    flex:1; display:flex; flex-direction:column;
    align-items:center; justify-content:center; gap:2px;
    background:none; border:none; color:var(--text-dim);
    font-family:var(--font); font-size:10px; font-weight:500;
    cursor:pointer; transition:color .2s; padding:6px 0;
}
.nav-item svg { width:22px; height:22px; }
.nav-item.active { color:var(--accent); }
.nav-item:active { transform:scale(.88); }

/* ==================== MODALS ==================== */
.modal-overlay {
    position:fixed; top:0; left:0; right:0; bottom:0; z-index:200;
    background:rgba(0,0,0,0.65);
    backdrop-filter:blur(4px);
    display:none; align-items:flex-end; justify-content:center;
}
.modal-overlay.active { display:flex; }

.modal-sheet {
    width:100%; max-width:500px; max-height:92vh;
    border-radius:var(--r) var(--r) 0 0;
    padding:0 16px 24px;
    display:flex; flex-direction:column;
    overflow:hidden;
    animation:sheetUp .3s cubic-bezier(.32,.72,0,1);
    background:rgba(16,16,20,0.97);
    backdrop-filter:blur(30px);
    border:1px solid var(--glass-border);
    border-bottom:none;
}
.modal-sheet.compact { max-height:65vh; }
@keyframes sheetUp { from{transform:translateY(100%)} to{transform:translateY(0)} }

.sheet-handle { width:36px; height:4px; background:rgba(255,255,255,0.18); border-radius:2px; margin:10px auto 4px; flex-shrink:0; }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:10px 0; flex-shrink:0; }
.modal-title { font-size:15px; font-weight:700; text-align:center; }
.btn-text { background:none; border:none; color:var(--text-sec); font-family:var(--font); font-size:13px; font-weight:500; cursor:pointer; padding:4px 6px; }
.btn-text.accent { color:var(--accent); font-weight:700; }
.btn-text:active { opacity:.5; }

.modal-tab-content { flex:1; overflow-y:auto; min-height:0; }
.modal-tab-content::-webkit-scrollbar { display:none; }

/* CONFIRM */
.confirm-box { width:calc(100% - 48px); max-width:340px; padding:24px; text-align:center; margin:auto; }
.confirm-text { font-size:14px; margin-bottom:18px; line-height:1.5; color:var(--text-sec); }
.confirm-btns { display:flex; gap:8px; }

/* ==================== MEAL CATEGORY TOGGLE ==================== */
.meal-cat-sel { display:flex; gap:4px; padding:4px; background:rgba(255,255,255,0.04); border-radius:var(--r-sm); margin-bottom:8px; flex-shrink:0; }
.mc-btn { flex:1; padding:8px; border:none; border-radius:6px; background:none; color:var(--text-sec); font-family:var(--font); font-size:13px; font-weight:600; cursor:pointer; transition:all .2s; display:flex; align-items:center; justify-content:center; gap:4px; }
.mc-btn.active { background:var(--accent); color:#fff; }

/* ==================== MEAL TYPE SELECTOR ==================== */
.meal-type-sel { display:flex; gap:6px; padding:2px 0 10px; overflow-x:auto; flex-shrink:0; }
.meal-type-sel::-webkit-scrollbar { display:none; }
.mt-btn {
    padding:7px 12px; border-radius:20px;
    border:1px solid var(--glass-border); background:var(--glass-bg);
    color:var(--text-sec); font-family:var(--font); font-size:12px; font-weight:500;
    cursor:pointer; white-space:nowrap; transition:all .2s;
}
.mt-btn.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.mt-btn:active { transform:scale(.94); }

/* TABS */
.modal-tabs { display:flex; gap:4px; padding:4px; background:rgba(255,255,255,0.04); border-radius:var(--r-sm); margin-bottom:10px; flex-shrink:0; }
.tab-btn { flex:1; padding:7px; border:none; border-radius:6px; background:none; color:var(--text-sec); font-family:var(--font); font-size:12px; font-weight:500; cursor:pointer; transition:all .2s; }
.tab-btn.active { background:rgba(255,255,255,0.1); color:var(--text); }

/* SEARCH */
.search-wrap { position:relative; margin-bottom:10px; flex-shrink:0; }
.search-icon { position:absolute; left:10px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--text-dim); pointer-events:none; }
.search-input { width:100%; padding:9px 10px 9px 34px; background:var(--input-bg); border:1px solid var(--glass-border); border-radius:var(--r-sm); color:var(--text); font-family:var(--font); font-size:13px; outline:none; transition:border-color .2s; }
.search-input:focus { border-color:var(--accent); }
.search-input::placeholder { color:var(--text-dim); }

/* FOODS LIST */
.foods-list { display:flex; flex-direction:column; gap:1px; }
.food-item { display:flex; align-items:center; padding:10px 8px; border-radius:var(--r-sm); cursor:pointer; transition:background .12s; }
.food-item:active { background:var(--glass-bg-hover); }
.food-item-info { flex:1; min-width:0; }
.food-item-name { font-size:13px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.food-item-macros { font-size:10px; color:var(--text-sec); margin-top:2px; display:flex; gap:6px; flex-wrap:wrap; }
.food-item-add {
    width:30px; height:30px; border-radius:50%;
    border:1px solid var(--glass-border); background:var(--glass-bg);
    color:var(--text-sec); display:flex; align-items:center; justify-content:center;
    font-size:18px; cursor:pointer; flex-shrink:0; margin-left:6px;
    transition:all .12s;
}
.food-item-add:active { transform:scale(.85); background:var(--accent); color:#fff; border-color:var(--accent); }
.food-item-actions { display:flex; gap:4px; flex-shrink:0; margin-left:6px; }
.food-mini-btn { width:26px; height:26px; border-radius:50%; border:none; background:var(--glass-bg); color:var(--text-dim); display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:13px; transition:all .12s; }
.food-mini-btn:active { background:var(--glass-bg-hover); color:var(--text); }
.food-mini-btn.delete:active { color:var(--danger); }

/* MEAL ITEMS (in modal) */
.meal-items-wrap { border-top:1px solid var(--glass-border); padding-top:10px; margin-top:10px; flex-shrink:0; }
.meal-items-title { font-size:12px; font-weight:600; color:var(--text-sec); margin-bottom:6px; }
.meal-items-total { display:flex; justify-content:space-between; padding:8px 0; margin-top:6px; border-top:1px solid var(--glass-border); font-size:12px; font-weight:600; }
.mi-row { display:flex; align-items:center; padding:5px 0; font-size:12px; }
.mi-row-name { flex:1; }
.mi-row-cal { color:var(--text-sec); margin:0 6px; font-size:11px; }
.mi-row-rm { background:none; border:none; color:var(--text-dim); font-size:15px; cursor:pointer; padding:2px 5px; border-radius:4px; }
.mi-row-rm:active { color:var(--danger); }

/* QUALITY */
.quality-row { display:flex; gap:8px; justify-content:center; padding:6px 0; }
.q-btn { width:42px; height:42px; border-radius:50%; border:2px solid var(--glass-border); background:var(--glass-bg); font-size:20px; cursor:pointer; transition:all .2s; }
.q-btn.active { border-color:var(--sleep); background:rgba(167,139,250,0.15); transform:scale(1.15); }
.q-btn:active { transform:scale(.88); }

/* SLEEP TIME INPUTS */
.sleep-time-input { font-size:18px; font-weight:700; text-align:center; padding:12px; }
.sleep-duration-hint { text-align:center; font-size:20px; font-weight:800; color:var(--sleep); padding:4px 0 12px; }

/* WATER TAP HINT */
.water-tap-hint { position:relative; z-index:2; text-align:center; font-size:11px; color:rgba(255,255,255,0.45); padding:0 10px 10px; margin-top:auto; font-weight:500; }

/* CALENDAR */
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; padding:6px 0; }
.cal-hdr { font-size:10px; font-weight:600; color:var(--text-dim); text-align:center; padding:3px 0 6px; text-transform:uppercase; }
.cal-day { aspect-ratio:1; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:500; border-radius:50%; cursor:pointer; transition:all .12s; color:var(--text); }
.cal-day:active { background:var(--glass-bg-hover); }
.cal-day.today { background:var(--accent); color:#fff; font-weight:700; }
.cal-day.selected { background:var(--accent); color:#fff; }
.cal-day.other { color:var(--text-dim); }
.date-nav { display:flex; gap:4px; }

/* DIARY */
.diary-day { margin-bottom:18px; }
.diary-day-hdr { font-size:14px; font-weight:700; padding:6px 0; display:flex; align-items:center; gap:8px; }
.diary-day-sum { font-size:11px; color:var(--text-sec); font-weight:400; }

/* ==================== FORMS ==================== */
.form-group { margin-bottom:10px; }
.form-label { display:block; font-size:11px; font-weight:600; color:var(--text-sec); margin-bottom:5px; }
.form-input { width:100%; padding:10px 12px; background:var(--input-bg); border:1px solid transparent; border-radius:var(--r-sm); color:var(--text); font-family:var(--font); font-size:14px; outline:none; transition:border-color .15s; -webkit-appearance:none; }
.form-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-dim); }
.form-input::placeholder { color:var(--text-dim); }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.lg-input { font-size:28px; font-weight:800; text-align:center; padding:16px; }
.form-check { display:flex; align-items:center; gap:8px; margin-bottom:10px; font-size:12px; color:var(--text-sec); cursor:pointer; }
.form-check input[type="checkbox"] { width:18px; height:18px; accent-color:var(--accent); cursor:pointer; }

/* ==================== BUTTONS ==================== */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:10px 16px; border-radius:var(--r-sm); font-family:var(--font); font-size:13px; font-weight:600; border:none; cursor:pointer; transition:all .15s; min-height:42px; }
.btn:active { transform:scale(.95); }
.btn-primary { background:var(--accent); color:#fff; }
.btn-secondary { background:var(--glass-bg-hover); color:var(--text); border:1px solid var(--glass-border); }
.btn-ghost { background:none; color:var(--text-sec); }
.btn-danger { background:var(--danger); color:#fff; }
.btn-block { width:100%; }

/* ==================== TOASTS ==================== */
.toast-container { position:fixed; top:env(safe-area-inset-top,10px); left:14px; right:14px; z-index:999; display:flex; flex-direction:column; gap:6px; pointer-events:none; }
.toast { padding:10px 14px; border-radius:var(--r-sm); font-size:12px; font-weight:500; pointer-events:auto; animation:toastIn .3s ease; transition:opacity .2s; backdrop-filter:blur(20px); }
.toast.success { background:rgba(34,197,94,0.15); border:1px solid rgba(34,197,94,0.3); color:var(--success); }
.toast.error { background:rgba(239,68,68,0.15); border:1px solid rgba(239,68,68,0.3); color:var(--danger); }
.toast.info { background:rgba(249,115,22,0.15); border:1px solid rgba(249,115,22,0.3); color:var(--accent); }
@keyframes toastIn { from{transform:translateY(-16px);opacity:0} to{transform:translateY(0);opacity:1} }

/* ==================== PHOTO UPLOAD ==================== */
.photo-upload-area { margin-bottom: 10px; flex-shrink: 0; }
.meal-photo-preview { width: 100%; max-height: 160px; object-fit: cover; border-radius: var(--r-sm); }
.photo-remove-btn { position:absolute; top:6px; right:6px; width:26px; height:26px; border-radius:50%; background:rgba(0,0,0,0.6); border:none; color:#fff; font-size:14px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.meal-card-photo { width: 100%; max-height: 140px; object-fit: cover; border-radius: var(--r-sm); margin: 6px 0; }

/* ==================== CONNECT SCREEN ==================== */
.connect-wrap{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100%;padding:24px 16px}
.connect-logo{font-size:48px;margin-bottom:8px}
.connect-title{font-size:28px;font-weight:800;letter-spacing:-.5px}
.connect-sub{font-size:13px;color:var(--text-sec);margin-bottom:24px;text-align:center;max-width:260px}

/* ==================== READ-ONLY GOALS ==================== */
.goals-note{font-size:11px;color:var(--accent);margin:-4px 0 12px;font-weight:500}
.goals-readonly{display:flex;flex-direction:column;gap:0}
.goal-row{display:flex;justify-content:space-between;align-items:center;padding:9px 0;border-bottom:1px solid var(--glass-border)}
.goal-row:last-child{border-bottom:none}
.goal-label{font-size:13px;color:var(--text-sec);font-weight:500}
.goal-val{font-size:14px;font-weight:700;font-variant-numeric:tabular-nums}

/* ==================== COACH INFO ==================== */
.coach-info-row{display:flex;justify-content:space-between;align-items:center;padding:8px 0}
.coach-info-label{font-size:12px;color:var(--text-sec)}
.coach-info-val{font-size:13px;font-weight:600}
.coach-info-val.mono{font-family:monospace;letter-spacing:2px;color:var(--accent)}

/* ==================== DIARY MEAL CARDS ==================== */
.diary-day-meals { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.diary-meal-card { background:var(--glass-bg); border:1px solid var(--glass-border); border-radius:var(--r); padding:10px 12px; }
.diary-meal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:4px; }
.diary-meal-type { font-size:12px; font-weight:600; }
.diary-meal-cal { font-size:11px; font-weight:700; color:var(--accent); }
.diary-meal-items { display:flex; flex-direction:column; gap:2px; }
.diary-meal-item { display:flex; justify-content:space-between; align-items:center; font-size:11px; padding:2px 0; }
.diary-meal-item-name { flex:1; color:var(--text-sec); }
.diary-meal-item-macros { display:flex; gap:3px; flex-shrink:0; margin-left:6px; }
.diary-meal-actions { display:flex; gap:6px; margin-top:6px; padding-top:6px; border-top:1px solid var(--glass-border); }
.diary-meal-action { background:none; border:none; color:var(--text-dim); font-size:11px; font-family:var(--font); cursor:pointer; padding:3px 6px; border-radius:4px; }
.diary-meal-action:active { color:var(--text); }
.diary-meal-action.delete:active { color:var(--danger); }

/* ==================== EDIT MEAL MODAL ==================== */
.edit-meal-items { display:flex; flex-direction:column; gap:8px; max-height:50vh; overflow-y:auto; }
.edit-meal-items::-webkit-scrollbar { display:none; }
.edit-meal-item { background:rgba(0,0,0,0.15); border-radius:var(--r-sm); padding:10px; }
.edit-meal-item-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.edit-meal-item-name { font-size:13px; font-weight:600; }
.edit-meal-item-remove { background:none; border:none; color:var(--text-dim); font-size:14px; cursor:pointer; padding:2px 6px; }
.edit-meal-item-remove:active { color:var(--danger); }
.edit-meal-fields { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.edit-meal-field label { display:block; font-size:9px; color:var(--text-dim); margin-bottom:2px; font-weight:600; }
.edit-meal-field input { width:100%; padding:6px 8px; background:var(--input-bg); border:1px solid transparent; border-radius:6px; color:var(--text); font-family:var(--font); font-size:12px; outline:none; }
.edit-meal-field input:focus { border-color:var(--accent); }
