/* ===========================================================================
   Баланс 360 — vibrant premium (энергичный, цветной, глубокий)
   =========================================================================== */
:root {
  --accent: #12b981; --accent-600: #0ea371;
  --ink: #0d1220; --ink-2: #5b6577; --ink-3: #97a0b2;
  --bg: #eef1f7; --surface: #ffffff; --surface-2: #f1f4fa; --line: #e6eaf2;
  --danger: #ff4d5e; --amber: #ff9f0a; --blue: #2d7bff; --pink: #ff5ea0; --violet: #6d5ef7;

  --g-hero: linear-gradient(145deg, #0eb47d 0%, #17c964 48%, #86e24f 100%);
  --g-accent: linear-gradient(135deg, #17c964, #0eb47d);
  --g-coral: linear-gradient(135deg, #ff9a62, #ff5470);
  --g-violet: linear-gradient(135deg, #a78bff, #6d5ef7);
  --g-amber: linear-gradient(135deg, #ffc247, #ff8a3d);
  --g-blue: linear-gradient(135deg, #58b0ff, #2d7bff);
  --g-pink: linear-gradient(135deg, #ff9ac4, #ff5ea0);
  --g-teal: linear-gradient(135deg, #34e6c8, #12b981);
  --g-lime: linear-gradient(135deg, #b6f24b, #4fd865);

  --shadow: 0 6px 24px rgba(20, 32, 61, 0.07);
  --shadow-md: 0 14px 40px rgba(20, 32, 61, 0.10);
  --shadow-lg: 0 24px 64px rgba(20, 32, 61, 0.18);
  --glow-accent: 0 12px 30px rgba(14, 180, 125, 0.38);
  --r: 26px; --r-sm: 16px; --r-lg: 32px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tab-h: 64px;
  --ff: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --accent: #2fe090; --accent-600: #22c47c;
  --ink: #f2f5fb; --ink-2: #9aa4bb; --ink-3: #5f6a82;
  --bg: #080a12; --surface: #12151f; --surface-2: #1b1f2c; --line: #232838;
  --shadow: 0 6px 24px rgba(0,0,0,.45); --shadow-md: 0 14px 40px rgba(0,0,0,.55); --shadow-lg: 0 24px 64px rgba(0,0,0,.65);
  --glow-accent: 0 12px 34px rgba(47, 224, 144, 0.28);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overscroll-behavior-y: none; }
body {
  font-family: var(--ff); color: var(--ink);
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(23,201,100,.10), transparent 60%),
    radial-gradient(100% 50% at 0% 5%, rgba(109,94,247,.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; line-height: 1.4; letter-spacing: -0.01em;
}
:root[data-theme="dark"] body { background:
  radial-gradient(120% 55% at 100% 0%, rgba(47,224,144,.10), transparent 60%),
  radial-gradient(100% 45% at 0% 4%, rgba(109,94,247,.10), transparent 55%),
  var(--bg); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; letter-spacing: inherit; }
input, textarea { font-family: inherit; letter-spacing: inherit; }
img { max-width: 100%; display: block; }
.tnum { font-variant-numeric: tabular-nums; }
svg.i { display: block; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }

/* colorful icon chips */
.chip-coral { background: var(--g-coral); color: #fff; box-shadow: 0 8px 18px rgba(255,84,112,.30); }
.chip-violet { background: var(--g-violet); color: #fff; box-shadow: 0 8px 18px rgba(109,94,247,.30); }
.chip-amber { background: var(--g-amber); color: #fff; box-shadow: 0 8px 18px rgba(255,138,61,.30); }
.chip-blue { background: var(--g-blue); color: #fff; box-shadow: 0 8px 18px rgba(45,123,255,.30); }
.chip-pink { background: var(--g-pink); color: #fff; box-shadow: 0 8px 18px rgba(255,94,160,.30); }
.chip-teal { background: var(--g-teal); color: #fff; box-shadow: 0 8px 18px rgba(18,185,129,.30); }
.chip-lime { background: var(--g-lime); color: #10321f; box-shadow: 0 8px 18px rgba(79,216,101,.32); }

/* ── Splash ───────────────────────────────────────────────────────────────── */
.splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: var(--g-hero); z-index: 100; transition: opacity .5s ease; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash-logo { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.splash-logo span { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -1px; }
.splash-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .9s linear infinite; }
.splash-name { color: #fff; font-weight: 700; font-size: 19px; letter-spacing: -0.3px; opacity: .95; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Shell ────────────────────────────────────────────────────────────────── */
.app { min-height: 100%; }
.screen { min-height: 100vh; padding-top: calc(var(--safe-top) + 6px); padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 26px); animation: fadeUp .34s cubic-bezier(.22,.61,.36,1); }
.screen.no-tab { padding-bottom: calc(var(--safe-bottom) + 28px); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.wrap { padding: 0 18px; max-width: 540px; margin: 0 auto; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.head { display: flex; align-items: flex-end; justify-content: space-between; padding: 14px 18px 16px; max-width: 540px; margin: 0 auto; }
.head .hi { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: 3px; }
.head .name { font-size: 27px; font-weight: 800; letter-spacing: -0.9px; }
.avatar { width: 46px; height: 46px; border-radius: 16px; background: var(--g-accent); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px; overflow: hidden; box-shadow: var(--glow-accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card-title { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 14px; }
.sec-label { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.3px; padding: 8px 4px 12px; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { position: relative; display: flex; flex-direction: column; background: var(--g-hero); border-radius: var(--r-lg); padding: 18px 22px 22px; box-shadow: var(--glow-accent); overflow: hidden; margin-bottom: 16px; color: #fff; }
.hero::after { content:''; position:absolute; width:200px; height:200px; border-radius:50%; background: rgba(255,255,255,.16); top:-80px; right:-60px; filter: blur(4px); }
.hero::before { content:''; position:absolute; width:150px; height:150px; border-radius:50%; background: rgba(255,255,255,.10); bottom:-70px; left:-40px; }
.hero-badge { align-self: flex-end; z-index: 1; display: inline-flex; align-items: center; gap: 5px; margin-bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.22); font-size: 12px; font-weight: 700; letter-spacing: -0.2px; backdrop-filter: blur(6px); }
.hero-top { position: relative; display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 122px; height: 122px; flex-shrink: 0; filter: drop-shadow(0 4px 12px rgba(0,0,0,.14)); }
.ring svg.rc { transform: rotate(-90deg); }
.ring .ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .rc-num { font-size: 33px; font-weight: 800; line-height: 1; letter-spacing: -1.6px; }
.ring .rc-label { font-size: 11px; opacity: .9; margin-top: 4px; font-weight: 600; }
.hero-meta { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.hero-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.hero-row + .hero-row { border-top: 1px solid rgba(255,255,255,.18); }
.hero-row .hr-l { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; opacity: .95; }
.hero-row .hr-l .i { opacity: .85; }
.hero-row b { font-weight: 800; font-size: 17px; letter-spacing: -0.4px; }

/* ── Macros ───────────────────────────────────────────────────────────────── */
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.macro .m-lab { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.macro .m-dot { width: 8px; height: 8px; border-radius: 50%; }
.macro .m-val { font-size: 20px; font-weight: 800; letter-spacing: -0.6px; margin-bottom: 9px; }
.macro .m-val small { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.macro .m-bar { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.macro .m-fill { height: 100%; border-radius: 4px; transition: width .7s cubic-bezier(.22,.61,.36,1); }
.dot-p { background: var(--pink); } .fill-p { background: var(--g-pink); }
.dot-f { background: var(--amber); } .fill-f { background: var(--g-amber); }
.dot-c { background: var(--blue); } .fill-c { background: var(--g-blue); }

/* ── Water ────────────────────────────────────────────────────────────────── */
.water { display: flex; align-items: center; gap: 14px; }
.water .w-ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff; }
.water .w-info { flex: 1; }
.water .w-val { font-weight: 800; font-size: 19px; letter-spacing: -0.5px; }
.water .w-val small { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.water .w-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.water .w-btns { display: flex; gap: 8px; }
.wbtn { width: 40px; height: 40px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink); transition: transform .12s, background .15s, color .15s; }
.wbtn:active { transform: scale(.9); background: var(--g-blue); color: #fff; }

/* ── Quick actions ────────────────────────────────────────────────────────── */
.qa { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.qa-item { position: relative; background: var(--surface); border-radius: var(--r); padding: 17px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; text-align: left; transition: transform .13s; overflow: hidden; }
.qa-item:active { transform: scale(.97); }
.qa-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; }
.qa-txt { display: flex; flex-direction: column; gap: 3px; }
.qa-t { font-weight: 700; font-size: 15px; letter-spacing: -0.3px; }
.qa-s { font-size: 12.5px; color: var(--ink-3); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 17px; border-radius: 18px; font-weight: 700; font-size: 16px; letter-spacing: -0.3px; transition: transform .1s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn-accent { background: var(--g-accent); color: #fff; box-shadow: var(--glow-accent); }
.btn-primary { background: var(--ink); color: var(--surface); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-sm { padding: 13px 14px; font-size: 14.5px; border-radius: 14px; }
.btn-row { display: flex; gap: 10px; }
.btn:disabled { opacity: .45; pointer-events: none; }

/* ── Onboarding ───────────────────────────────────────────────────────────── */
.onb { min-height: 100vh; display: flex; flex-direction: column; padding: calc(var(--safe-top) + 22px) 22px calc(var(--safe-bottom) + 24px); max-width: 540px; margin: 0 auto; }
.onb-progress { display: flex; gap: 6px; margin-bottom: 38px; }
.onb-progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background .3s; }
.onb-progress i.on { background: var(--g-accent); }
.onb-body { flex: 1; display: flex; flex-direction: column; justify-content: center; animation: fadeUp .3s; }
.onb-kicker { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--accent-600); letter-spacing: .4px; text-transform: uppercase; margin-bottom: 14px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.onb h1 { font-size: 31px; font-weight: 800; margin: 0 0 10px; letter-spacing: -1.1px; line-height: 1.1; }
.onb p { color: var(--ink-2); margin: 0 0 30px; font-size: 15.5px; line-height: 1.5; }
.field { width: 100%; padding: 20px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); font-size: 22px; font-weight: 800; text-align: center; color: var(--ink); outline: none; letter-spacing: -0.5px; transition: border-color .2s, box-shadow .2s; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.field-unit { position: relative; }
.field-unit span { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 700; font-size: 15px; }
.pick2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick { padding: 26px 14px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); text-align: center; transition: all .16s; }
.pick:active { transform: scale(.97); }
.pick.sel { border-color: transparent; box-shadow: var(--shadow-md), inset 0 0 0 2px var(--accent); }
.pick .p-ic { width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; }
.pick .p-title { font-weight: 700; font-size: 16px; letter-spacing: -0.3px; }
.pick-list { display: flex; flex-direction: column; gap: 10px; }
.pick-row { display: flex; align-items: center; gap: 14px; padding: 15px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); text-align: left; transition: all .16s; }
.pick-row.sel { border-color: transparent; box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.pick-row .pr-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.pick-row .pr-title { font-weight: 700; letter-spacing: -0.2px; }
.pick-row .pr-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.pick-row .pr-check { margin-left: auto; color: var(--accent); opacity: 0; transition: opacity .15s; }
.pick-row.sel .pr-check { opacity: 1; }
.onb-foot { padding-top: 20px; }
.onb-back { position: absolute; top: calc(var(--safe-top) + 16px); left: 18px; width: 40px; height: 40px; border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink); }

.strat { display: flex; flex-direction: column; gap: 12px; }
.strat-card { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); transition: all .16s; overflow: hidden; }
.strat-card.sel { border-color: transparent; box-shadow: var(--shadow-md), inset 0 0 0 2px var(--accent); }
.strat-card .s-bar { width: 4px; height: 40px; border-radius: 3px; background: var(--g-accent); }
.strat-card .s-main { flex: 1; }
.strat-card .s-pace { font-weight: 800; font-size: 17px; letter-spacing: -0.3px; }
.strat-card .s-term { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.strat-card .s-cal { text-align: right; }
.strat-card .s-cal b { font-size: 23px; font-weight: 800; letter-spacing: -1px; background: var(--g-accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.strat-card .s-cal span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; }

/* ── Tab bar ──────────────────────────────────────────────────────────────── */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); background: color-mix(in srgb, var(--surface) 84%, transparent); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); border-top: 1px solid var(--line); display: flex; align-items: center; z-index: 40; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); transition: color .15s; height: 100%; }
.tab .t-lab { font-size: 10px; font-weight: 600; }
.tab.active { color: var(--accent-600); }
.tab .i { transition: transform .16s; }
.tab.active .i { transform: translateY(-2px) scale(1.06); }
.tab-cam { flex: 0 0 auto; width: 68px; display: grid; place-items: center; position: relative; }
.cam-btn { position: absolute; top: -20px; width: 58px; height: 58px; border-radius: 20px; background: var(--g-accent); display: grid; place-items: center; color: #fff; box-shadow: var(--glow-accent); transition: transform .12s; }
.cam-btn:active { transform: scale(.92); }

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 18px 14px; max-width: 540px; margin: 0 auto; }
.topbar .tb-back { width: 40px; height: 40px; border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink); flex-shrink: 0; }
.topbar h2 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -0.6px; }

/* ── AI result ────────────────────────────────────────────────────────────── */
.ai-text { white-space: pre-wrap; font-size: 15px; line-height: 1.62; color: var(--ink); letter-spacing: -0.1px; }
.ai-card { position: relative; background: var(--surface); border-radius: var(--r); padding: 18px 18px 18px 20px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.ai-card::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background: var(--g-accent); }

.kbju { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 2px 0 14px; }
.kbju .k { border-radius: var(--r-sm); padding: 15px 6px; text-align: center; color: #fff; }
.kbju .k:nth-child(1){ background: var(--g-teal); } .kbju .k:nth-child(2){ background: var(--g-pink); }
.kbju .k:nth-child(3){ background: var(--g-amber); } .kbju .k:nth-child(4){ background: var(--g-blue); }
.kbju .k b { font-size: 22px; font-weight: 800; display: block; letter-spacing: -0.8px; }
.kbju .k span { font-size: 11px; opacity: .92; margin-top: 2px; display: block; }

.capture { border: 2px dashed var(--line); border-radius: var(--r); padding: 40px 18px; text-align: center; background: var(--surface); transition: border-color .2s; }
.capture:active { border-color: var(--accent); }
.capture .c-ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--g-accent); display: grid; place-items: center; color: #fff; box-shadow: var(--glow-accent); }
.capture .c-title { font-weight: 700; font-size: 16px; letter-spacing: -0.3px; }
.capture .c-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.preview-img { border-radius: var(--r); overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow); }
.preview-img img { width: 100%; max-height: 320px; object-fit: cover; }

.food-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--surface-2); padding: 4px; border-radius: 15px; }
.food-tab { flex: 1; padding: 12px; border-radius: 12px; font-weight: 700; font-size: 14px; color: var(--ink-2); text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .15s; }
.food-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.ta { width: 100%; min-height: 100px; padding: 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); font-size: 15px; color: var(--ink); outline: none; resize: none; }
.ta:focus { border-color: var(--accent); }

/* ── Options / tiles ──────────────────────────────────────────────────────── */
.opt-list { display: flex; flex-direction: column; gap: 11px; }
.opt { display: flex; align-items: center; gap: 15px; padding: 15px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); transition: transform .12s; }
.opt:active { transform: scale(.98); }
.opt .o-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.opt .o-main { flex: 1; text-align: left; min-width: 0; }
.opt .o-title { font-weight: 700; font-size: 15.5px; letter-spacing: -0.3px; }
.opt .o-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.opt .o-arrow { color: var(--ink-3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--surface); border-radius: var(--r); padding: 20px 16px; box-shadow: var(--shadow); transition: transform .12s; display: flex; flex-direction: column; align-items: flex-start; gap: 13px; }
.tile:active { transform: scale(.96); }
.tile .t-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; }
.tile .t-name { font-weight: 700; font-size: 15.5px; letter-spacing: -0.3px; }

/* ── Chat ─────────────────────────────────────────────────────────────────── */
.chat { display: flex; flex-direction: column; gap: 10px; padding: 10px 18px; max-width: 540px; margin: 0 auto; min-height: 60vh; }
.bubble { max-width: 84%; padding: 13px 16px; border-radius: 21px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; animation: fadeUp .24s; letter-spacing: -0.1px; }
.bubble.me { align-self: flex-end; background: var(--g-accent); color: #fff; border-bottom-right-radius: 7px; box-shadow: var(--glow-accent); }
.bubble.ai { align-self: flex-start; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); border-bottom-left-radius: 7px; }
.chat-input { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(var(--safe-bottom) + 12px); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(20px); border-top: 1px solid var(--line); display: flex; gap: 10px; z-index: 40; }
.chat-input input { flex: 1; padding: 14px 18px; border-radius: 22px; border: 2px solid var(--line); background: var(--bg); font-size: 15px; color: var(--ink); outline: none; }
.chat-input input:focus { border-color: var(--accent); }
.chat-send { width: 48px; height: 48px; border-radius: 50%; background: var(--g-accent); color: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: var(--glow-accent); }

/* ── Profile ──────────────────────────────────────────────────────────────── */
.pf-head { text-align: center; padding: 14px 0 4px; }
.pf-avatar { width: 88px; height: 88px; border-radius: 28px; margin: 0 auto 12px; background: var(--g-accent); display: grid; place-items: center; color: #fff; font-size: 34px; font-weight: 800; overflow: hidden; box-shadow: var(--glow-accent); }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-name { font-size: 24px; font-weight: 800; letter-spacing: -0.6px; }
.pf-goal { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.stat { background: var(--surface); border-radius: var(--r-sm); padding: 16px 8px; text-align: center; box-shadow: var(--shadow); }
.stat b { font-size: 22px; font-weight: 800; display: block; letter-spacing: -0.8px; }
.stat span { font-size: 11px; color: var(--ink-3); margin-top: 3px; display: block; }
.menu-list { display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; letter-spacing: -0.2px; }
.menu-item:last-child { border: none; }
.menu-item .mi-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; }
.menu-item .mi-arrow { margin-left: auto; color: var(--ink-3); }
.menu-item.danger { color: var(--danger); }

.chart-wrap svg { width: 100%; height: auto; display: block; }

/* ── Loaders ──────────────────────────────────────────────────────────────── */
.loading-block { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 48px 20px; text-align: center; }
.pulse-ring { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .9s linear infinite; }
.loading-block .lb-text { font-size: 14.5px; color: var(--ink-2); font-weight: 600; }
.dots::after { content: ''; animation: dots 1.4s steps(4,end) infinite; }
@keyframes dots { 0%{content:''} 25%{content:'.'} 50%{content:'..'} 75%{content:'...'} }
.thinking { display:flex; gap:5px; padding:15px 17px; align-self:flex-start; background:var(--surface); border-radius:20px; box-shadow:var(--shadow); }
.thinking i { width:7px; height:7px; border-radius:50%; background:var(--ink-3); animation:bounce 1.2s infinite; }
.thinking i:nth-child(2){ animation-delay:.2s } .thinking i:nth-child(3){ animation-delay:.4s }
@keyframes bounce { 0%,60%,100%{transform:translateY(0);opacity:.4} 30%{transform:translateY(-5px);opacity:1} }

/* ── Toast / sheet ────────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 28px); transform: translateX(-50%) translateY(16px); background: var(--ink); color: var(--surface); padding: 13px 20px; border-radius: 15px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .3s; z-index: 90; box-shadow: var(--shadow-lg); letter-spacing: -0.2px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sheet-bg { position: fixed; inset: 0; background: rgba(8,10,18,.5); z-index: 60; opacity: 0; transition: opacity .25s; }
.sheet-bg.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 30px 30px 0 0; padding: 24px 22px calc(var(--safe-bottom) + 24px); z-index: 61; transform: translateY(100%); transition: transform .32s cubic-bezier(.22,.61,.36,1); max-width: 540px; margin: 0 auto; }
.sheet.show { transform: translateY(0); }
.sheet-handle { width: 40px; height: 4px; border-radius: 3px; background: var(--line); margin: 0 auto 20px; }
.sheet h3 { margin: 0 0 8px; font-size: 21px; font-weight: 800; letter-spacing: -0.5px; }
.sheet p { margin: 0 0 20px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }

.center { text-align: center; }
.mt { margin-top: 14px; }
.muted { color: var(--ink-3); font-size: 13px; }
.empty { padding: 40px 20px; text-align: center; }
.empty .e-ic { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 20px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); }
