/* ================= tokens ================= */
:root {
  --bg: #f4f4f1;
  --card: #ffffff;
  --card-2: #f0f0ec;
  --ink: #15161a;
  --ink-2: #3a3c43;
  --muted: #7b7e86;
  --line: #e6e6e1;
  --inverse: #ffffff;
  --shadow: 0 1px 2px rgba(20, 20, 15, 0.04), 0 8px 24px rgba(20, 20, 15, 0.05);
  --scrim: rgba(12, 12, 14, 0.38);

  --energy: #ff6a2b;
  --protein: #5b5cf0;
  --carbs: #f2b200;
  --fat: #e2508f;
  --steps: #19b360;
  --water: #1aa3e8;
  --sleep: #8b62f2;
  --heart: #e5484d;
  --body: #15161a;
  --danger: #e5484d;
  --good: #19b360;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Inter, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e11;
    --card: #17181c;
    --card-2: #1f2025;
    --ink: #f3f3f0;
    --ink-2: #c9cacd;
    --muted: #8a8c93;
    --line: #26272d;
    --inverse: #0d0e11;
    --shadow: none;
    --scrim: rgba(0, 0, 0, 0.6);
    --body: #f3f3f0;
    --protein: #7c7dff;
    color-scheme: dark;
  }
}

/* ================= base ================= */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 600; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--energy); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= layout ================= */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.page {
  /* Extra room below the status bar: phones fade/dim the area just under it. */
  padding: calc(var(--safe-t) + 28px) 16px calc(var(--tab-h) + var(--safe-b) + 28px);
  animation: fade 0.18s ease-out;
}
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; margin-bottom: 8px; }
.topbar h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.topbar .sub { font-size: 14px; color: var(--muted); font-weight: 500; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.section-title h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.section-title .link { font-size: 15px; color: var(--muted); font-weight: 500; }

/* ================= tab bar ================= */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.8) blur(18px);
  -webkit-backdrop-filter: saturate(1.8) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar-inner { max-width: 560px; margin: 0 auto; display: flex; height: var(--tab-h); }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; letter-spacing: 0.01em;
}
.tab svg { width: 25px; height: 25px; }
.tab.active { color: var(--ink); }

/* ================= cards ================= */
.card { background: var(--card); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.card.tight { padding: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card-label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.card-label svg { width: 16px; height: 16px; }
.big-num { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.mid-num { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.unit { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.tile { background: var(--card); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); text-align: left; display: flex; flex-direction: column; gap: 10px; min-height: 128px; position: relative; }
button.tile:active, .press:active { transform: scale(0.98); }
.tile .bar { margin-top: auto; }

.list { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; text-align: left; min-height: 56px; }
.list-item + .list-item { border-top: 1px solid var(--line); }
button.list-item:active { background: var(--card-2); }
.list-item .meta { font-size: 13px; color: var(--muted); }
.list-item .chev { color: var(--muted); width: 18px; height: 18px; flex-shrink: 0; }

/* ================= buttons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 999px; font-weight: 650; font-size: 16px;
  background: var(--ink); color: var(--inverse); transition: transform 0.08s, opacity 0.15s; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.block { width: 100%; }
.btn.soft { background: var(--card-2); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.small { height: 38px; padding: 0 16px; font-size: 14px; }
.btn svg { width: 20px; height: 20px; }

.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); flex-shrink: 0; }
.icon-btn.plain { background: transparent; box-shadow: none; }
.icon-btn.dark { background: var(--ink); color: var(--inverse); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: scale(0.94); }

.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--inverse); display: grid; place-items: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.avatar.sm { width: 36px; height: 36px; font-size: 14px; }
.avatar.soft { background: var(--card-2); color: var(--ink); }

.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.chip.active { background: var(--ink); color: var(--inverse); box-shadow: none; }
.chip svg { width: 16px; height: 16px; }

.segmented { display: flex; background: var(--card-2); border-radius: 14px; padding: 3px; gap: 2px; }
.segmented button { flex: 1; height: 36px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--muted); }
.segmented button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

/* ================= progress ================= */
.bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; transition: width 0.5s cubic-bezier(.2,.8,.2,1); }
.bar.thin { height: 6px; }

.ring-wrap { position: relative; display: grid; place-items: center; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-wrap circle { transition: stroke-dashoffset 0.7s cubic-bezier(.2,.8,.2,1); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

.macro { display: grid; gap: 6px; }
.macro .row { gap: 6px; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ================= forms ================= */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 52px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card);
  padding: 0 14px; font-size: 17px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; -webkit-appearance: none; appearance: none;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
.input-wrap { position: relative; }
.input-wrap .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: 15px; pointer-events: none; }
.input-wrap .input { padding-right: 56px; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237b7e86' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.error { color: var(--danger); font-size: 14px; font-weight: 500; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.45; }

.toggle { position: relative; width: 51px; height: 31px; flex-shrink: 0; }
.toggle input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background 0.2s; }
.toggle i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: transform 0.2s; }
.toggle input:checked + i { background: var(--good); }
.toggle input:checked + i::after { transform: translateX(20px); }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .input { text-align: center; font-weight: 700; font-size: 22px; }

/* ================= sheet (bottom drawer) ================= */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 50; animation: scrim-in 0.2s ease-out; }
@keyframes scrim-in { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; margin: 0 auto; max-width: 560px;
  background: var(--bg); border-radius: 26px 26px 0 0; max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column; animation: sheet-in 0.28s cubic-bezier(.2,.9,.25,1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet-grip { width: 38px; height: 5px; background: var(--line); border-radius: 99px; margin: 8px auto 0; flex-shrink: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px 10px 20px; flex-shrink: 0; }
.sheet-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.sheet-body { overflow-y: auto; padding: 4px 16px 16px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); flex-shrink: 0; display: flex; gap: 10px; background: var(--bg); }
.sheet.full { top: 0; max-height: none; border-radius: 0; padding-top: calc(var(--safe-t) + 16px); }

/* ================= toast ================= */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); transform: translateX(-50%); z-index: 90;
  background: var(--ink); color: var(--inverse); padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600;
  max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); animation: toast-in 0.25s ease-out;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ================= date nav ================= */
.datenav { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.datenav button.arrow { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.datenav button.arrow svg { width: 20px; height: 20px; }
.datenav button.arrow:disabled { opacity: 0.25; }
.datenav .label { font-weight: 650; font-size: 15px; position: relative; padding: 8px 12px; }
.datenav .label input { position: absolute; inset: 0; opacity: 0; width: 100%; }

/* ================= specific ================= */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; margin: 0 auto 10px; display: block; opacity: 0.6; }
.empty p { font-size: 15px; }

.hero { display: flex; gap: 18px; align-items: center; }
.hero .macros { flex: 1; display: grid; gap: 14px; }

.food-item .kj { font-weight: 600; font-variant-numeric: tabular-nums; }
.meal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.meal-head h3 { font-size: 16px; font-weight: 650; }
.meal-add { color: var(--muted); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 4px; padding: 6px 0 6px 10px; }
.meal-add svg { width: 18px; height: 18px; }

.note-card { background: var(--ink); color: var(--inverse); border-radius: var(--r-lg); padding: 18px; }
.note-card .card-label { color: color-mix(in srgb, var(--inverse) 65%, transparent); }

.type-badge { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.type-badge svg { width: 22px; height: 22px; }

.set-row { display: grid; grid-template-columns: 34px 1fr 1fr 36px; gap: 8px; align-items: center; }
.set-row .input { height: 44px; text-align: center; font-size: 16px; padding: 0 6px; }
.set-row .idx { font-weight: 700; color: var(--muted); text-align: center; font-size: 14px; }
.exercise-card { background: var(--card); border-radius: var(--r-md); padding: 14px; display: grid; gap: 10px; border: 1px solid var(--line); }

.metric-tile { background: var(--card); border-radius: var(--r-md); padding: 12px; text-align: left; box-shadow: var(--shadow); border: 2px solid transparent; min-width: 0; }
.metric-tile.active { border-color: var(--ink); }
.metric-tile .lbl { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-tile .val { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; }
.delta { font-size: 13px; font-weight: 600; }
.delta.down { color: var(--good); }
.delta.up { color: var(--energy); }
.delta.flat { color: var(--muted); }
.delta.good { color: var(--good); }
.delta.bad { color: var(--energy); }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--r-md); overflow: hidden; }
.photo-cell { position: relative; aspect-ratio: 3 / 4; background: var(--card-2); overflow: hidden; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-cell .tag { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,0.55); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 8px; text-transform: capitalize; backdrop-filter: blur(6px); }
.photo-cell .pick { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,0.25); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; }
.photo-cell.picked .pick { background: var(--ink); border-color: var(--inverse); }
.photo-cell.picked img { opacity: 0.75; }

.compare { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: var(--r-md); overflow: hidden; background: #000; touch-action: none; user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .after { clip-path: inset(0 0 0 var(--pos)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; background: #fff; transform: translateX(-50%); box-shadow: 0 0 8px rgba(0,0,0,0.4); }
.compare .handle::after { content: '‹ ›'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: 2px; }
.compare .lbl { position: absolute; top: 10px; background: rgba(0,0,0,0.55); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; }

.viewer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.viewer img { flex: 1; object-fit: contain; min-height: 0; width: 100%; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-t) + 10px) 14px 10px; color: #fff; }
.viewer-bar.bottom { padding: 12px 14px calc(var(--safe-b) + 14px); }
.viewer .icon-btn { background: rgba(255,255,255,0.14); color: #fff; box-shadow: none; }

/* scanner */
.scanner { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; display: flex; flex-direction: column; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 50%; top: 42%; width: min(78vw, 340px); height: 170px; transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); }
.scanner .frame::before { content: ''; position: absolute; inset: 0; border-radius: 22px; border: 3px solid #fff; }
.scanner .frame::after { content: ''; position: absolute; left: 18px; right: 18px; top: 50%; height: 2px; background: var(--energy); box-shadow: 0 0 12px var(--energy); animation: scanline 1.8s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { transform: translateY(-60px); } 50% { transform: translateY(60px); } }
.scanner .top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-t) + 12px) 16px; }
.scanner .bottom { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 20px 16px calc(var(--safe-b) + 22px); display: grid; gap: 12px; }
.scanner .icon-btn { background: rgba(255,255,255,0.16); color: #fff; box-shadow: none; }
.scanner .msg { text-align: center; font-weight: 600; font-size: 15px; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.scanner .btn.soft { background: rgba(255,255,255,0.16); color: #fff; }
.scanner .input { background: rgba(255,255,255,0.95); color: #111; border: 0; }

.nutri-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.nutri-table td { padding: 9px 0; border-top: 1px solid var(--line); }
.nutri-table td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.code-box { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 26px; font-weight: 700; letter-spacing: 0.12em; }

.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 24px); max-width: 440px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 36px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: #15161a; box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; }
.brand-mark svg { width: 24px; height: 24px; }
.brand b { font-size: 20px; letter-spacing: -0.01em; }
.auth h1 { font-size: 32px; letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 8px; }

.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick button { border-radius: var(--r-md); padding: 14px; text-align: left; background: var(--card); border: 2px solid var(--line); display: grid; gap: 4px; }
.role-pick button.active { border-color: var(--ink); }
.role-pick b { font-size: 15px; }
.role-pick span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

.share-grid { display: grid; gap: 0; }
.share-grid .row { padding: 10px 0; border-top: 1px solid var(--line); }
.share-grid .row:first-child { border-top: 0; }

.client-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 3px; }
.client-stats b { color: var(--ink); font-weight: 650; }

.week-dots { display: flex; justify-content: space-between; gap: 6px; }
.week-dots > div { flex: 1; display: grid; gap: 6px; justify-items: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.week-dots i { width: 100%; max-width: 34px; aspect-ratio: 1; border-radius: 10px; background: var(--card-2); display: block; }
.week-dots i.on { background: var(--ink); }
.week-dots .today { color: var(--ink); }

.banner { background: var(--card-2); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; }
.banner svg { width: 18px; height: 18px; flex-shrink: 0; }

@media (min-width: 600px) {
  .page { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- day picker, feeling, admin ---- */
.day-picker { display: flex; gap: 6px; justify-content: space-between; }
.day-picker button { flex: 1; max-width: 42px; aspect-ratio: 1; border-radius: 50%; background: var(--card-2); color: var(--muted); font-weight: 700; font-size: 14px; }
.day-picker button.on { background: var(--ink); color: var(--inverse); }
.day-picker button:disabled { opacity: 0.5; }
.time-input { width: auto; min-width: 130px; padding: 0 12px; height: 44px; font-size: 17px; font-weight: 650; text-align: center; }

.feel-row { display: flex; justify-content: space-between; gap: 6px; }
.feel-row button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 10px 0 8px; border-radius: var(--r-md); background: var(--card); border: 2px solid transparent; font-size: 11px; font-weight: 600; color: var(--muted); }
.feel-row button span { font-size: 28px; line-height: 1.1; filter: grayscale(0.6); opacity: 0.75; transition: transform 0.15s; }
.feel-row button.on { border-color: var(--ink); color: var(--ink); }
.feel-row button.on span { filter: none; opacity: 1; transform: scale(1.12); }
.range { width: 100%; accent-color: var(--ink); height: 32px; }
.range.unset { opacity: 0.4; }
.feel-badge { font-size: 20px; line-height: 1; }

.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; background: var(--card-2); padding: 10px 12px; border-radius: 10px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--card-2); font-size: 12px; font-weight: 650; color: var(--ink-2); }
.badge.dark { background: var(--ink); color: var(--inverse); }

/* ---- progress photo slots ---- */
.photo-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-slot { position: relative; }
.photo-slot .photo-cell { display: block; }
.photo-slot .photo-cell.empty { background: var(--card); border: 2px dashed var(--line); }
.slot-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.slot-clear { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; display: grid; place-items: center; z-index: 2; }

/* ---- measurement list (scale order) ---- */
.m-list { background: var(--card); border-radius: var(--r-md); padding: 2px 14px; }
.m-row { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 6px 0; }
.m-row + .m-row { border-top: 1px solid var(--line); }
.m-num { width: 22px; height: 22px; border-radius: 50%; background: var(--card-2); color: var(--muted); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.m-input { width: 140px; flex-shrink: 0; }
.m-input .input { height: 46px; text-align: right; padding-right: 52px; }
.m-auto { font-size: 19px; font-weight: 700; min-width: 70px; text-align: right; }
