/* ============================================================
   FORCEINDEX — Design System
   Mobile-first PWA
   ============================================================ */

:root {
  --bg:          #0E1117;
  --surface:     #1C2128;
  --surface-2:   #252B35;
  --accent:      #CCFF00;
  --accent-dim:  #3D5C2E;
  --accent-btn:  #4A6B35;
  --text:        #FFFFFF;
  --muted:       #8892A4;
  --dim:         #4A5568;
  --danger:      #D94F4F;
  --r:           16px;
  --r-lg:        20px;
  --r-xl:        26px;
  --r-pill:      999px;
  --nav-h:       72px;
  --safe-b:      env(safe-area-inset-bottom, 0px);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font-family: inherit; cursor: pointer; }
input  { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ---- App shell ---- */
#app {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  overflow: hidden;
}

/* ---- Screen base ---- */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  animation: fadeIn 0.18s ease;
}

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

/* ============================================================
   AUTH / LANDING SCREENS
   ============================================================ */
.bg-img {
  position: absolute;
  inset: 0;
  background: url('/static/media/gym-bg.png') center top / cover no-repeat;
  z-index: 0;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(14,17,23,0.25) 0%,
    rgba(14,17,23,0.55) 40%,
    rgba(14,17,23,0.92) 65%,
    rgba(14,17,23,1.00) 100%
  );
}

.auth-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100dvh;
  padding: 40px 28px calc(48px + var(--safe-b));
}

/* Landing */
.landing-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 10px;
}
.landing-title .lime { color: var(--accent); }

.landing-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 44px;
  line-height: 1.5;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: var(--r-pill);
  padding: 16px 28px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  width: fit-content;
  transition: background 0.15s;
}
.btn-start:active { background: rgba(255,255,255,0.08); }

/* Auth form */
.auth-title {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 10px;
}

.auth-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 36px;
  line-height: 1.5;
  max-width: 280px;
}

.auth-form { display: flex; flex-direction: column; gap: 12px; }

.field {
  background: rgba(255,255,255,0.09);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: var(--r-pill);
  padding: 17px 24px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.field::placeholder { color: rgba(255,255,255,0.4); }
.field:focus { border-color: rgba(255,255,255,0.5); }

.btn-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-btn);
  border: none;
  border-radius: var(--r-pill);
  padding: 17px 28px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  margin-top: 4px;
  transition: opacity 0.15s;
}
.btn-continue:active { opacity: 0.82; }
.btn-continue.loading { pointer-events: none; opacity: 0.6; }

.err-msg {
  color: #FF7B7B;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

/* ============================================================
   APP SCREENS (with bottom nav)
   ============================================================ */

/* Header */
.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 52px 20px 18px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.header-text { line-height: 1.3; }
.header-greeting { font-size: 11px; color: var(--muted); }
.header-name { font-size: 14px; font-weight: 700; letter-spacing: 0.3px; }

/* Page scroll area */
.page-scroll { padding: 0 20px calc(var(--nav-h) + 20px + var(--safe-b)); }

/* Section headings */
.section-title { font-size: 22px; font-weight: 800; margin-bottom: 14px; }

/* Generic card */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 14px;
}

/* ============================================================
   HOME — Weight chart
   ============================================================ */
.weight-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px 18px 20px;
  margin-bottom: 14px;
}

.weight-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.weight-left .lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 2px;
}
.weight-left .val { font-size: 22px; font-weight: 700; }

.weight-badge {
  background: rgba(255,255,255,0.09);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.weight-badge .arrow { color: #5CB85C; }

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 76px;
}
.bar {
  flex: 1;
  background: rgba(255,255,255,0.17);
  border-radius: 4px 4px 0 0;
  min-height: 6px;
}

/* ============================================================
   HOME — Action cards grid
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.action-card {
  background: var(--accent);
  border-radius: var(--r-lg);
  padding: 20px 16px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.action-card:active { opacity: 0.85; }

.ac-label { font-size: 14px; font-weight: 700; color: #000; margin-bottom: 6px; }
.ac-value { font-size: 24px; font-weight: 800; color: rgba(0,0,0,0.55); line-height: 1.15; }

/* ============================================================
   HOME — Pro Version card
   ============================================================ */
.pro-card {
  background: #080C10;
  border-radius: var(--r-xl);
  padding: 26px 20px;
  text-align: center;
  margin-bottom: 14px;
  border: 1px solid rgba(204,255,0,0.1);
  box-shadow: 0 0 40px rgba(204,255,0,0.08);
}

.pro-card .icon  { font-size: 28px; margin-bottom: 10px; }
.pro-card .title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.pro-card .desc  { font-size: 13px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }

.btn-buy {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: var(--r-pill);
  padding: 12px 40px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: background 0.15s;
}
.btn-buy:active { background: rgba(255,255,255,0.06); }

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 430px);
  height: calc(var(--nav-h) + var(--safe-b));
  background: #0A0D12;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding-top: 12px;
  padding-bottom: var(--safe-b);
  z-index: 100;
}


.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: none;
  border: none;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 12px;
  position: relative;
  transition: color 0.15s;
}
.nav-btn.active { color: var(--text); }
.nav-btn svg { width: 24px; height: 24px; }

.nav-dot {
  position: absolute;
  top: 3px;
  right: 10px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid #0A0D12;
}

/* ============================================================
   NUTRITION SCREEN
   ============================================================ */
.streak-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
}

.week-card {
  background: var(--accent);
  border-radius: var(--r-lg);
  padding: 16px 14px;
  margin-bottom: 14px;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 16px;
}

.wd-name {
  font-size: 11px;
  font-weight: 600;
  color: rgba(0,0,0,0.55);
  margin-bottom: 6px;
}

.wd-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 14px;
  font-weight: 700;
  color: rgba(0,0,0,0.75);
}
.wd-num.today { background: #000; color: var(--accent); }

.calorie-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-stat { text-align: center; }
.cal-stat .lbl { font-size: 13px; font-weight: 700; color: #000; }
.cal-stat .sub { font-size: 11px; color: rgba(0,0,0,0.6); }

.gauge-wrap {
  position: relative;
  width: 110px;
  height: 64px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.gauge-svg { width: 110px; height: 64px; overflow: visible; }

.gauge-label {
  position: absolute;
  bottom: -2px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: #000;
  line-height: 1.2;
  pointer-events: none;
}
.gauge-label span { font-size: 10px; font-weight: 600; }

.macros-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.macro-pill {
  background: var(--surface);
  border-radius: var(--r);
  padding: 14px 12px;
}
.macro-pill .name { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.macro-pill .vals { font-size: 13px; font-weight: 700; }

.meals-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.meal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.meal-row:last-child { border-bottom: none; }

.meal-emoji { font-size: 26px; width: 40px; text-align: center; }
.meal-name  { flex: 1; font-size: 15px; font-weight: 600; }

.meal-edit {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.meal-edit:active { opacity: 0.8; }

.water-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 14px;
}

.water-top {
  display: flex;
  gap: 28px;
  margin-bottom: 20px;
}

.water-stat label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }
.water-stat span  { font-size: 20px; font-weight: 700; }

.water-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.donut-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.donut-lbl {
  position: absolute;
  font-size: 16px;
  font-weight: 700;
}

.bottle-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.btn-round {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #000;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}
.btn-round:active { opacity: 0.8; }

/* ============================================================
   FOOD SEARCH
   ============================================================ */
.search-pg { padding-bottom: 100px; }

.search-hdr {
  padding: 52px 20px 0;
  margin-bottom: 20px;
}

.search-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}
.search-title .lime { color: var(--accent); }

.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 0 18px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: rgba(255,255,255,0.2); }
.search-bar svg { color: var(--muted); flex-shrink: 0; width: 20px; height: 20px; }

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  padding: 16px 12px;
}
.search-input::placeholder { color: var(--muted); }

.food-results { padding: 8px 20px; }

.food-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  background: var(--surface);
  margin-bottom: 1px;
  padding: 16px 16px;
  border-radius: 0;
}
.food-item:first-child { border-radius: var(--r) var(--r) 0 0; }
.food-item:last-child  { border-radius: 0 0 var(--r) var(--r); border-bottom: none; }
.food-item:active { opacity: 0.75; }

.food-item-info .fname { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.food-item-info .fmeta { font-size: 12px; color: var(--accent); }

.food-sel {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  flex-shrink: 0;
}

.search-toolbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 430px);
  padding: 12px 24px calc(20px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 80%, transparent);
}


.search-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: #0A0D12;
  border-radius: var(--r-pill);
  padding: 14px 28px;
}
.search-tool-btn {
  background: none;
  border: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}
.search-tool-btn svg { width: 20px; height: 20px; }

/* ============================================================
   FOOD DETAIL BOTTOM SHEET
   ============================================================ */
.food-detail-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.food-detail-top {
  display: flex;
  justify-content: center;
  padding: 52px 20px 0;
  position: relative;
}

.back-abs {
  position: absolute;
  left: 20px;
  top: 52px;
  background: none;
  border: none;
  color: var(--text);
  display: flex;
}

.meal-tag {
  background: var(--accent);
  color: #000;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--r-pill);
  padding: 10px 28px;
}

.food-detail-info {
  padding: 32px 24px 0;
  flex: 1;
}

.food-detail-name {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 28px;
}

.nutrition-row {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.nutr-item { text-align: center; }
.nutr-item .num  { font-size: 28px; font-weight: 800; }
.nutr-item .unit { font-size: 12px; color: var(--muted); margin-top: 2px; }

.food-sheet {
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px 20px calc(32px + var(--safe-b));
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.qty-row {
  display: flex;
  background: #0E1117;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.qty-num {
  width: 64px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  border-right: 1px solid rgba(255,255,255,0.1);
  padding: 16px 0;
}

.qty-unit {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  padding: 16px;
}

.btn-add {
  width: 100%;
  background: var(--accent-btn);
  border: none;
  border-radius: var(--r-pill);
  padding: 17px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  transition: opacity 0.15s;
}
.btn-add:active { opacity: 0.82; }

/* ============================================================
   AI CHAT
   ============================================================ */
.chat-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg);
}

.chat-topbar {
  display: flex;
  align-items: center;
  padding: 52px 20px 14px;
  flex-shrink: 0;
}

.chat-menu-btn {
  background: none;
  border: none;
  color: var(--text);
  padding: 4px;
  display: flex;
}

.chat-titles {
  flex: 1;
  text-align: center;
}

.chat-brand {
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
  color: var(--accent);
  display: block;
  line-height: 1;
  letter-spacing: -0.5px;
}

.chat-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1.5px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 76%;
  padding: 13px 17px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}

.msg-user {
  align-self: flex-end;
  background: var(--accent-dim);
  border-bottom-right-radius: 5px;
}

.msg-ai {
  align-self: flex-start;
  background: var(--surface);
  border-bottom-left-radius: 5px;
}

.msg-typing {
  align-self: flex-start;
  background: var(--surface);
  border-radius: 20px;
  border-bottom-left-radius: 5px;
  padding: 14px 18px;
  display: flex;
  gap: 5px;
}
.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100% { opacity: 0.3 } 40% { opacity: 1 } }

.chat-bottom {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px calc(18px + var(--safe-b));
  background: var(--bg);
  border-top: 1px solid rgba(255,255,255,0.05);
  position: relative;
  z-index: 1;
}

.chat-cam-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-cam-btn svg { width: 20px; height: 20px; }

.chat-input {
  flex: 1;
  background: var(--surface);
  border: none;
  border-radius: var(--r-pill);
  padding: 13px 18px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.chat-input::placeholder { color: var(--muted); }

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chat-send-btn:active { background: var(--accent-btn); }
.chat-send-btn svg { width: 20px; height: 20px; }

.chat-exit-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-pill);
  color: var(--muted);
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.chat-exit-btn svg { width: 16px; height: 16px; }
.chat-exit-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.chat-exit-btn:active { background: rgba(255,255,255,0.15); color: var(--text); }

/* Pro card icon / subscription icon — SVG sizing */
.pro-card .icon {
  font-size: 28px;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  color: var(--accent);
}
.pro-card .icon svg { width: 32px; height: 32px; }

.sub-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}
.sub-icon svg { width: 36px; height: 36px; }
.sub-card-pro .sub-icon { color: #000; }
.sub-card-plus .sub-icon { color: var(--accent); }

/* Sidebar */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.sidebar-overlay.open { pointer-events: all; }

.sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.25s;
}
.sidebar-overlay.open .sidebar-backdrop { background: rgba(0,0,0,0.6); }

.sidebar-panel {
  position: absolute;
  top: 0;
  left: -270px;
  bottom: 0;
  width: 255px;
  background: #0F1318;
  padding: 60px 20px 24px;
  transition: left 0.25s cubic-bezier(0.4,0,0.2,1);
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar-overlay.open .sidebar-panel { left: 0; }

.sidebar-new {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 28px;
  cursor: pointer;
}
.sidebar-new:active { opacity: 0.7; }

.new-icon {
  width: 42px;
  height: 42px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-new-label { font-size: 16px; font-weight: 600; }

.sidebar-section { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }

.sidebar-item {
  padding: 11px 0;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
}
.sidebar-item:active { color: var(--text); }

/* ============================================================
   SETTINGS
   ============================================================ */
.back-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 52px 20px 20px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text);
  display: flex;
  padding: 4px;
}

.back-title { font-size: 22px; font-weight: 700; }

.profile-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 14px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
}
.profile-row:last-child { border-bottom: none; }
.profile-row:active { background: rgba(255,255,255,0.03); }

.p-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}
.p-avatar img { width: 100%; height: 100%; object-fit: cover; }

.p-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.p-label { flex: 1; font-size: 15px; font-weight: 600; }

.btn-logout {
  width: 100%;
  background: var(--danger);
  border: none;
  border-radius: var(--r-pill);
  padding: 17px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  margin-top: 8px;
  transition: opacity 0.15s;
}
.btn-logout:active { opacity: 0.82; }

/* ============================================================
   SUBSCRIPTION
   ============================================================ */
.sub-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 52px 20px 0;
}

.sub-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  padding: 20px 20px 28px;
}

.sub-card-pro {
  background: var(--accent);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  margin: 0 20px 12px;
  text-align: center;
}

.sub-or {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0;
}

.sub-card-plus {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  margin: 0 20px;
  text-align: center;
}

.sub-version { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.sub-desc { font-size: 13px; opacity: 0.65; margin-bottom: 20px; line-height: 1.5; }

.sub-price-btn {
  background: #000;
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 14px 44px;
  font-size: 18px;
  font-weight: 800;
  transition: opacity 0.15s;
  font-family: inherit;
}
.sub-price-btn:active { opacity: 0.82; }
.sub-card-plus .sub-price-btn { background: var(--accent); color: #000; }

.sub-icon { font-size: 32px; margin-bottom: 12px; }

/* ============================================================
   DESKTOP / RESPONSIVE
   ============================================================ */

/* Hover states */
@media (hover: hover) {
  .btn-start:hover       { background: rgba(255,255,255,0.08); }
  .btn-continue:hover    { opacity: 0.88; }
  .btn-buy:hover         { background: rgba(255,255,255,0.06); }
  .btn-logout:hover      { opacity: 0.88; }
  .btn-add:hover         { opacity: 0.88; }
  .action-card:hover     { opacity: 0.88; }
  .nav-btn:hover         { color: var(--text); background: rgba(255,255,255,0.05); }
  .meal-row:hover        { background: rgba(255,255,255,0.03); }
  .food-item:hover       { opacity: 0.8; }
  .sidebar-item:hover    { color: var(--text); }
  .chat-send-btn:hover   { background: var(--accent-btn); }
  .sub-price-btn:hover   { opacity: 0.88; }
}

/* Mobile only */
.nav-label  { display: none; }
.nav-brand  { display: none; }

@media (min-width: 600px) and (max-width: 767px) {
  .search-toolbar { width: 100%; transform: none; left: 0; }
}

/* ---- Tablet / Desktop (768px+) ---- */
@media (min-width: 768px) {

  /* App shell: flex row */
  #app {
    position: fixed;
    inset: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: row;
    overflow: hidden;
  }

  /* Screen fills remaining space */
  .screen {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    inset: auto;
  }

  /* Chat screen height fix */
  .chat-screen { height: 100%; }

  /* ----- Sidebar nav ----- */
  .bottom-nav {
    position: relative;
    order: -1;
    width: 220px;
    flex-shrink: 0;
    height: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    border-top: none;
    border-right: 1px solid rgba(255,255,255,0.07);
    padding: 36px 12px 24px;
    gap: 2px;
    transform: none;
    left: auto;
    bottom: auto;
  }

  .nav-brand {
    display: block;
    font-size: 18px;
    font-weight: 900;
    font-style: italic;
    color: var(--accent);
    padding: 0 12px 28px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
  }

  .nav-label { display: block; font-size: 14px; font-weight: 500; }

  .nav-btn {
    flex-direction: row;
    width: 100%;
    gap: 14px;
    padding: 13px 16px;
    border-radius: 12px;
    justify-content: flex-start;
    font-size: 15px;
  }

  .nav-dot { top: 6px; right: auto; left: 28px; }

  /* Page content max-width */
  .page-scroll {
    max-width: 720px;
    padding-bottom: 40px;
    margin: 0 auto;
  }

  /* ----- Auth screens: split view ----- */
  .screen-auth {
    display: flex;
    flex-direction: row;
  }

  .screen-auth .bg-img,
  .screen-auth .bg-overlay {
    width: 50%;
    right: 50%;
    /* bg-img/overlay stay on left half */
  }

  .screen-auth .auth-body {
    margin-left: 50%;
    width: 50%;
    min-height: 100%;
    height: 100%;
    background: var(--bg);
    justify-content: center;
    padding: 60px 56px;
    overflow-y: auto;
  }

  .screen-auth .landing-title { font-size: 32px; }

  /* Search toolbar: not fixed on desktop */
  .search-toolbar {
    position: sticky;
    bottom: 0;
    transform: none;
    left: 0;
    width: 100%;
    max-width: none;
  }

  /* Food sheet: not fixed on desktop */
  .food-sheet {
    position: relative;
    border-radius: var(--r-xl);
    margin: 24px 24px 0;
  }

  /* Cards grid: 3 columns on wide screens */
  .cards-grid { grid-template-columns: repeat(3, 1fr); }

  /* Settings/subscription content max-width */
  .sub-card-pro,
  .sub-card-plus { margin: 0 0 12px; }
}

/* ---- Auth screen language picker (top-right) ---- */
.auth-lang-picker {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}
.auth-lang-toggle {
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s;
}
.auth-lang-toggle:hover { background: rgba(255,255,255,.22); }
.auth-lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1a1d24;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  overflow: hidden;
  min-width: 130px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.auth-lang-dropdown.open { display: block; }
.auth-lang-option {
  display: block;
  width: 100%;
  padding: 9px 16px;
  text-align: left;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.auth-lang-option:hover { background: rgba(255,255,255,.08); color: #fff; }
.auth-lang-option.active { color: var(--accent, #c5ff47); font-weight: 700; }

/* ---- Settings language switcher ---- */
.lang-section {
  margin: 20px 0;
}
.lang-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lang-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,.15);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.lang-btn.active,
.lang-btn:hover {
  background: var(--accent, #c5ff47);
  border-color: var(--accent, #c5ff47);
  color: #000;
}
