
/* ════════════════════════════════════════════════════════════════════════════
   FOOD NUTRITION TRACKER (FNT)
   ════════════════════════════════════════════════════════════════════════════ */

.fnt-goal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(251,191,36,0.08);
    border: 1px solid rgba(251,191,36,0.22);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
}
.fnt-goal-badge { font-size: 0.9rem; font-weight: 700; color: #fbbf24; }
.fnt-goal-meta { font-size: 0.75rem; color: rgba(255,255,255,0.55); text-align: right; }

/* ── Flat tab bar ── */
.fnt-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1.5px solid rgba(255,255,255,0.1);
    margin-bottom: 14px;
    align-items: flex-end;
}
.fnt-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 10px 4px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1.5px;
    letter-spacing: 0.2px;
    font-family: inherit;
    text-align: center;
}
.fnt-tab.fnt-tab-active {
    color: #fff;
    border-bottom-color: #fbbf24;
}
.fnt-tab:hover {
    color: rgba(255,255,255,0.8);
}
/* First tab: coach dropdown wrapper */
.fnt-ctx-tab {
    position: relative;
    padding: 0;
}
.fnt-tab-label {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 10px 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    box-sizing: border-box;
    color: inherit;
    text-align: center;
    margin-bottom: -1.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Settings gear — no flex:1, sits at end */
.fnt-tab-settings {
    flex: 0 0 auto;
    padding: 10px 12px;
    font-size: 15px;
    margin-bottom: -1.5px;
}
#coachSwitcherLabelFood {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.fnt-ctx-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    z-index: 9200;
    background: #1e2040;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.10);
    padding: 6px;
}

/* Add to Library button in food section */
.fnt-add-lib-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: 1.5px dashed rgba(255,255,255,0.15);
    border-radius: 10px;
    color: rgba(255,255,255,0.4);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 8px;
    cursor: pointer;
    margin-bottom: 10px;
    font-family: inherit;
    transition: border-color .15s, color .15s;
}
.fnt-add-lib-btn:hover { border-color: rgba(255,255,255,0.28); color: rgba(255,255,255,0.65); }

.fnt-date-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fnt-date-arrow {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: rgba(255,255,255,0.65);
    width: 30px; height: 30px;
    font-size: 1.15rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .14s;
}
.fnt-date-arrow:hover { background: rgba(255,255,255,0.12); }
.fnt-date-label { font-size: 0.88rem; font-weight: 700; color: #f1f5f9; flex: 1; }
.fnt-back-today {
    background: rgba(74,222,128,0.12);
    border: 1px solid rgba(74,222,128,0.28);
    border-radius: 20px;
    color: #4ade80;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.fnt-cal-summary {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.fnt-cal-big-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.fnt-cal-big { font-size: 2.2rem; font-weight: 800; color: #f1f5f9; letter-spacing: -0.5px; }
.fnt-cal-logged-label { font-size: 0.8rem; color: rgba(255,255,255,0.45); }
.fnt-macro-bars { display: flex; flex-direction: column; gap: 7px; }
.fnt-macro-row-item { display: flex; align-items: center; gap: 8px; }
.fnt-macro-lbl { font-size: 0.74rem; color: rgba(255,255,255,0.5); width: 46px; flex-shrink: 0; }
.fnt-macro-bar-track { flex: 1; height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.fnt-macro-bar { height: 100%; border-radius: 3px; width: 0%; transition: width .4s ease; }
.fnt-bar-p { background: #4ade80; }
.fnt-bar-c { background: #60a5fa; }
.fnt-bar-f { background: #fb923c; }
.fnt-macro-val { font-size: 0.78rem; font-weight: 700; color: #f1f5f9; width: 34px; text-align: right; flex-shrink: 0; }

.fnt-meal-section-hdr {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.fnt-meal-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.fnt-food-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.fnt-food-item:last-child { border-bottom: none; }
.fnt-food-thumb {
    width: 46px; height: 46px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
}
.fnt-food-no-thumb { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: rgba(255,255,255,0.05); }
.fnt-food-info { flex: 1; min-width: 0; }
.fnt-food-name { font-size: 0.88rem; font-weight: 600; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fnt-food-meta { font-size: 0.72rem; color: rgba(255,255,255,0.4); margin-top: 2px; }
.fnt-food-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.fnt-food-cals { font-size: 0.95rem; font-weight: 700; color: #f1f5f9; }
.fnt-food-cals .fnt-cal-unit { font-size: 0.65rem; font-weight: 400; color: rgba(255,255,255,0.4); }
.fnt-food-del { background: none; border: none; color: rgba(255,255,255,0.28); font-size: 0.75rem; cursor: pointer; padding: 4px; transition: color .14s; }
.fnt-food-del:hover { color: #f87171; }
.fnt-loading, .fnt-empty { text-align: center; color: rgba(255,255,255,0.35); font-size: 0.85rem; padding: 24px 0; line-height: 1.6; }

.fnt-scan-fab {
    width: 100%;
    background: rgba(251,191,36,0.08);
    border: 1px dashed rgba(251,191,36,0.3);
    border-radius: 12px;
    color: rgba(251,191,36,0.8);
    font-size: 0.85rem; font-weight: 600;
    padding: 12px;
    cursor: pointer; font-family: inherit;
    transition: background .15s, border-color .15s;
    margin-top: 4px;
}
.fnt-scan-fab:hover { background: rgba(251,191,36,0.13); border-color: rgba(251,191,36,0.5); }

.fnt-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fnt-cal-nav-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; color: rgba(255,255,255,0.7);
    width: 32px; height: 32px; font-size: 1.2rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .14s;
}
.fnt-cal-nav-btn:hover { background: rgba(255,255,255,0.12); }
.fnt-cal-month-label { font-size: 1rem; font-weight: 700; color: #fbbf24; }
.fnt-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 10px; }
.fnt-cal-day-hdr { text-align: center; font-size: 0.65rem; font-weight: 700; color: rgba(255,255,255,0.35); padding: 4px 0; letter-spacing: 0.04em; }
.fnt-cal-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; transition: background .14s; position: relative; overflow: hidden;
}
.fnt-cal-empty-cell { background: transparent; cursor: default; }
.fnt-cal-cell:not(.fnt-cal-empty-cell):hover { background: rgba(255,255,255,0.09); }
.fnt-cal-today { box-shadow: 0 0 0 2px #4ade80; }
.fnt-cal-day-num { font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.7); line-height: 1; }
.fnt-cal-cal-count { font-size: 0.58rem; font-weight: 600; color: rgba(255,255,255,0.5); margin-top: 2px; line-height: 1; }
.fnt-cal-c-vlow  { background: rgba(100,116,139,0.25); }
.fnt-cal-c-low   { background: rgba(74,222,128,0.18); }
.fnt-cal-c-low .fnt-cal-day-num, .fnt-cal-c-low .fnt-cal-cal-count { color: #86efac; }
.fnt-cal-c-on    { background: rgba(74,222,128,0.40); }
.fnt-cal-c-on .fnt-cal-day-num { color: #fff; }
.fnt-cal-c-on .fnt-cal-cal-count { color: rgba(255,255,255,0.8); }
.fnt-cal-c-over  { background: rgba(251,191,36,0.32); }
.fnt-cal-c-over .fnt-cal-day-num { color: #fef08a; }
.fnt-cal-c-over .fnt-cal-cal-count { color: rgba(254,240,138,0.75); }
.fnt-cal-legend { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }
.fnt-cl-item { font-size: 0.68rem; font-weight: 600; color: rgba(255,255,255,0.4); display: flex; align-items: center; gap: 5px; }
.fnt-cl-item::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.fnt-cl-vlow::before { background: rgba(100,116,139,0.5); }
.fnt-cl-low::before  { background: rgba(74,222,128,0.35); }
.fnt-cl-on::before   { background: rgba(74,222,128,0.75); }
.fnt-cl-over::before { background: rgba(251,191,36,0.6); }

.fnt-period-pills { display: flex; gap: 6px; margin-bottom: 12px; }
.fnt-period-pill {
    padding: 7px 18px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: all .15s;
}
.fnt-period-pill.fnt-period-active { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.22); color: #f1f5f9; }
.fnt-ai-btn {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #4ade80, #22d3ee);
    color: #0a0a0f;
    font-size: 0.9rem; font-weight: 700;
    cursor: pointer; font-family: inherit;
    margin-bottom: 14px;
    transition: opacity .15s;
}
.fnt-ai-btn:hover { opacity: 0.88; }
.fnt-ai-btn:disabled { opacity: 0.5; cursor: default; }
.fnt-stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.fnt-stat-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px; padding: 14px;
}
.fnt-sc-label { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; color: rgba(255,255,255,0.35); text-transform: uppercase; margin-bottom: 6px; }
.fnt-sc-val { font-size: 1.9rem; font-weight: 800; color: #f1f5f9; line-height: 1; margin-bottom: 4px; }
.fnt-sc-sub { font-size: 0.72rem; color: rgba(255,255,255,0.4); }

.fnt-daily-avgs { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.fnt-da-section-label { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; color: rgba(255,255,255,0.35); text-transform: uppercase; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.fnt-da-row { display: flex; gap: 12px; }
.fnt-da-item { flex: 1; }
.fnt-da-val { font-size: 1.3rem; font-weight: 800; color: #f1f5f9; line-height: 1; margin-bottom: 3px; }
.fnt-da-name { font-size: 0.7rem; color: rgba(255,255,255,0.4); margin-bottom: 6px; }
.fnt-da-bar-track { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.fnt-da-bar { height: 100%; border-radius: 2px; width: 0%; transition: width .5s ease; }
.fnt-da-bar-p { background: #4ade80; }
.fnt-da-bar-c { background: #60a5fa; }
.fnt-da-bar-f { background: #fb923c; }

.fnt-chart-section { margin-bottom: 10px; }
.fnt-chart-section-label { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; color: rgba(255,255,255,0.35); text-transform: uppercase; margin-bottom: 10px; }
.fnt-bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-bottom: 24px; position: relative; }
.fnt-chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.fnt-chart-bar-val { font-size: 0.58rem; color: rgba(255,255,255,0.5); margin-bottom: 3px; text-align: center; line-height: 1.1; white-space: nowrap; }
.fnt-chart-bar { width: 100%; border-radius: 5px 5px 0 0; min-height: 4px; transition: height .4s ease; }
.fnt-chart-bar-lbl { position: absolute; bottom: 0; font-size: 0.62rem; color: rgba(255,255,255,0.38); text-align: center; }
.fnt-chart-goal-label { font-size: 0.72rem; color: rgba(255,255,255,0.35); text-align: center; margin-top: 4px; padding-top: 6px; border-top: 1px dashed rgba(255,255,255,0.1); }
.fnt-chart-empty { color: rgba(255,255,255,0.3); font-size: 0.82rem; text-align: center; padding: 20px 0; }

.fnt-ai-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.72); z-index: 9995; display: flex; align-items: flex-end; justify-content: center; }
.fnt-ai-sheet { background: #111114; border-radius: 20px 20px 0 0; width: 100%; max-width: 520px; max-height: 82vh; overflow-y: auto; padding: 20px 18px calc(max(env(safe-area-inset-bottom,0px),8px) + 24px); }
.fnt-ai-sheet::-webkit-scrollbar { display: none; }
.fnt-ai-modal-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 1rem; font-weight: 700; color: #f1f5f9; }
.fnt-ai-close { background: rgba(255,255,255,0.08); border: none; border-radius: 50%; color: rgba(255,255,255,0.6); width: 28px; height: 28px; cursor: pointer; font-size: 0.8rem; }
.fnt-ai-content { display: flex; flex-direction: column; gap: 12px; }
.fnt-ai-loading, .fnt-ai-error { text-align: center; color: rgba(255,255,255,0.4); font-size: 0.88rem; padding: 24px 0; }
.fnt-ai-error { color: #f87171; }
.fnt-ai-summary { font-size: 0.85rem; color: rgba(255,255,255,0.6); font-style: italic; text-align: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.07); margin-bottom: 4px; }
.fnt-ai-rec { display: flex; gap: 12px; background: rgba(255,255,255,0.04); border-radius: 12px; padding: 12px; }
.fnt-ai-rec-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.fnt-ai-rec-title { font-size: 0.88rem; font-weight: 700; color: #f1f5f9; margin-bottom: 4px; }
.fnt-ai-rec-text { font-size: 0.8rem; color: rgba(255,255,255,0.55); line-height: 1.5; }

/* ════════════════════════════════════════════════════════════════════════════
   FOOD NUTRITION PROFILE MODAL (FNP)
   ════════════════════════════════════════════════════════════════════════════ */

.fnp-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 10100; display: flex; align-items: flex-end; justify-content: center; }
.fnp-sheet { background: #111114; border-radius: 20px 20px 0 0; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; padding: 20px 18px 32px; }
.fnp-sheet::-webkit-scrollbar { display: none; }
.fnp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.fnp-title { font-size: 1.15rem; font-weight: 800; color: #f1f5f9; }
.fnp-close { background: rgba(255,255,255,0.08); border: none; border-radius: 50%; color: rgba(255,255,255,0.6); width: 30px; height: 30px; cursor: pointer; font-size: 0.85rem; }
.fnp-desc { font-size: 0.8rem; color: rgba(255,255,255,0.45); margin-bottom: 18px; }
.fnp-field-row { display: flex; gap: 10px; margin-bottom: 12px; }
.fnp-field { flex: 1; }
.fnp-field-full { margin-bottom: 12px; }
.fnp-lbl { display: block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; color: rgba(255,255,255,0.38); text-transform: uppercase; margin-bottom: 6px; }
.fnp-input { width: 100%; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; color: #f1f5f9; font-size: 0.95rem; font-weight: 600; padding: 11px 12px; font-family: inherit; box-sizing: border-box; transition: border-color .14s; }
.fnp-input:focus { outline: none; border-color: rgba(74,222,128,0.45); }
.fnp-select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.fnp-goal-section-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; color: rgba(255,255,255,0.38); text-transform: uppercase; margin-bottom: 10px; }
.fnp-goals { display: flex; gap: 8px; margin-bottom: 18px; }
.fnp-goal-btn { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; color: rgba(255,255,255,0.5); font-size: 0.72rem; font-weight: 700; padding: 12px 6px; cursor: pointer; font-family: inherit; text-align: center; line-height: 1.5; transition: all .15s; }
.fnp-goal-btn.fnp-goal-active { background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.45); color: #4ade80; }
.fnp-results { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.fnp-result-row { display: flex; justify-content: space-between; font-size: 0.82rem; color: rgba(255,255,255,0.55); padding: 4px 0; }
.fnp-result-daily { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.9rem; font-weight: 700; color: #f1f5f9; }
.fnp-target-val { font-size: 1.15rem; font-weight: 800; color: #4ade80; }
.fnp-result-macros { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-top: 6px; text-align: right; }
.fnp-save-btn { width: 100%; padding: 14px; border-radius: 12px; border: none; background: linear-gradient(135deg, #4ade80, #22d3ee); color: #0a0a0f; font-size: 0.95rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: opacity .15s; }
.fnp-save-btn:hover { opacity: 0.88; }
.fnp-save-btn:disabled { opacity: 0.5; cursor: default; }
.fnt-profile-open-btn { font-size: 1rem; }
