/* =========================================================================
   Fitak — Design System
   Inspired by "Build with Science": deep navy surfaces, electric-blue accent,
   large rounded cards. Fully the-able (dark/light) + RTL-ready (logical props).
   ========================================================================= */

:root {
  /* Brand */
  --primary: #4C8DFF;
  --primary-strong: #3A6FD8;
  --primary-soft: rgba(76, 141, 255, 0.14);
  --primary-ring: rgba(76, 141, 255, 0.35);
  --success: #35C759;
  --warn: #E8935A;
  --danger: #FF5A5A;
  --pending: #E8C15A;

  /* Radii / spacing */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;
  --gap: 14px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Layout */
  --max-w: 460px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- Dark theme (default) ---- */
[data-theme="dark"] {
  --bg: #0B0F17;
  --bg-grad-1: #0E1420;
  --bg-grad-2: #0B0F17;
  --card: #161C28;
  --card-2: #1E2632;
  --card-hover: #232C3A;
  --text: #F5F7FA;
  --text-muted: #8A94A6;
  --text-faint: #5C6675;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  --overlay: rgba(255, 255, 255, 0.04);
}

/* ---- Light theme ---- */
[data-theme="light"] {
  --bg: #EEF2F9;
  --bg-grad-1: #F4F7FC;
  --bg-grad-2: #E7ECF6;
  --card: #FFFFFF;
  --card-2: #F3F6FC;
  --card-hover: #EAF0FB;
  --text: #10151F;
  --text-muted: #5C6675;
  --text-faint: #98A1B2;
  --border: rgba(16, 21, 31, 0.09);
  --border-strong: rgba(16, 21, 31, 0.16);
  --shadow: 0 12px 30px rgba(38, 63, 110, 0.12);
  --overlay: rgba(16, 21, 31, 0.03);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", "Noto Sans Arabic", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--primary-soft), transparent 55%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.25s var(--ease);
  overflow: hidden;
}

/* ---------- App shell ---------- */
.app-shell {
  max-width: var(--max-w);
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 10px) 18px calc(var(--safe-bottom) + 14px);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.brand-mark {
  color: var(--primary);
  font-size: 20px;
  filter: drop-shadow(0 0 10px var(--primary-ring));
}
.brand-name { font-size: 20px; letter-spacing: -0.02em; }

.topbar-actions { display: flex; gap: 8px; }
.chip {
  border: 1px solid var(--border);
  background: var(--overlay);
  color: var(--text);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  backdrop-filter: blur(8px);
}
.chip:hover { border-color: var(--border-strong); background: var(--card-hover); }
.icon-chip { padding: 8px 10px; }
.theme-icon { font-size: 15px; }

/* ---------- Progress ---------- */
.progress-wrap { margin-bottom: 18px; }
.progress-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--overlay);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  box-shadow: 0 0 14px var(--primary-ring);
  transition: width 0.45s var(--ease);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.step-label { font-weight: 600; }

/* ---------- Stage / step ---------- */
.stage {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.stage::-webkit-scrollbar { display: none; }

.step { animation: stepIn 0.4s var(--ease); }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-head { margin: 4px 0 20px; }
.step-eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.step-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 6px;
  line-height: 1.2;
}
.step-sub { color: var(--text-muted); font-size: 14.5px; line-height: 1.5; margin: 0; }

/* ---------- Option cards ---------- */
.option-grid { display: grid; gap: var(--gap); }
.option-grid.cols-2 { grid-template-columns: 1fr 1fr; }

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text);
  cursor: pointer;
  text-align: start;
  transition: transform 0.15s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.option:hover { background: var(--card-hover); }
.option:active { transform: scale(0.985); }
.option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), transparent);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.option .opt-icon {
  width: 46px; height: 46px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 22px;
}
.option.selected .opt-icon { background: var(--primary); color: #fff; }
.opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-title { font-weight: 700; font-size: 15.5px; }
.opt-desc { color: var(--text-muted); font-size: 12.5px; line-height: 1.4; }
.opt-check {
  margin-inline-start: auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: grid; place-items: center;
  color: transparent;
  font-size: 12px;
  flex: none;
  transition: all 0.2s var(--ease);
}
.option.selected .opt-check { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Big centered tile (gender) */
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 28px 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.tile:active { transform: scale(0.98); }
.tile.selected {
  border-color: var(--primary);
  background: linear-gradient(160deg, var(--primary-soft), transparent);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.tile-emoji {
  width: 72px; height: 72px; border-radius: 20px;
  display: grid; place-items: center; font-size: 34px;
  background: var(--card-2);
  transition: all 0.2s var(--ease);
}
.tile.selected .tile-emoji { background: var(--primary); }
.tile-name { font-weight: 700; font-size: 16px; }

/* ---------- Numeric input w/ unit toggle ---------- */
.field { margin-bottom: 6px; }
.value-display {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  padding: 26px 0 8px;
}
.value-num {
  font-size: 54px; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(180deg, var(--text), var(--text-muted));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.value-unit { font-size: 18px; font-weight: 700; color: var(--text-muted); }

.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border-radius: var(--r-pill);
  background: var(--card-2);
  outline: none; margin: 20px 0 8px;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); cursor: pointer;
  border: 4px solid var(--bg);
  box-shadow: 0 0 0 3px var(--primary-ring), var(--shadow);
}
.slider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); cursor: pointer; border: 4px solid var(--bg);
}
.slider-scale { display: flex; justify-content: space-between; color: var(--text-faint); font-size: 11px; }

.unit-toggle {
  display: inline-flex; padding: 4px; gap: 4px;
  background: var(--card-2); border-radius: var(--r-pill);
  margin: 0 auto; width: max-content;
}
.unit-toggle button {
  border: none; background: transparent; color: var(--text-muted);
  font-weight: 700; font-size: 13px; padding: 8px 18px;
  border-radius: var(--r-pill); cursor: pointer; transition: all 0.2s var(--ease);
}
.unit-toggle button.active { background: var(--primary); color: #fff; }
.center-row { display: flex; justify-content: center; margin-top: 14px; }

/* Stepper (numeric +/-) */
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 18px 0; }
.stepper button {
  width: 54px; height: 54px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text); font-size: 26px; font-weight: 400; cursor: pointer;
  display: grid; place-items: center; transition: all 0.15s var(--ease);
}
.stepper button:hover { border-color: var(--primary); color: var(--primary); }
.stepper button:active { transform: scale(0.92); }

/* Date select row */
.date-row { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 10px; }
.select-wrap { position: relative; }
select.fld, input.fld {
  width: 100%; padding: 16px 14px; font-size: 15px; font-weight: 600;
  color: var(--text); background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--r-md); outline: none; appearance: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
select.fld:focus, input.fld:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring);
}
.select-wrap::after {
  content: "▾"; position: absolute; inset-inline-end: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); pointer-events: none; font-size: 12px;
}

/* Info pill / hint */
.hint {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 18px; padding: 14px; border-radius: var(--r-md);
  background: var(--primary-soft); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; line-height: 1.5;
}
.hint b { color: var(--text); }
.hint .h-ico { color: var(--primary); font-size: 16px; flex: none; }

/* ---------- Boot loading ---------- */
.boot-load {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 22px;
}
.boot-logo {
  font-size: 44px; color: var(--primary);
  filter: drop-shadow(0 0 14px var(--primary-ring)); animation: bootPulse 1.6s ease-in-out infinite;
}
.boot-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--card-2); border-top-color: var(--primary);
  animation: bootSpin 0.8s linear infinite;
}
@keyframes bootSpin { to { transform: rotate(360deg); } }
@keyframes bootPulse { 0%, 100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }

/* ---------- Home week strip (date navigation) ---------- */
.home-week {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 12px 10px 10px; margin-bottom: 16px;
}
.hw-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 10px; }
.hw-label { font-size: 13px; font-weight: 700; color: var(--text-muted); min-width: 96px; text-align: center; }
.hw-arrow {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--overlay); color: var(--text); font-size: 15px; cursor: pointer; display: grid; place-items: center;
}
.hw-arrow:disabled { opacity: 0.3; cursor: default; }
.hw-days { display: flex; justify-content: space-between; gap: 2px; }
.hw-day {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer; padding: 2px 0; color: var(--text);
}
.hw-day.disabled { opacity: 0.3; cursor: default; }
.hw-name { font-size: 10px; color: var(--text-faint); font-weight: 600; }
.hw-day.today .hw-name { color: var(--primary); }
.hw-circle { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.hw-circle .progress-ring { width: 40px; height: 40px; }
.hw-circle .ring-txt { font-size: 15px; font-weight: 700; }
.hw-day.today .hw-circle { box-shadow: 0 0 0 2px var(--primary); }
.hw-day.selected .hw-circle { background: var(--primary-soft); }
.hw-day.selected .ring-txt { fill: var(--primary); font-weight: 800; }

.screen-date { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

/* ---------- Home ---------- */
.home-hero { margin: 4px 0 2px; }
.home-hero h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.today-card {
  padding: 22px; border-radius: var(--r-lg); margin: 4px 0 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff; box-shadow: var(--shadow);
}
.today-card .tc-eyebrow { font-size: 13px; font-weight: 700; opacity: 0.9; }
.today-card .tc-title { font-size: 22px; font-weight: 800; margin: 6px 0; line-height: 1.25; }
.today-card .tc-sub { font-size: 14px; opacity: 0.92; line-height: 1.5; }

.stat-badge {
  margin-top: 8px; display: inline-block;
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill);
}
.tone-good { background: rgba(53, 199, 89, 0.15); color: var(--success); }
.tone-warn { background: rgba(232, 147, 90, 0.18); color: var(--warn); }
.tone-bad { background: rgba(255, 90, 90, 0.15); color: var(--danger); }
.section-label {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin: 22px 0 12px;
}
.feature-cards { display: flex; flex-direction: column; gap: 12px; }
.feature-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border);
}
.feature-card .fc-ico {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--primary-soft);
  color: var(--primary); font-size: 20px;
}
.feature-card .fc-body { flex: 1; min-width: 0; }
.feature-card .fc-t { font-weight: 700; font-size: 15px; }
.feature-card .fc-d { color: var(--text-muted); font-size: 12.5px; line-height: 1.4; }
.soon-badge {
  margin-inline-start: auto; flex: none;
  font-size: 11px; font-weight: 700; color: var(--warn);
  background: rgba(232, 147, 90, 0.15); padding: 5px 11px; border-radius: var(--r-pill);
}
#editBtn { margin-top: 24px; width: 100%; }

/* Daily task card (with progress ring) */
.task-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border);
}
.task-card.clickable { cursor: pointer; transition: border-color 0.18s var(--ease), background 0.18s var(--ease); }
.task-card.clickable:hover { border-color: var(--border-strong); background: var(--card-hover); }
.task-card.clickable:active { transform: scale(0.99); }
.task-card .tc-ico {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--primary-soft);
  color: var(--primary); font-size: 20px;
}
.task-card .tc-body { flex: 1; min-width: 0; }
.task-card .tc-t { font-weight: 700; font-size: 15px; }
.task-card .tc-target { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.task-ring { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.progress-ring { width: 46px; height: 46px; }
.progress-ring .ring-bg { stroke: var(--card-2); }
.progress-ring .ring-fg { transition: stroke-dashoffset 0.5s var(--ease); stroke-linecap: round; }
.progress-ring .ring-txt { font-size: 13px; font-weight: 800; fill: var(--text); }
.ring-good .ring-fg { stroke: var(--success); }
.ring-warn .ring-fg { stroke: var(--warn); }
.ring-bad .ring-fg { stroke: var(--danger); }
.ring-pending .ring-fg { stroke: var(--pending); }
.task-status { font-size: 11px; font-weight: 700; }
.status-good { color: var(--success); }
.status-warn { color: var(--warn); }
.status-bad { color: var(--danger); }
.status-pending { color: var(--pending); }

/* ---------- Nutrition screen ---------- */
.screen-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.back-btn {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  border: 1px solid var(--border); background: var(--overlay); color: var(--text);
  font-size: 18px; cursor: pointer; display: grid; place-items: center;
}
.back-btn:active { transform: scale(0.94); }
.screen-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }

.nut-summary { padding: 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--border); margin-bottom: 18px; }
.nut-cal { display: flex; align-items: baseline; gap: 8px; }
.nut-cal .big { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.nut-cal .small { color: var(--text-muted); font-size: 14px; font-weight: 600; }
.nut-bar { height: 9px; border-radius: var(--r-pill); background: var(--card-2); overflow: hidden; margin: 12px 0 16px; }
.nut-bar > span { display: block; height: 100%; border-radius: var(--r-pill); transition: width 0.4s var(--ease), background 0.3s; }
.fill-good { background: var(--success); } .fill-warn { background: var(--warn); }
.fill-bad { background: var(--danger); } .fill-pending { background: var(--pending); }
.macro-row { display: flex; gap: 12px; }
.macro { flex: 1; }
.macro .m-k { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.macro .m-v { font-size: 13px; font-weight: 700; margin-top: 2px; }
.macro .m-bar { height: 5px; border-radius: var(--r-pill); background: var(--card-2); margin-top: 6px; overflow: hidden; }
.macro .m-bar > span { display: block; height: 100%; background: var(--primary); border-radius: var(--r-pill); }

.meal { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); margin-bottom: 12px; overflow: hidden; }
.meal.done { border-color: rgba(53, 199, 89, 0.5); }
.meal-head { display: flex; align-items: center; gap: 10px; padding: 15px 16px; cursor: pointer; }
.meal-head .m-title { font-weight: 700; font-size: 15px; flex: 1; }
.meal.done .m-title { color: var(--success); }
.meal-head .m-kcal { color: var(--text-muted); font-size: 13px; font-weight: 700; }
.meal-head .m-caret { color: var(--text-muted); font-size: 12px; transition: transform 0.2s var(--ease); }
.meal.open .m-caret { transform: rotate(180deg); }
.meal-body { padding: 0 16px 14px; }

.food-row { display: flex; flex-direction: column; gap: 8px; padding: 11px 0; border-top: 1px solid var(--border); }
.fr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fr-name { font-size: 14px; font-weight: 600; }
.fr-kcal { font-size: 12.5px; font-weight: 700; color: var(--text-muted); flex: none; }
.fr-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qty-ctl { display: flex; align-items: center; gap: 8px; }
.qty-ctl button {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--overlay); color: var(--text); font-size: 17px; cursor: pointer; display: grid; place-items: center;
}
.qty-ctl button:active { transform: scale(0.92); }
.qty-ctl .qv { min-width: 62px; text-align: center; font-size: 12.5px; font-weight: 700; }
.swap-btn {
  border: none; background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: var(--r-pill); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.swap-btn:active { transform: scale(0.96); }
.meal-done-btn {
  width: 100%; margin-top: 12px; padding: 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--overlay); color: var(--text);
  font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.meal.done .meal-done-btn { background: rgba(53, 199, 89, 0.15); color: var(--success); border-color: transparent; }

/* ---------- Steps screen ---------- */
.steps-hero { text-align: center; padding: 10px 0 6px; }
.steps-ring-wrap { position: relative; width: 190px; height: 190px; margin: 0 auto 6px; }
.steps-ring-wrap svg { width: 190px; height: 190px; }
.steps-ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.steps-ring-center .sc-num { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.steps-ring-center .sc-goal { color: var(--text-muted); font-size: 13px; font-weight: 600; margin-top: 2px; }
.steps-ring-center .sc-status { font-size: 12px; font-weight: 700; margin-top: 6px; }

.steps-input { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 4px; }
.steps-input button {
  width: 52px; height: 44px; border-radius: var(--r-md); border: 1.5px solid var(--border);
  background: var(--card); color: var(--text); font-size: 13px; font-weight: 800; cursor: pointer;
}
.steps-input button:active { transform: scale(0.95); }
.steps-input input {
  width: 120px; text-align: center; font-size: 22px; font-weight: 800; padding: 10px;
  border-radius: var(--r-md); border: 1.5px solid var(--border); background: var(--card); color: var(--text); outline: none;
}
.steps-input input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

.week-strip { margin-top: 22px; }
.week-days { display: flex; justify-content: space-between; gap: 6px; }
.week-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; font-size: 12px; color: var(--text-faint); }
.week-dot.hit { background: var(--success); color: #fff; }
.week-day.today .week-dot { box-shadow: 0 0 0 2px var(--primary); }
.week-day .wd-label { font-size: 10px; color: var(--text-faint); }
.week-count { text-align: center; color: var(--text-muted); font-size: 13px; font-weight: 600; margin-top: 12px; }

.upgrade-card {
  margin-top: 18px; padding: 18px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--success), #2ba149); color: #fff; box-shadow: var(--shadow);
}
.upgrade-card .uc-title { font-weight: 800; font-size: 17px; }
.upgrade-card .uc-msg { font-size: 13.5px; opacity: 0.95; margin: 6px 0 14px; line-height: 1.5; }
.upgrade-actions { display: flex; gap: 10px; }
.upgrade-actions button {
  flex: 1; padding: 12px; border-radius: var(--r-md); border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.2); color: #fff; font-weight: 800; font-size: 15px;
}
.upgrade-actions button:active { transform: scale(0.97); }

.goal-choices { display: flex; gap: 10px; margin-top: 8px; }
.goal-choice {
  flex: 1; padding: 18px 8px; border-radius: var(--r-md); border: 1.5px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer; text-align: center;
}
.goal-choice:active { transform: scale(0.98); }
.goal-choice .gc-num { font-size: 20px; font-weight: 800; }
.goal-choice .gc-unit { font-size: 11px; color: var(--text-muted); }

/* Save status badge (done screen) */
.save-status {
  margin: 6px 0 16px; padding: 10px 16px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700; display: inline-block;
}
.ss-saving { background: var(--overlay); color: var(--text-muted); }
.ss-live { background: rgba(53, 199, 89, 0.15); color: var(--success); }
.ss-mock { background: var(--primary-soft); color: var(--primary); }
.ss-error { background: rgba(255, 90, 90, 0.15); color: var(--danger); }

/* Big centered text input (name) */
.big-input {
  width: 100%; text-align: center; font-size: 22px; font-weight: 700;
  padding: 18px; border-radius: var(--r-md); background: var(--card);
  border: 1.5px solid var(--border); color: var(--text); outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.big-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.big-input::placeholder { color: var(--text-faint); font-weight: 600; }

/* Skip (secondary, dashed) — used for optional steps */
.skip-btn {
  width: 100%; margin-top: 14px; padding: 15px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 1.5px dashed var(--border-strong);
  color: var(--text-muted); border-radius: var(--r-md);
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all 0.18s var(--ease);
}
.skip-btn:hover { color: var(--text); border-color: var(--primary); background: var(--primary-soft); }
.skip-btn:active { transform: scale(0.99); }

.readout {
  text-align: center; margin-top: 10px; font-size: 14px; color: var(--text-muted);
}
.readout b { color: var(--primary); font-weight: 800; }

/* ---------- Summary ---------- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-bottom: 16px; }
.stat {
  padding: 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--border);
}
.stat-k { color: var(--text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-v { font-size: 22px; font-weight: 800; margin-top: 4px; }
.stat-v small { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.summary-list { display: flex; flex-direction: column; gap: 2px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 16px; background: var(--card);
}
.summary-row .k { color: var(--text-muted); font-size: 14px; }
.summary-row .v { font-weight: 700; font-size: 14.5px; }

.hero-card {
  padding: 22px; border-radius: var(--r-lg); margin-bottom: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff; box-shadow: var(--shadow);
}
.hero-card .hc-eyebrow { font-size: 12px; font-weight: 700; opacity: 0.85; text-transform: uppercase; }
.hero-card .hc-title { font-size: 24px; font-weight: 800; margin: 6px 0; }
.hero-card .hc-sub { font-size: 14px; opacity: 0.9; }

/* ---------- Welcome ---------- */
.welcome { text-align: center; display: flex; flex-direction: column; align-items: center; padding-top: 22px; }
.welcome .w-badge {
  width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center;
  font-size: 46px; margin-bottom: 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 14px 40px var(--primary-ring);
}
.welcome h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.welcome p { color: var(--text-muted); font-size: 15px; line-height: 1.6; max-width: 320px; margin: 0 0 24px; }
.feature-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; width: 100%; max-width: 320px; }
.feature-line .fl-ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 18px; flex: none;
}
.feature-line .fl-text { text-align: start; }
.feature-line .fl-t { font-weight: 700; font-size: 14.5px; }
.feature-line .fl-d { color: var(--text-muted); font-size: 12.5px; }

/* ---------- Footer ---------- */
.footer { display: flex; gap: 12px; padding-top: 14px; }
.btn {
  flex: 1; padding: 16px; border-radius: var(--r-md); font-size: 15.5px; font-weight: 700;
  cursor: pointer; border: none; transition: all 0.18s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #fff;
  box-shadow: 0 8px 22px var(--primary-ring);
}
.btn-primary:disabled { opacity: 0.4; box-shadow: none; cursor: not-allowed; }
.btn-ghost { flex: 0 0 auto; padding-inline: 22px; background: var(--overlay); color: var(--text); border: 1px solid var(--border); }
.btn-ghost.hidden { display: none; }

/* Desktop framing so it still reads like a phone-first product */
@media (min-width: 620px) {
  body { display: grid; place-items: center; }
  .app-shell {
    height: min(880px, 96dvh);
    border: 1px solid var(--border);
    border-radius: 30px;
    box-shadow: var(--shadow);
    background: linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
  }
}
