/* Kalori Takip — "ayran & fıstık" theme. Light by default, follows the phone's dark mode. */

@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage-latin-ext.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f1f3ef;          /* ayran */
  --surface: #ffffff;
  --surface-2: #f6f7f4;
  --ink: #1c231f;         /* zeytin karası */
  --muted: #687169;
  --faint: #a3aba4;
  --line: #e2e6e0;
  --accent: #4c7a26;      /* fıstık */
  --accent-2: #7fae4a;
  --accent-3: #b5d38c;
  --accent-soft: #e4eed7;
  --warn-bg: #fbf0cf;
  --over: #c23350;        /* nar */
  --protein: #2e6db4;
  --carbs: #c98a12;
  --fat: #7b57a8;
  --water: #2391c0;
  --btn: #1c231f;
  --btn-ink: #ffffff;
  --seg-on: #ffffff;
  --shadow: 0 10px 30px rgba(28, 35, 31, .14);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111613;
    --surface: #1a201c;
    --surface-2: #222924;
    --ink: #e9eeea;
    --muted: #919b93;
    --faint: #5f6a62;
    --line: #2a332d;
    --accent: #a6d277;
    --accent-2: #7fae4a;
    --accent-3: #4f7a2c;
    --accent-soft: #263220;
    --warn-bg: #3a3218;
    --over: #f0697f;
    --protein: #78a9e8;
    --carbs: #e9b84e;
    --fat: #b292dc;
    --water: #5ec3ec;
    --btn: #e9eeea;
    --btn-ink: #111613;
    --seg-on: #39443d;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 400 16px/1.45 "Bricolage", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea, a { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.stack > * + * { margin-top: 12px; }
svg.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.app { max-width: 560px; margin: 0 auto; padding: calc(14px + var(--safe-t)) 18px calc(104px + var(--safe-b)); }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.page-head h1 { font-size: 30px; line-height: 1.05; font-weight: 700; font-stretch: 85%; letter-spacing: -.01em; margin: 0; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
.daynav { display: flex; gap: 6px; }
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; padding: 0;
}
.round-btn:disabled { opacity: .35; }
.round-btn svg.ic { width: 20px; height: 20px; }

/* ---------- day budget (the hero) ---------- */
.budget { margin-bottom: 26px; }
.budget .big {
  font-size: 76px; line-height: .9; font-weight: 800; font-stretch: 75%; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.budget .big.over { color: var(--over); }
.budget .caption { font-size: 17px; margin-top: 6px; }
.budget .caption b { font-weight: 600; }
.mealbar { position: relative; display: flex; height: 16px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; margin: 18px 0 8px; }
.mealbar i { height: 100%; display: block; border-right: 2px solid var(--bg); transition: width .4s ease; }
.mealbar i:last-child { border-right: 0; }
.mealbar i.m-breakfast { background: var(--accent-3); }
.mealbar i.m-lunch { background: var(--accent-2); }
.mealbar i.m-dinner { background: var(--accent); }
.mealbar i.m-snack { background: repeating-linear-gradient(135deg, var(--accent-2) 0 4px, var(--accent-3) 4px 8px); }
.mealbar i.m-over { background: var(--over); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }

.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.macro .name { font-size: 13px; color: var(--muted); }
.macro .val { font-size: 19px; font-weight: 650; font-stretch: 90%; font-variant-numeric: tabular-nums; }
.macro .val small { font-size: 13px; color: var(--muted); font-weight: 400; }
.thin { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.thin i { display: block; height: 100%; background: var(--c); border-radius: 3px; transition: width .4s ease; }

.facts { display: flex; gap: 18px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.facts b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- sections & grouped lists ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.section-title h2 { font-size: 20px; font-weight: 700; font-stretch: 88%; margin: 0; }
.section-title .aside { font-size: 14px; color: var(--muted); }

.group { background: var(--surface); border-radius: 22px; padding: 4px 16px; border: 1px solid var(--line); }
.group + .group { margin-top: 12px; }
.block { padding: 14px 0; }
.block + .block { border-top: 1px solid var(--line); }
.block-head { display: flex; align-items: center; gap: 10px; }
.block-head .title { font-weight: 650; font-size: 17px; }
.block-head .kcal { margin-left: auto; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.add-mini {
  width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.add-mini svg.ic { width: 18px; height: 18px; stroke-width: 2.2; }

.item { display: flex; align-items: center; gap: 12px; padding: 10px 0; width: 100%; background: none; border: 0; text-align: left; }
.block .item:first-of-type { margin-top: 4px; }
.item .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item .kcal { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item img.thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 12px; flex: none; }
.item + .item { border-top: 1px dashed var(--line); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.empty-note { color: var(--muted); font-size: 14px; padding: 4px 0 2px; }

.icon-btn { background: none; border: 0; color: var(--faint); padding: 6px; border-radius: 10px; display: grid; place-items: center; }
.icon-btn.on { color: var(--carbs); }
.icon-btn.danger { color: var(--over); }
.icon-btn svg.ic { width: 20px; height: 20px; }

/* water */
.glasses { display: flex; gap: 5px; flex-wrap: wrap; margin: 12px 0 14px; }
.glasses i { width: 20px; height: 28px; border: 1.5px solid var(--line); border-radius: 3px 3px 7px 7px; position: relative; overflow: hidden; }
.glasses i.full { border-color: var(--water); }
.glasses i.full::after { content: ""; position: absolute; inset: 30% 0 0; background: var(--water); }

/* ---------- buttons, inputs ---------- */
.btn {
  border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 600; font-size: 16px;
  background: var(--surface-2); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line);
}
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: transparent; }
.btn.accent { background: var(--accent); color: var(--btn-ink); border-color: transparent; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--over); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 11px; }
.btn:disabled { opacity: .45; }
.btn svg.ic { width: 19px; height: 19px; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row .btn { flex: 1; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 1px; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; border-radius: 11px; padding: 9px 4px; font-size: 14px; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--seg-on); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

label.f { display: block; font-size: 13.5px; color: var(--muted); margin: 14px 0 6px; }
/* No top gap for the very first label in a box. */
.group > label.f:first-child, .group > .grid2:first-child label.f, .sheet h3 + label.f { margin-top: 0; }
input, select, textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 14px; outline: none; font-size: 16px; /* 16px stops iOS focus zoom */
  appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid3 input, .grid4 input { text-align: center; padding: 11px 6px; }
.hint { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; }

/* switch */
.switch { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; padding: 0; text-align: left; }
.switch .track { width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch.on .track { background: var(--accent); }
.switch.on .track::after { transform: translateX(20px); }

/* choice cards (onboarding, sport question) */
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 15px 16px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); }
.choice .t { font-weight: 600; }
.choice .d { font-size: 13.5px; color: var(--muted); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice svg.ic { color: var(--accent); width: 26px; height: 26px; }

/* add screen modes */
.modes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0 18px; }
.mode { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 2px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--muted); }
.mode.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.mode svg.ic { width: 24px; height: 24px; }

.search { position: relative; }
.search svg.ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 20px; height: 20px; }
.search input { padding-left: 44px; }

/* stat line inside sheets */
.stat-line { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px; padding: 14px 0 2px; border-top: 1px solid var(--line); text-align: center; }
.stat-line b { display: block; font-size: 20px; font-weight: 650; font-stretch: 90%; font-variant-numeric: tabular-nums; }
.stat-line span { font-size: 12.5px; color: var(--muted); }

/* ---------- bottom nav ---------- */
nav.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); z-index: 10;
  width: min(calc(100% - 24px), 520px); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 26px; padding: 6px; box-shadow: var(--shadow);
}
nav.tabbar button { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--faint); font-size: 11px; font-weight: 500; border-radius: 18px; }
nav.tabbar button.on { color: var(--ink); }
nav.tabbar button.on svg.ic { stroke-width: 2.2; }
nav.tabbar button.add-tab span.plus {
  width: 50px; height: 50px; border-radius: 18px; background: var(--accent); color: var(--btn-ink); display: grid; place-items: center;
}
nav.tabbar button.add-tab svg.ic { width: 26px; height: 26px; stroke-width: 2.4; }

/* ---------- sheet ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(12, 16, 14, .45); z-index: 30; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
.sheet {
  background: var(--surface); width: 100%; max-width: 560px; border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(20px + var(--safe-b)); max-height: 90vh; overflow-y: auto; animation: rise .24s cubic-bezier(.2, .8, .2, 1);
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 21px; font-weight: 700; font-stretch: 88%; }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 0; right: 0; margin-inline: auto; width: fit-content; max-width: min(calc(100% - 32px), 480px); top: calc(12px + var(--safe-t)); background: var(--btn); color: var(--btn-ink); padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; z-index: 40; box-shadow: var(--shadow); text-align: center; animation: drop .2s ease; }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 60px 0; }
.photo-preview { width: 100%; max-height: 260px; object-fit: cover; border-radius: 18px; margin-bottom: 12px; display: block; }
#scanner { width: 100%; border-radius: 18px; overflow: hidden; }
.warn { color: var(--carbs); font-size: 13px; }
.err-box { color: var(--over); background: color-mix(in srgb, var(--over) 10%, transparent); border-radius: 14px; padding: 12px 14px; font-size: 14px; }

/* AI draft rows */
.draft-item { padding: 14px 0; }
.draft-item + .draft-item { border-top: 1px solid var(--line); }
.draft-nums { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.draft-nums input { padding: 9px 4px; text-align: center; border-radius: 10px; }
.draft-nums span { font-size: 11.5px; color: var(--muted); text-align: center; }

/* charts */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 10px; font-family: inherit; }

/* onboarding */
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.done { background: var(--accent); }
.onb h1 { font-size: 34px; line-height: 1.05; font-weight: 750; font-stretch: 82%; margin: 0 0 8px; }
.onb p.lead { color: var(--muted); margin: 0 0 22px; }
.result-big { font-size: 64px; font-weight: 800; font-stretch: 75%; line-height: .95; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* floating save bar on the profile screen */
.savebar { position: fixed; left: 0; right: 0; bottom: calc(96px + var(--safe-b)); display: flex; justify-content: center; z-index: 12; pointer-events: none; animation: rise .2s ease; }
.savebar .btn { pointer-events: auto; box-shadow: var(--shadow); padding: 14px 26px; }

/* login */
.login { max-width: 380px; margin: 0 auto; padding: calc(64px + var(--safe-t)) 20px 32px; }
.login .mark { width: 64px; height: 64px; border-radius: 20px; display: block; margin-bottom: 22px; }
.login h1 { font-size: 40px; line-height: 1; font-weight: 800; font-stretch: 78%; margin: 0 0 8px; }
.brand b { color: var(--accent); font-weight: inherit; }
.login p.site { text-align: center; color: var(--muted); font-size: 13px; margin: 22px 0 0; }
.brandbar { display: flex; align-items: center; gap: 7px; margin: 2px 0 8px; }
.brandbar img { width: 22px; height: 22px; border-radius: 7px; display: block; }
.brandbar .brand { font-size: 17px; line-height: 1; font-weight: 800; font-stretch: 78%; letter-spacing: -.01em; }
.amount-q .thumb, .amount-q .pending-ic { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; }
.amount-q .pending-ic { background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.code-input { text-align: center; font-size: 26px; font-weight: 800; letter-spacing: 10px; }
.login [hidden] { display: none !important; }
.login .linkish { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; }
.login p.lead { color: var(--muted); margin: 0 0 26px; }
.login .err { color: var(--over); font-size: 14px; min-height: 20px; margin-top: 12px; }

/* live barcode scanner */
.scanner { position: relative; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-bottom: 12px; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-guide { position: absolute; left: 5%; right: 5%; top: 25%; bottom: 25%; border: 2px solid rgba(255, 255, 255, .9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.scan-guide i { position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; background: var(--over); opacity: .85; animation: scanline 1.6s ease-in-out infinite alternate; }
@keyframes scanline { from { transform: translateY(-38px); } to { transform: translateY(38px); } }
.scan-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-size: 13.5px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

/* amount picker: pieces or grams */
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 10px; margin-top: 14px; }
.stepper button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; display: grid; place-items: center; height: 56px; }
.stepper input { text-align: center; font-size: 26px; font-weight: 700; font-stretch: 85%; height: 56px; }
.piece-line { margin: 12px 2px 0; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.piece-line .btn { color: var(--accent); padding: 4px 6px; }

/* AI entries still being worked out on the server */
.pending-row .pending-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.pending-row .name { color: var(--muted); }
.err-text { color: var(--over); white-space: normal; }
.spinner.small { width: 20px; height: 20px; border-width: 2.5px; margin: 0; flex: none; }

.section-title .aside.busy { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }

.check-note { margin: 6px 2px 0; font-size: 13.5px; color: var(--carbs); line-height: 1.4; }

.explain-toggle { margin-top: 12px; padding-left: 0; color: var(--accent); }
.explain { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.explain li + li { margin-top: 6px; }
.explain b { color: var(--ink); font-weight: 600; }
.progress-list { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.progress-list b { color: var(--ink); font-weight: 600; }

.chips.wrap { flex-wrap: wrap; overflow: visible; }
/* Pace options: always one row, equal widths, kg/week under the name */
.rate-chips { display: grid; gap: 6px; }
.rate-chips .chip { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 4px; border-radius: 14px; min-width: 0; }
.rate-chips .chip b { font-weight: 600; }
.rate-chips .chip small { font-size: 12px; opacity: .75; }

/* meal suggestions */
.sug .block:first-child { padding-top: 16px; }
.sug-title { font-weight: 650; font-size: 16.5px; }
.sug-items { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.sug-items li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.sug-items li span:last-child { color: var(--muted); }
.sug-opt.done { opacity: .6; }
.sug-state { margin: 10px 0 0; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sug-state.ok { color: var(--accent); }

/* usual meals */
.usual-row { display: flex; align-items: center; gap: 12px; padding: 10px 0 4px; }
.group > .usual-row { padding: 12px 0; }
.group > .usual-row + .usual-row { border-top: 1px solid var(--line); }
.usual-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.usual-title { font-weight: 600; font-size: 15px; }
.usual-row .meta { white-space: normal; font-size: 13px; color: var(--muted); line-height: 1.35; }

/* offline outbox, copy, streak, week summary, system status */
.outbox-bar { position: sticky; top: calc(8px + var(--safe-t)); z-index: 20; display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 11px 14px; border: 0; border-radius: 14px; background: var(--warn-bg); color: var(--ink); font: inherit; font-size: 14px; text-align: left; box-shadow: var(--shadow); }
.outbox-bar b { color: var(--accent); white-space: nowrap; }
.add-mini.ghost { background: transparent; color: var(--muted); }
.copy-row { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 0 12px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent); font: inherit; font-weight: 600; font-size: 15px; }
.copy-row svg.ic { width: 18px; height: 18px; }
.streak { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 1px 8px 1px 5px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; vertical-align: 1px; }
.streak svg.ic { width: 15px; height: 15px; }
.week { padding: 16px; }
.week-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.week-grid > div { display: flex; flex-direction: column; gap: 1px; }
.week-grid .big { font-size: 22px; font-weight: 700; font-stretch: 88%; }
.week-grid .lbl { font-size: 13.5px; color: var(--muted); }
.week-grid .good { color: var(--accent); }
.week .small svg.ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--accent); }
.status { padding: 4px 16px; }
.status-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.status-row + .status-row { border-top: 1px solid var(--line); }
.status-row .meta { white-space: normal; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--muted); }
.dot.ok { background: #2fa36b; }
.dot.warn { background: #e0a020; }
.dot.bad { background: var(--over); }
.check-note svg.ic { width: 16px; height: 16px; vertical-align: -3px; }

/* nutrition label reading */
.label-read { margin-bottom: 4px; }
.label-read .btn.disabled { opacity: .85; pointer-events: none; }
.link-row { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px; text-align: left; }
.link-row b { color: var(--accent); font-weight: 600; }
.link-row svg.ic { width: 18px; height: 18px; flex: none; color: var(--muted); }

/* coach */
.coach-card { padding: 14px 16px; }
.coach-ask { display: flex; gap: 8px; align-items: center; }
.coach-ask input { flex: 1; min-width: 0; }
.send-btn { flex: none; width: 46px; height: 46px; border-radius: 14px; border: 0; background: var(--btn); color: var(--btn-ink); display: grid; place-items: center; }
.send-btn:disabled { opacity: .35; }
.send-btn svg.ic { width: 20px; height: 20px; }
.send-btn.mic { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.send-btn.mic.on { background: var(--over); color: #fff; box-shadow: none; animation: listen 1.4s infinite ease-in-out; }
@keyframes listen { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--over) 45%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.coach-chips { margin-top: 12px; }
.coach-chips .chip { font-size: 13.5px; padding: 7px 12px; display: inline-flex; align-items: center; gap: 5px; }
.coach-chips .chip.quick svg.ic { width: 14px; height: 14px; color: var(--accent); stroke-width: 2.4; }
/* full-screen chat: header and input stay put, only the messages scroll */
.coach-screen { position: fixed; inset: 0; z-index: 20; max-width: 560px; margin: 0 auto; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.coach-head { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 18px 10px; border-bottom: 1px solid var(--line); }
.coach-head h1 { font-size: 24px; font-weight: 700; font-stretch: 85%; margin: 0; }
.coach-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 10px; padding: 14px 18px; }
.coach-empty { background: var(--surface); border-radius: 18px; padding: 16px; font-size: 15px; line-height: 1.45; }
.coach-empty p { margin: 0; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 88%; padding: 11px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--btn); color: var(--btn-ink); border-bottom-right-radius: 6px; }
.msg.coach .bubble { background: var(--surface); border-bottom-left-radius: 6px; box-shadow: 0 1px 0 var(--line); }
.msg .bubble p { margin: 0 0 6px; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg .bubble ul { margin: 2px 0 6px; padding-left: 18px; }
.msg .bubble li { margin: 2px 0; }
.bubble.typing { display: flex; align-items: center; gap: 10px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.coach-add { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.coach-add ul { list-style: none; padding: 0; margin: 0; }
.coach-add li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 2px 0; }
.coach-input { flex: none; background: var(--bg); padding: 10px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.coach-input .coach-chips { margin: 0 0 10px; }
.coach-add .row { flex-wrap: wrap; row-gap: 8px; } .coach-add .row .grow { min-width: 140px; }
.coach-list > * { flex-shrink: 0; }

/* camera + gallery buttons */
.photo-btns { display: flex; gap: 10px; }
.photo-btns .btn { flex: 1; min-width: 0; justify-content: center; }
.photo-btns .btn.disabled { opacity: .85; pointer-events: none; }

/* goal weight */
.goal { padding: 16px; }
.goal .big { font-size: 26px; font-weight: 700; font-stretch: 88%; }
.goal-sug { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; }
.goal-left { display: flex; flex-direction: column; align-items: flex-end; font-size: 18px; }
.goal-badge { background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; padding: 4px 10px; border-radius: 99px; }
.goal-bar { height: 10px; border-radius: 99px; background: var(--surface-2); margin: 12px 0 6px; overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.goal-eta { margin: 10px 0 0; padding-left: 18px; font-size: 14px; }
.goal-eta li { margin: 2px 0; }
.goal.reached { text-align: left; }
.goal-cheer { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.goal-line { display: flex; align-items: center; gap: 8px; width: 100%; margin: 10px 0 0; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14.5px; text-align: left; }
.goal-line svg.ic { width: 18px; height: 18px; color: var(--muted); flex: none; }

/* management panel (admins) */
.admin-entry { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-align: left; }
.admin-entry .ic-wrap { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.admin-entry svg.ic { width: 20px; height: 20px; }
.admin-entry > svg.ic { color: var(--muted); }
.admin-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; margin: calc(-14px - var(--safe-t)) -18px 0; padding: calc(10px + var(--safe-t)) 18px 10px; background: var(--bg); }
.admin-head h1 { font-size: 24px; font-weight: 700; font-stretch: 85%; margin: 0; }
.admin-head .lock-on { color: var(--accent); gap: 6px; }
.admin-head .lock-on svg.ic { width: 16px; height: 16px; }
.admin-tabs { margin: 0 -18px 16px; padding: 2px 18px 4px; }
.admin-tabs .chip { padding: 7px 13px; font-size: 13.5px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-align: left; min-width: 0; }
.stat:disabled { opacity: 1; cursor: default; }
.stat .v { font-size: 24px; font-weight: 700; font-stretch: 88%; line-height: 1.1; overflow-wrap: anywhere; }
.stat .l { font-size: 13px; color: var(--muted); }
.stat .s { font-size: 12px; color: var(--faint); }
.stat.warn .v { color: var(--over); }
.quota { height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin-top: 8px; }
.quota i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.quota i.high { background: var(--carbs); }
.quota i.full { background: var(--over); }
.ev { padding: 11px 0; }
.ev + .ev, .group > div + div > .ev { border-top: 1px solid var(--line); }
.ev-detail { margin-top: 3px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 7.5em; overflow: hidden; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-bg); color: #8a6200; }
.badge.bad { background: color-mix(in srgb, var(--over) 14%, transparent); color: var(--over); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.avatar.big { width: 54px; height: 54px; font-size: 22px; }
button.list-row { width: 100%; background: none; border: 0; text-align: left; padding: 13px 0; }
button.list-row > svg.ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
button.list-row:disabled { opacity: .5; }
.list-row.danger, .list-row.danger > svg.ic { color: var(--over); }
.user-row .tiny { margin-top: 2px; }
.user-head { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
.user-head h2 { margin: 0; font-size: 24px; font-weight: 700; font-stretch: 88%; }
.day-nav .round-btn { width: 34px; height: 34px; }
.day-meal { padding: 8px 0 2px; }
.day-meal + .day-meal { border-top: 1px solid var(--line); }
.day-meal .row { padding: 2px 0; }
.admin-chat { padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.admin-actions svg.ic { color: var(--muted); }
.btn.danger-fill { background: var(--over); color: #fff; border-color: transparent; }
.temp-pw { margin: 16px 0 4px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line); font-size: 26px; font-weight: 700; letter-spacing: .08em; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; user-select: all; }
.invite { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.invite .code { flex: 1; min-width: 110px; font-size: 22px; font-weight: 700; letter-spacing: .12em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.table { padding: 4px 14px; }
.table .tr { display: grid; grid-template-columns: 1.1fr 1fr .8fr .9fr; gap: 8px; padding: 10px 0; font-size: 14px; align-items: baseline; }
.table .tr + .tr { border-top: 1px solid var(--line); }
.table .th { font-size: 12.5px; color: var(--muted); }
.table em { font-style: normal; font-size: 12px; }
.table em.bad, .bad { color: var(--over); }
.kv .list-row { font-size: 14px; padding: 11px 0; align-items: flex-start; }
.kv .list-row .grow { overflow-wrap: anywhere; }
.pause-card.paused { border-color: var(--over); background: color-mix(in srgb, var(--over) 7%, var(--surface)); }

/* announcement from the admin, on top of Today */
.announce { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 12px 10px 12px 14px; border-radius: 16px; background: var(--accent-soft); color: var(--ink); font-size: 14.5px; line-height: 1.4; }
.announce > svg.ic { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }
.announce .x { border: 0; background: none; padding: 2px; color: var(--muted); flex: none; }
.announce .x svg.ic { width: 18px; height: 18px; }

/* panel: signs of bots or attacks */
.alert { display: flex; align-items: flex-start; gap: 10px; width: 100%; margin: 0 0 10px; padding: 12px 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--over) 35%, transparent); background: color-mix(in srgb, var(--over) 8%, var(--surface)); text-align: left; }
.alert svg.ic { width: 18px; height: 18px; color: var(--over); flex: none; margin-top: 2px; }
.alert b { color: var(--over); }

/* "turn on notifications?" sheet shown when the app opens */
.notify-ask { text-align: center; padding: 4px 6px 0; }
.notify-ask .ic-wrap { width: 54px; height: 54px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; margin-bottom: 10px; }
.notify-ask .ic-wrap svg.ic { width: 26px; height: 26px; }
.notify-ask h3 { margin-bottom: 6px; }

/* weight screen */
.weight-now { padding: 16px; }
.weight-now .big { font-size: 34px; font-weight: 700; font-stretch: 85%; line-height: 1.05; }
.weight-now .big small { font-size: 16px; font-weight: 600; color: var(--muted); }
.wn-chip { display: inline-flex; flex-direction: column; align-items: flex-end; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); font-weight: 700; font-size: 15px; }
.wn-chip small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.wn-chip.good { background: var(--accent-soft); color: var(--accent); }
.wn-chip.bad { background: color-mix(in srgb, var(--over) 10%, transparent); color: var(--over); }
.wn-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.wn-stats > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wn-stats b { font-size: 14.5px; }
.date-chip { position: relative; overflow: hidden; display: inline-flex; align-items: center; cursor: pointer; }
.date-chip input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; }
.chart-legend { display: flex; gap: 14px; margin: 6px 4px 0; align-items: center; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); background: var(--surface); }
.lg-line { width: 16px; height: 3px; border-radius: 2px; background: var(--accent); }
.lg-dash { width: 16px; height: 0; border-top: 2px dashed var(--carbs); }
.weigh-row .diff { min-width: 44px; text-align: right; color: var(--muted); }
.weigh-row .diff.down { color: var(--accent); }
.weigh-row .diff.up { color: var(--carbs); }
.linkish { border: 0; background: none; padding: 0; color: inherit; font: inherit; display: inline-flex; align-items: center; gap: 4px; text-decoration: underline dotted; text-underline-offset: 3px; }
.linkish svg.ic { width: 12px; height: 12px; }

/* unknown barcode: one step, photograph the nutrition table */
.label-first { padding: 20px 16px; text-align: center; }
.label-first .ic-wrap { width: 54px; height: 54px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; margin-bottom: 10px; }
.label-first .ic-wrap svg.ic { width: 26px; height: 26px; }
.label-first h3 { margin: 0; font-size: 20px; font-weight: 700; font-stretch: 88%; }
.label-first .check-note { text-align: left; }

/* supplements checklist on Today */
.supp-card { padding: 14px 16px; margin-top: 12px; }
.supp-list { display: grid; gap: 6px; margin-top: 8px; }
.supp { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 0; border: 0; background: none; text-align: left; font-size: 14.5px; }
.supp .box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.supp.on .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.supp .box svg.ic { width: 15px; height: 15px; stroke-width: 3; }
.supp.on > .grow > span:first-child { color: var(--muted); text-decoration: line-through; }

/* gym section */
.gym-today { padding: 16px; }
.gym-day-name { font-size: 26px; font-weight: 700; font-stretch: 85%; line-height: 1.15; }
.gym-start { margin-top: 14px; padding: 14px; font-size: 17px; }
.gym-day { padding: 0 16px; margin-top: 10px; }
.gym-day.today { border-color: var(--accent); }
.gym-day-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 0; border: 0; background: none; text-align: left; }
.gym-day-head svg.ic { width: 18px; height: 18px; color: var(--muted); }
.gym-items { border-top: 1px solid var(--line); }
.gym-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 14.5px; }
.gym-item + .gym-item { border-top: 1px solid var(--line); }
.gym-next { font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 8px; }
.gym-writing { padding: 32px 16px; text-align: center; }
.gym-writing h3 { margin: 14px 0 4px; }
.gym-edit-day { padding: 14px 16px; margin-top: 12px; }
.gym-edit-item { padding: 10px 0; border-top: 1px solid var(--line); }
.gym-edit-item .row + .row { margin-top: 6px; }
input.mini { padding: 6px 4px; text-align: center; border-radius: 9px; font-size: 14px; }
.chip.sm { padding: 6px 11px; font-size: 13px; }
.picker-list { max-height: 50vh; overflow-y: auto; }
.records { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); }

/* workout mode */
.workout { padding-bottom: 90px; }
.workout-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; margin: calc(-14px - var(--safe-t)) -18px 0; padding: calc(10px + var(--safe-t)) 18px 10px; background: var(--bg); }
.workout-ex { margin: 4px -18px 12px; padding: 2px 18px 4px; }
.workout-ex .chip { font-size: 13px; padding: 7px 12px; }
.workout-ex .chip.done:not(.on) { color: var(--accent); border-color: var(--accent-3); }
.workout-card { padding: 16px; }
.workout-card h2 { margin: 0; font-size: 22px; font-weight: 700; font-stretch: 88%; }
.next-hint { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); font-size: 13.5px; }
.sets { margin-top: 12px; }
.set-row { display: grid; grid-template-columns: 26px 1fr 1fr 46px; gap: 8px; align-items: center; padding: 6px 0; }
.set-row.th { padding: 0 0 2px; }
.set-row.done .stepper input { color: var(--muted); }
.set-no { font-weight: 700; color: var(--muted); text-align: center; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; min-width: 0; }
.stepper button { border: 0; background: none; width: 32px; height: 42px; font-size: 20px; color: var(--ink); flex: none; }
.stepper input { border: 0; background: none; padding: 0; text-align: center; font-weight: 700; font-size: 17px; min-width: 0; border-radius: 0; }
.set-check { width: 46px; height: 42px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--faint); }
.set-check.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.set-check svg.ic { width: 22px; height: 22px; stroke-width: 2.6; }
.rest-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 12px 18px calc(12px + var(--safe-b)); background: var(--btn); color: var(--btn-ink); overflow: hidden; }
.rest-bar .rest-fill { position: absolute; left: 0; top: 0; height: 3px; background: var(--accent-3); transition: width .5s linear; }
.rest-bar .grow { display: flex; align-items: baseline; gap: 8px; }
.rest-bar b { font-size: 24px; }
.rest-bar .btn { background: rgba(255,255,255,.12); color: inherit; border-color: transparent; }
.in-workout .tabbar { display: none; }
.stepper input::placeholder { color: var(--faint); font-weight: 500; }

/* gym: hero, photos, muscles, body map, swap, live pill */
.gym-hero { margin-top: 4px; padding: 18px; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #3f6b1f 0%, #6f9c3a 100%); box-shadow: var(--shadow); }
.gym-hero .tiny { opacity: .8; }
.gym-hero .small { opacity: .9; }
.gym-hero.live { display: block; width: 100%; border: 0; text-align: left; }
.gym-hero.done { background: linear-gradient(135deg, #2f7a55 0%, #5aa77d 100%); }
.gym-hero.rest { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.gym-hero.rest .tiny, .gym-hero.rest .small { opacity: 1; color: var(--muted); }
.gym-hero .gym-start { background: #fff; color: #2f5214; border-color: transparent; margin-top: 14px; padding: 14px; font-size: 17px; font-weight: 700; }
.gym-hero .muscle-chips .mchip { background: rgba(255,255,255,.18); color: #fff; }
.muscle-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mchip { font-size: 12.5px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.mchip.p { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ex-photo { position: relative; aspect-ratio: 3 / 2; border-radius: 14px; overflow: hidden; background: #fff; margin: 0 0 12px; max-height: 190px; width: 100%; }
.ex-photo.big { max-height: none; margin: 0; }
.ex-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ex-photo img.b { animation: exfade 2.6s ease-in-out infinite; }
@keyframes exfade { 0%, 35% { opacity: 0; } 50%, 85% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ex-photo img.b { animation: none; opacity: 0; } }
.ex-photo-btn { display: block; width: 100%; padding: 0; border: 0; background: none; }
.ex-thumb { width: 46px; height: 46px; border-radius: 11px; object-fit: cover; flex: none; background: #fff; }
.ex-thumb.none { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.gym-item { width: 100%; border: 0; background: none; text-align: left; color: inherit; }
.ex-steps { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; }
.swap-pick { display: grid; gap: 8px; margin-top: 10px; }
.muscle-card { padding: 14px 16px; }
.body-map { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 14px auto 4px; max-width: 320px; }
.body-svg { width: 100%; height: auto; }
.body-svg polygon { stroke: var(--bg); stroke-width: 6; transition: fill .3s; }
.lv-base { fill: var(--surface-2); }
.lv-none { fill: var(--line); }
.lv-low { fill: #e8b74a; }
.lv-good { fill: var(--accent); }
.lv-high { fill: var(--over); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.lv-none { background: var(--line); } .legend i.lv-low { background: #e8b74a; }
.legend i.lv-good { background: var(--accent); } .legend i.lv-high { background: var(--over); }
.live-pill { position: fixed; left: 12px; right: 12px; bottom: calc(84px + var(--safe-b)); z-index: 24; max-width: 536px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 0; border-radius: 16px; background: var(--btn); color: var(--btn-ink); box-shadow: var(--shadow); font-size: 14px; text-align: left; }
.live-pill .pulse { width: 9px; height: 9px; border-radius: 50%; background: #7ed957; flex: none; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(126,217,87,.6); } 70% { box-shadow: 0 0 0 8px rgba(126,217,87,0); } 100% { box-shadow: 0 0 0 0 rgba(126,217,87,0); } }
.live-pill .go { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; }
.live-pill .go svg.ic { width: 16px; height: 16px; }

/* photos in the coach chat */
.photo-btn { cursor: pointer; }
.msg-photo { display: block; max-width: 220px; max-height: 260px; border-radius: 12px; margin: -3px -6px 8px; object-fit: cover; }
.msg-photo:only-child { margin-bottom: -3px; }
.photo-chip { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 6px 6px 6px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.photo-chip img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }

/* gym stage 2 */
.gym-week { margin: 10px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.gym-week small { font-size: 11.5px; font-weight: 600; }
.gym-week small.up { color: var(--accent); }
.gym-week small.down { color: var(--carbs); }
.cycle-note { margin: 10px 2px 0; font-size: 13.5px; color: var(--muted); }

/* Spor card on Today */
.gym-card { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 14px 14px 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); text-align: left; }
.gym-card .ic-wrap { width: 40px; height: 40px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.gym-card .ic-wrap svg.ic { width: 21px; height: 21px; }
.gym-card.live { border-color: var(--accent); background: var(--accent-soft); }
.gym-card-go { display: inline-flex; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.gym-card-go svg.ic { width: 16px; height: 16px; }
.gym-head { align-items: center; justify-content: flex-start; }

/* "how many calories?" photo check on Today */
.quick-check { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--accent-3); border-radius: 16px; background: var(--surface); cursor: pointer; }
.quick-check > svg.ic { width: 20px; height: 20px; color: var(--accent); flex: none; }
.quick-check > svg.ic:last-of-type { color: var(--muted); width: 16px; height: 16px; }
.qc-total { margin-top: 10px; font-size: 15px; }
.qc-total .num { font-size: 34px; font-weight: 700; font-stretch: 85%; }
.qc-items { list-style: none; padding: 0; margin: 8px 0 0; }
.qc-items li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14.5px; border-top: 1px solid var(--line); }
.qc-budget { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.qc-budget.over { background: color-mix(in srgb, var(--over) 10%, transparent); }

/* "add to home screen" banner (app and login page) */
.install-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 10px 12px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14.5px; }
.install-banner[hidden] { display: none; }
.login .install-banner { margin: 16px 0 0; text-align: left; }
.install-banner img { width: 42px; height: 42px; border-radius: 10px; flex: none; }
.install-banner .x { border: 0; background: none; padding: 4px; color: var(--muted); flex: none; }
.install-banner .x svg.ic { width: 18px; height: 18px; }
.share-ic svg.ic { width: 15px; height: 15px; vertical-align: -2px; color: var(--accent); }
.install-banner [hidden] { display: none; }
