/* ===== هوية نبض ===== */
:root {
  --g1: #38B000;
  --mint: #c7f9cc;
  --cream: #EDEEc9;
  --g2: #119822;
  --g3: #008000;
  --white: #ffffff;
  --ink: #0b3d12;        /* درجة داكنة من أخضر الهوية لقراءة النصوص */
  --ink-soft: #3d6b43;
  --radius: 22px;
  --shadow: 0 8px 24px rgba(0, 128, 0, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Tajawal', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
}
body.no-scroll { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.3; }

.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ic-fill { fill: currentColor; stroke: none; }
.muted { color: var(--ink-soft); font-size: .9rem; }
.num { font-variant-numeric: tabular-nums; }

/* ===== أزرار وحقول ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 14px; font-weight: 700;
  transition: transform .15s, background .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--g3); color: var(--white); box-shadow: 0 6px 16px rgba(0,128,0,.25); }
.btn-primary:hover { background: var(--g2); }
.btn-soft { background: var(--mint); color: var(--g3); }
.btn-soft:hover { background: #b4f3bd; }
.btn-outline { border: 2px solid var(--g1); color: var(--g3); background: var(--white); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: .85rem; border-radius: 12px; }
.btn-lg { padding: 16px 22px; font-size: 1.1rem; }
.btn.active { background: var(--g3); color: var(--white); }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 700; margin-bottom: 6px; color: var(--g3); font-size: .95rem; }
.input, .field input, .field select {
  width: 100%; padding: 13px 16px; border-radius: 14px;
  border: 2px solid var(--mint); background: var(--white);
  outline: none; transition: border-color .2s, box-shadow .2s; font-size: 1rem;
}
.input:focus, .field input:focus, .field select:focus { border-color: var(--g1); box-shadow: 0 0 0 4px rgba(56,176,0,.15); }
.field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23008000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; background-size: 18px;
  padding-left: 42px;
}
.form-error { color: #b42318; font-size: .9rem; min-height: 1.4em; margin-bottom: 8px; }
.hint { text-align: center; color: var(--ink-soft); font-size: .85rem; margin-top: 14px; }

/* ===== بطاقات ===== */
.card {
  background: var(--white); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-head h3 { font-size: 1.05rem; color: var(--g3); }
.card-head .ic { color: var(--g1); }

/* ===== صفحة الدخول ===== */
.auth {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px;
  background: radial-gradient(circle at 80% 0%, var(--mint) 0, transparent 45%), radial-gradient(circle at 0% 100%, var(--mint) 0, transparent 40%), var(--cream);
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.logo-mark {
  width: 76px; height: 76px; border-radius: 24px; margin: 0 auto 12px;
  display: block; object-fit: cover;
  box-shadow: 0 12px 28px rgba(0,128,0,.3);
}
.auth-brand h1 { font-size: 2.6rem; color: var(--g3); font-weight: 800; }
.auth-brand p { color: var(--ink-soft); }
.auth-card { width: 100%; max-width: 400px; padding: 28px 22px; }
.auth-card h2 { font-size: 1.3rem; margin-bottom: 20px; color: var(--ink); }

/* ===== إعداد البيانات ===== */
.setup { max-width: 520px; margin: 0 auto; padding: 32px 16px 48px; }
.setup-head { text-align: center; margin-bottom: 22px; }
.setup-head h1 { color: var(--g3); font-size: 1.6rem; }
.setup-head p { color: var(--ink-soft); }
.grid-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
/* حقول صفحة البيانات بألوان الهوية */
.brand-form .field input, .brand-form .field select {
  background-color: var(--mint); border-color: var(--g1); color: var(--g3); font-weight: 700;
}
.brand-form .field input::placeholder { color: var(--g2); opacity: .6; font-weight: 500; }
.brand-form .field input:focus, .brand-form .field select:focus {
  background-color: var(--white); border-color: var(--g3); box-shadow: 0 0 0 4px rgba(56,176,0,.2);
}
.brand-form .field select:invalid, .brand-form .field select option[value=""] { color: var(--g2); }
.brand-form .field textarea {
  width: 100%; padding: 13px 16px; border-radius: 14px; border: 2px solid var(--g1);
  background: var(--mint); color: var(--g3); font-weight: 700; font-size: 1rem; resize: vertical; outline: none;
}
.brand-form .field textarea::placeholder { color: var(--g2); opacity: .6; font-weight: 500; }
.brand-form .field textarea:focus { background: var(--white); border-color: var(--g3); box-shadow: 0 0 0 4px rgba(56,176,0,.2); }

/* الذكاء الاصطناعي */
.ai-box {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-radius: 16px; padding: 12px 14px; margin-top: 12px; font-size: .9rem; font-weight: 700;
}
.ai-box.loading { background: var(--mint); color: var(--g3); }
.ai-box.ok { background: var(--mint); color: var(--g3); border: 2px solid var(--g1); }
.ai-box.ok > span { flex: 1; min-width: 0; }
.ai-box.ok > .ic { color: var(--g3); }
.ai-box.warn { background: var(--cream); color: var(--ink); border: 2px dashed var(--g1); font-weight: 500; }
.ai-box .btn { padding: 6px 12px; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid var(--g1); border-top-color: transparent; animation: spin .8s linear infinite; display: inline-block;
}
.spinner.light { border-color: var(--white); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.suggest-list .why { display: block; font-size: .78rem; color: var(--ink-soft); margin: 2px 0; }
.hero-btn { background: rgba(255,255,255,.2); color: var(--white); margin-top: 10px; }
.hero-btn:hover { background: rgba(255,255,255,.3); }

.recipe h3 { color: var(--g3); font-size: 1.2rem; margin-bottom: 8px; }
.recipe h4 { color: var(--g3); margin: 16px 0 8px; }
.recipe-meta { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.recipe-meta .ic { width: 18px; height: 18px; color: var(--g1); }
.recipe-ing { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.recipe-ing li { display: flex; justify-content: space-between; gap: 10px; background: var(--cream); border-radius: 12px; padding: 8px 12px; font-size: .9rem; }
.recipe-ing b { color: var(--g3); }
.recipe-steps { padding-right: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 10px; }
.recipe-steps li { counter-increment: st; display: flex; gap: 10px; font-size: .92rem; line-height: 1.7; }
.recipe-steps li::before {
  content: counter(st); flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--g1); color: var(--white); font-weight: 800; display: grid; place-items: center; font-size: .85rem;
}
.recipe-tip { margin: 14px 0; background: var(--mint); border-radius: 14px; padding: 10px 14px; font-size: .9rem; color: var(--g3); }

/* القائمة المنسدلة بألوان الهوية */
.bselect { position: relative; }
.bs-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 13px 16px; border-radius: 14px; border: 2px solid var(--g1);
  background: var(--mint); color: var(--g3); font-weight: 700; font-size: 1rem; text-align: right;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.bs-btn.bs-empty { color: var(--g2); font-weight: 500; }
.bs-btn.bs-empty .bs-val { opacity: .6; }
.bs-btn .ic { width: 18px; height: 18px; color: var(--g3); stroke-width: 2.6; transition: transform .2s; }
.bselect.open .bs-btn { border-color: var(--g3); background: var(--white); box-shadow: 0 0 0 4px rgba(56,176,0,.2); }
.bselect.open .bs-btn .ic { transform: rotate(180deg); }
.bs-list {
  position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 15; list-style: none;
  background: var(--white); border: 2px solid var(--g1); border-radius: 16px; padding: 6px;
  box-shadow: 0 12px 28px rgba(0,128,0,.22); animation: fade .15s;
}
.bs-list button {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 11px 12px; border-radius: 11px; font-weight: 700; color: var(--g3); text-align: right;
}
.bs-list button + button, .bs-list li + li { margin-top: 4px; }
.bs-list button:hover, .bs-list button:focus-visible { background: var(--mint); outline: none; }
.bs-list button .ic { width: 18px; height: 18px; stroke-width: 3; visibility: hidden; }
.bs-list button[aria-selected="true"] { background: var(--g3); color: var(--white); }
.bs-list button[aria-selected="true"] .ic { visibility: visible; }

.unit-input { position: relative; display: block; }
.unit-input input { padding-left: 54px; }
.unit-input i {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  font-style: normal; font-size: .8rem; font-weight: 700;
  background: var(--g1); color: var(--white); padding: 2px 8px; border-radius: 8px; pointer-events: none;
}
.unit-input input::-webkit-outer-spin-button, .unit-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-input input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.goal-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.steps-indicator { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.steps-indicator span { width: 28px; height: 6px; border-radius: 4px; background: var(--mint); }
.steps-indicator span.on { background: var(--g1); }

/* ===== صفحة النتائج ===== */
.result { max-width: 640px; margin: 0 auto; padding: 32px 16px 48px; }
.result-hero {
  text-align: center; padding: 28px 20px; border-radius: var(--radius); color: var(--white);
  background: linear-gradient(135deg, var(--g3), var(--g1)); margin-bottom: 18px;
}
.result-hero h1 { font-size: 1.5rem; margin-bottom: 6px; }
.result-hero p { opacity: .95; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--white); border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.stat .ic { color: var(--g1); width: 26px; height: 26px; }
.stat-label { font-size: .85rem; color: var(--ink-soft); }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--g3); }
.stat-value small { font-size: .8rem; font-weight: 500; color: var(--ink-soft); }
.stat.wide { grid-column: 1 / -1; }
.stat.accent { background: var(--mint); }

/* ===== الهيكل الرئيسي ===== */
.topbar {
  position: sticky; top: 0; z-index: 20; color: var(--white);
  background: linear-gradient(120deg, var(--g3), var(--g1));
  box-shadow: 0 4px 16px rgba(0,128,0,.2);
}
.topbar-inner { max-width: 520px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.4rem; }
.brand-logo { width: 32px; height: 32px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,255,255,.55); }
.cheer { flex: 1; min-width: 0; font-size: .88rem; line-height: 1.4; border-right: 2px solid rgba(255,255,255,.35); padding-right: 12px; }
.cheer strong { display: block; font-size: .95rem; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--mint); color: var(--g3);
  display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
}
.page { max-width: 520px; margin: 0 auto; padding: 16px 16px 110px; display: flex; flex-direction: column; gap: 16px; }
.section-title { font-size: 1.15rem; color: var(--g3); margin: 6px 0 -4px; }

.bottom-nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 30;
  background: var(--white); box-shadow: 0 -6px 20px rgba(0,128,0,.12);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
}
.bottom-nav ul { list-style: none; display: flex; max-width: 560px; margin: 0 auto; }
.bottom-nav li { flex: 1; }
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .78rem; font-weight: 700; color: var(--ink-soft); padding: 6px 4px; border-radius: 14px;
  transition: background .2s, color .2s;
}
.bottom-nav a.active { color: var(--g3); background: var(--mint); }

/* ===== الرئيسية ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.steps-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.steps-card .card-head { width: 100%; }
.ring { position: relative; width: 132px; height: 132px; margin: 4px auto 8px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { stroke: var(--mint); }
.ring-fg { stroke: var(--g1); transition: stroke-dashoffset .6s ease; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-size: 1.45rem; color: var(--g3); line-height: 1.1; }
.ring-center span { font-size: .75rem; color: var(--ink-soft); }
.steps-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.steps-actions .btn { padding: 8px 10px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--white); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* مربعات الرئيسية */
.tiles { gap: 12px; }
.tile {
  aspect-ratio: 1 / 1; padding: 12px; width: 100%; font: inherit; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform .15s, box-shadow .2s;
}
.tile:active { transform: scale(.97); }
.tile .ring { width: 100%; max-width: 132px; height: auto; aspect-ratio: 1 / 1; margin: 0; }
.tile .ring-center .ic { width: 18px; height: 18px; color: var(--g1); }
.tile .ring-center b { font-size: 1.25rem; }
.tile-meals b { color: var(--g3); font-size: 1.05rem; }
.tile-meals .muted { font-size: .78rem; }
.tile-icon {
  width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; color: var(--white);
  background: linear-gradient(135deg, var(--g1), var(--g3)); box-shadow: 0 8px 18px rgba(0,128,0,.25);
}
.tile-icon .ic { width: 30px; height: 30px; }
.steps-left { font-weight: 700; color: var(--g3); margin-bottom: 12px; }
.sugg-title { color: var(--g3); font-size: 1rem; margin: 14px 0 8px; }
.sugg-title:first-of-type { margin-top: 0; }
.suggest-list li.today { background: var(--mint); border: 2px solid var(--g1); }

.suggest-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.suggest-list li { background: var(--cream); border-radius: 14px; padding: 8px 10px; }
.suggest-list .tag { font-size: .72rem; font-weight: 700; color: var(--white); background: var(--g2); border-radius: 8px; padding: 1px 8px; }
.suggest-list p { font-size: .85rem; font-weight: 500; margin-top: 4px; line-height: 1.4; }
.suggest-list small { color: var(--g3); font-weight: 700; font-size: .75rem; }

.cal-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-big { font-size: 1.9rem; font-weight: 800; color: var(--g3); }
.cal-big small { font-size: .9rem; color: var(--ink-soft); font-weight: 500; }
.bar { height: 14px; background: var(--mint); border-radius: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--g1), var(--g3)); transition: width .6s ease; }
.bar.over > span { background: var(--g2); }
.bar-sm { height: 8px; }
.macro-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.macro-row .lbl { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 4px; }
.macro-row .lbl b { color: var(--g3); }
.m-protein > span { background: var(--g3); }
.m-carb > span { background: var(--g1); }
.m-fat > span { background: var(--g2); }

.meal-card { padding: 16px; }
.meal-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.meal-info h3 { color: var(--g3); font-size: 1.1rem; }
.meal-kcal { font-weight: 700; font-size: .95rem; }
.meal-kcal span { color: var(--ink-soft); font-weight: 500; font-size: .82rem; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pill { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.p-protein { background: var(--g3); color: var(--white); }
.p-carb { background: var(--mint); color: var(--g3); }
.p-fat { background: var(--cream); color: var(--g2); border: 1.5px solid var(--g1); }
.add-btn {
  width: 56px; height: 56px; border-radius: 18px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--white);
  background: linear-gradient(135deg, var(--g1), var(--g3));
  box-shadow: 0 8px 18px rgba(0,128,0,.28); transition: transform .15s;
}
.add-btn:hover { transform: translateY(-2px); }
.add-btn .ic { width: 28px; height: 28px; stroke-width: 2.6; }
.entries { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; border-top: 1.5px dashed var(--mint); padding-top: 12px; }
.entry { display: flex; align-items: center; gap: 10px; }
.thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--mint); flex-shrink: 0; display: grid; place-items: center; color: var(--g3); }
.entry-txt { flex: 1; min-width: 0; font-size: .85rem; line-height: 1.4; }
.entry-txt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-soft); }
.icon-btn:hover { background: var(--cream); color: var(--g3); }

/* ===== التقدم الأسبوعي ===== */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: 'Tajawal', sans-serif; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--white); border-radius: 18px; padding: 14px 10px; text-align: center; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 1.35rem; color: var(--g3); }
.kpi span { font-size: .78rem; color: var(--ink-soft); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-soft); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: middle; margin-left: 4px; }

/* ===== الرياضة ===== */
.day-hero {
  border-radius: var(--radius); padding: 20px; color: var(--white);
  background: linear-gradient(135deg, var(--g3), var(--g1));
}
.day-hero h2 { font-size: 1.35rem; }
.day-hero p { opacity: .95; font-size: .92rem; margin-bottom: 12px; }
.day-hero .bar { background: rgba(255,255,255,.3); }
.day-hero .bar > span { background: var(--white); }
.day-hero .count { font-size: .85rem; margin-top: 6px; }
.workout { display: flex; gap: 12px; align-items: stretch; padding: 12px; }
.workout.done { background: var(--mint); }
.video-thumb {
  width: 112px; min-height: 84px; border-radius: 16px; flex-shrink: 0; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--g2), var(--g1)); display: grid; place-items: center; color: var(--white);
}
.video-thumb::before { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(199,249,204,.18); top: -50px; left: -40px; }
.video-thumb .play { width: 42px; height: 42px; border-radius: 50%; background: var(--white); color: var(--g3); display: grid; place-items: center; position: relative; }
.video-thumb .play .ic { width: 18px; height: 18px; margin-right: -3px; }
.video-thumb .dur { position: absolute; bottom: 6px; right: 6px; font-size: .7rem; background: rgba(0,0,0,.25); padding: 0 6px; border-radius: 6px; }
.workout-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.workout-body h3 { font-size: 1rem; color: var(--g3); }
.workout-body p { font-size: .82rem; color: var(--ink-soft); line-height: 1.5; }
.workout-body a { font-size: .82rem; font-weight: 700; color: var(--g2); margin-top: 4px; text-decoration: underline; text-underline-offset: 3px; }
.check { display: grid; place-items: center; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 32px; height: 32px; border-radius: 10px; border: 2.5px solid var(--g1); background: var(--white);
  display: grid; place-items: center; color: transparent; transition: background .2s, color .2s;
}
.check input:checked + .box { background: var(--g3); border-color: var(--g3); color: var(--white); }
.check input:focus-visible + .box { box-shadow: 0 0 0 4px rgba(56,176,0,.25); }
.check .box .ic { width: 20px; height: 20px; stroke-width: 3; }

/* ===== الصفحة الشخصية ===== */
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 1.6rem; }
.profile-head h2 { color: var(--g3); }
.goal-badge { display: inline-block; font-size: .8rem; font-weight: 700; background: var(--mint); color: var(--g3); padding: 2px 12px; border-radius: 20px; }
.info-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.info-item { background: var(--cream); border-radius: 14px; padding: 10px 12px; }
.info-item span { display: block; font-size: .78rem; color: var(--ink-soft); }
.info-item b { color: var(--g3); font-size: 1.05rem; }
.weight-track { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink-soft); margin-top: 6px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; }
.actions-col { display: flex; flex-direction: column; gap: 10px; }

/* ===== النافذة المنبثقة ===== */
.modal-wrap {
  position: fixed; inset: 0; z-index: 50; background: rgba(11,61,18,.45);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .2s;
}
.modal {
  background: var(--white); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 26px 26px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up .25s ease;
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { color: var(--g3); font-size: 1.15rem; }

.cam { position: relative; background: var(--ink); border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--mint); font-size: .95rem; }
.cam-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.shutter {
  width: 72px; height: 72px; border-radius: 50%; background: var(--white); flex-shrink: 0;
  border: 6px solid var(--g1); box-shadow: 0 0 0 3px var(--mint);
}
.shutter:disabled { opacity: .4; cursor: not-allowed; }
.photo-preview { width: 100%; border-radius: 18px; max-height: 220px; object-fit: cover; display: block; }
.food-search { position: relative; margin: 14px 0 10px; }
.food-search .ic { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--g1); }
.food-search .input { padding-right: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; padding: 2px; }
.chip { font-size: .85rem; padding: 6px 12px; border-radius: 20px; background: var(--cream); font-weight: 500; }
.chip:hover { background: var(--mint); color: var(--g3); }
.sel-items { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.sel-item { display: flex; align-items: center; gap: 8px; background: var(--cream); border-radius: 14px; padding: 8px 10px; }
.sel-item .name { flex: 1; font-weight: 700; font-size: .9rem; min-width: 0; }
.sel-item .name small { display: block; font-weight: 500; color: var(--ink-soft); }
.sel-item input { width: 74px; padding: 6px 8px; border-radius: 10px; border: 2px solid var(--mint); text-align: center; }
.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0; }
.totals div { background: var(--mint); border-radius: 14px; padding: 8px 4px; text-align: center; }
.totals b { display: block; color: var(--g3); font-size: 1.05rem; }
.totals span { font-size: .72rem; color: var(--ink-soft); }
.quick { display: flex; gap: 8px; margin-bottom: 14px; }
.quick .btn { flex: 1; }

.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translate(-50%, 20px); z-index: 60;
  background: var(--g3); color: var(--white); padding: 10px 18px; border-radius: 14px; font-weight: 700; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty { text-align: center; color: var(--ink-soft); font-size: .85rem; padding: 6px 0; }

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

/* ===== الإشعارات ===== */
.rem-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.rem-row { display: flex; align-items: center; gap: 10px; background: var(--cream); border-radius: 14px; padding: 8px 10px; }
.rem-row .check .box { width: 28px; height: 28px; }
.rem-label { flex: 1; font-weight: 700; font-size: .9rem; }
.rem-time { border: 2px solid var(--mint); background: var(--white); border-radius: 10px; padding: 6px 8px; font-size: .9rem; color: var(--g3); font-weight: 700; }

/* ===== شاشة الكمبيوتر ===== */
.gate { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gate > .ic { width: 48px; height: 48px; color: var(--g1); }
.gate h2 { margin-bottom: 0; color: var(--g3); }
.gate-url { font-weight: 800; color: var(--g3); background: var(--mint); padding: 6px 14px; border-radius: 12px; margin-top: 6px; word-break: break-all; }

/* ===== اللابتوب: الموقع داخل إطار بعرض الجوال ===== */
@media (min-width: 600px) {
  body {
    background:
      radial-gradient(circle at 15% 20%, var(--mint) 0, transparent 35%),
      radial-gradient(circle at 85% 85%, var(--mint) 0, transparent 35%),
      var(--cream);
  }
  #app {
    max-width: 430px; margin: 0 auto; min-height: 100vh; position: relative;
    background: var(--cream); box-shadow: 0 0 48px rgba(0, 128, 0, .18);
  }
  .auth { min-height: 100vh; }
  .bottom-nav { max-width: 430px; margin: 0 auto; }
  .modal { max-width: 430px; }
}

@media (max-width: 360px) {
  .macro-rows { grid-template-columns: 1fr; }
  .cheer { display: none; }
}
