/* NutriSnap — Clinical Performance */
:root {
  --bg: #0E0F0C;
  --surface: #16180F;
  --surface-2: #1D1F16;
  --ink: #F2F3EE;
  --muted: #8C8F80;
  --line: #2A2C22;
  --lime: #C7F23C;
  --lime-dim: #9bbf2e;
  --bad: #FF5A4D;
  --good: #C7F23C;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--lime); text-decoration: none; }
.num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.display {
  font-family: "Anton", "Archivo", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-weight: 400;
  line-height: 0.95;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 18px; }
.wrap-narrow { max-width: 520px; margin: 0 auto; padding: 18px; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(14,15,12,0.92);
  backdrop-filter: blur(8px); z-index: 20;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand .mark { font-family: "Anton"; font-size: 22px; text-transform: uppercase; letter-spacing: 0.02em; }
.brand .mark b { color: var(--lime); }
.brand .sub { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em; }
.nav { display: flex; gap: 6px; }
.nav a { color: var(--muted); padding: 7px 12px; border-radius: 9px; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.08em; }
.nav a.active, .nav a:hover { color: var(--bg); background: var(--lime); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--lime); color: #11130c; border: none; cursor: pointer;
  font-family: "Archivo"; font-weight: 700; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 13px 20px; border-radius: 11px; width: 100%;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.bad { background: var(--bad); color: #2a0d0a; }
.btn-sm { padding: 9px 14px; font-size: 12px; width: auto; }

/* inputs */
label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink); border-radius: 10px; padding: 13px; font-size: 16px;
  font-family: "Archivo";
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lime); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 12px; }
.grid.cols { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* score ring */
.ring { --p: 0; --c: var(--lime); position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--c); stroke-linecap: round;
  transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.ring .val b { font-family: "Anton"; font-size: 26px; line-height: 1; }
.ring .val span { font-size: 9px; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }

.grade { font-family: "Anton"; font-size: 40px; line-height: 1; }
.grade.A, .grade.B { color: var(--lime); }
.grade.C { color: #e8d44c; }
.grade.D, .grade.F { color: var(--bad); }

/* macro chips */
.macros { display: flex; gap: 10px; flex-wrap: wrap; }
.macro { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 11px; min-width: 64px; }
.macro b { display: block; font-family: "JetBrains Mono"; font-size: 17px; }
.macro span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.flag { font-size: 11px; color: var(--lime-dim); border: 1px solid var(--line);
  border-radius: 20px; padding: 3px 10px; text-transform: lowercase; }

/* client cards (dashboard) */
.client-row { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 12px; }
.client-row .meta { flex: 1; min-width: 0; }
.client-row .meta h3 { margin: 0 0 2px; font-size: 15px; }
.client-row .meta .stats { color: var(--muted); font-size: 11px; display: flex; gap: 10px; }
.client-row .meta .stats b { color: var(--ink); font-family: "JetBrains Mono"; }
/* compact ring for dashboard */
.ring-sm { --c: var(--lime); position: relative; width: 60px; height: 60px; flex: none; }
.ring-sm svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-sm .bg { stroke: var(--line); }
.ring-sm .fg { stroke: var(--c); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.ring-sm .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-sm .val b { font-family: "Anton"; font-size: 18px; line-height: 1; }
.ring-sm .val span { font-size: 8px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.pill { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 8px;
  border-radius: 20px; border: 1px solid var(--line); color: var(--muted); }
.pill.live { color: var(--lime); border-color: var(--lime-dim); }

/* meal grid thumbs */
.thumb { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .badge { position: absolute; top: 8px; right: 8px; background: rgba(14,15,12,0.82);
  font-family: "Anton"; padding: 2px 8px; border-radius: 8px; font-size: 15px; }
.thumb .verdict { position: absolute; bottom: 8px; left: 8px; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em; padding: 2px 7px; border-radius: 6px; }
.verdict.good { background: var(--lime); color: #11130c; }
.verdict.bad { background: var(--bad); color: #2a0d0a; }

/* swipe deck — fills full viewport between topbar and actions */
.review-layout {
  display: flex; flex-direction: column;
  height: 100dvh; overflow: hidden;
}
.review-layout .wrap-narrow { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.deck { position: relative; flex: 1; min-height: 0; margin-top: 10px; }

/* swipe card: fixed to deck area, flex column, photo locked at 42% */
.swipe-card {
  position: absolute; inset: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  will-change: transform; touch-action: pan-y;
}
/* Photo zone — fixed height ~42% of card */
.card-photo {
  flex: none; height: 42%;
  min-height: 140px;
  background-size: cover; background-position: center; position: relative;
}
/* Scrollable detail body */
.card-scroll-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0;
  padding: 12px 14px 10px;
}
.card-meta-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-badges { display: flex; align-items: center; gap: 6px; flex: none; }
.card-dish { font-family: "Anton"; font-size: 18px; text-transform: uppercase; line-height: 1.1; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-feedback { font-size: 13px; margin: 10px 0 0; color: var(--muted); }

.swipe-card .stamp { position: absolute; top: 20px; font-family: "Anton"; font-size: 40px;
  padding: 4px 14px; border: 4px solid; border-radius: 12px; opacity: 0; }
.stamp.good { left: 16px; color: var(--lime); border-color: var(--lime); transform: rotate(-14deg); }
.stamp.bad { right: 16px; color: var(--bad); border-color: var(--bad); transform: rotate(14deg); }

/* Coach feedback bar above swipe buttons */
.coach-bar {
  flex: none; padding: 6px 18px 4px;
  background: var(--surface); border-top: 1px solid var(--line);
}
.coach-bar-inner { display: flex; align-items: center; gap: 8px; }
.coach-note-input {
  flex: 1; font-size: 13px; padding: 7px 10px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  font-family: "Archivo"; min-width: 0;
}
.coach-note-input:focus { outline: none; border-color: var(--lime); }
.rec-pill {
  flex: none; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink); border-radius: 20px; padding: 5px 12px; font-size: 12px;
  font-family: "Archivo"; cursor: pointer; white-space: nowrap;
}
.rec-pill.recording { border-color: var(--bad); color: var(--bad); }
.rec-state { font-size: 11px; color: var(--muted); min-width: 38px; }
.rec-preview-audio { width: 100%; height: 32px; margin-top: 4px; }

.swipe-actions { display: flex; gap: 12px; padding: 8px 18px 16px; flex: none; background: var(--bg); }
.round-btn { flex: 1; height: 52px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-family: "Anton"; font-size: 17px;
  text-transform: uppercase; cursor: pointer; }
.round-btn.good { color: var(--lime); border-color: var(--lime-dim); }
.round-btn.bad { color: var(--bad); border-color: var(--bad); }

/* misc */
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty .display { font-size: 28px; color: var(--line); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--lime); color: #11130c; padding: 12px 20px; border-radius: 12px;
  font-weight: 700; z-index: 50; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }
.spinner { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--lime);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.fade-in { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.h1 { font-size: 30px; margin: 6px 0 2px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.bignum { font-family: "Anton"; font-size: 64px; line-height: 0.9; }

/* T1.2: expanded nutrient panel */
.nutrient-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.nutrient-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 10px; }
.nutrient-chip b { display: block; font-family: "JetBrains Mono"; font-size: 14px; }
.nutrient-chip span { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* T2.2: 3-part score bars */
.score-bars { margin: 12px 0; }
.score-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.score-bar-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); width: 90px; flex: none; }
.score-bar-track { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }
.score-bar-val { font-family: "JetBrains Mono"; font-size: 11px; width: 28px; text-align: right; }

/* T2.3: swap suggestion */
.swap-box { background: var(--surface-2); border: 1px solid var(--lime-dim); border-radius: 10px;
  padding: 11px 14px; margin-top: 12px; }
.swap-box .swap-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--lime-dim); margin-bottom: 4px; }
.swap-box p { margin: 0; font-size: 13px; }

/* T2.4: cooking method badge */
.method-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--muted); }
.method-badge.fried { color: var(--bad); border-color: var(--bad); }
.method-badge.grilled, .method-badge.baked, .method-badge.steamed { color: var(--lime-dim); border-color: var(--lime-dim); }

/* T2.1: item breakdown */
.items-list { margin-top: 10px; }
.item-row { display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.item-row:last-child { border-bottom: none; }
.item-row .item-name { flex: 1; }
.item-row .item-cals { font-family: "JetBrains Mono"; color: var(--muted); font-size: 12px; }

/* full-viewport pages */
.page-full {
  display: flex; flex-direction: column;
  height: 100dvh; overflow: hidden;
}
.page-full .scroll-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0;
}
.page-full .pin-bottom {
  flex: none; padding: 10px 18px 18px;
  background: linear-gradient(transparent, var(--bg) 30%);
}

/* compact client cards */
.client-card-compact { display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--line); cursor: pointer; }
.client-card-compact .meta h3 { margin: 0 0 2px; font-size: 15px; }
.client-card-compact .meta .stats { color: var(--muted); font-size: 11px; display: flex; gap: 10px; }
.client-card-compact .meta .stats b { color: var(--ink); font-family: "JetBrains Mono"; }
.client-card-compact .meta { flex: 1; min-width: 0; }

/* T1.4: compliance pill colors */
.pill.on-track { color: var(--lime); border-color: var(--lime-dim); }
.pill.watch { color: #e8d44c; border-color: #b0a030; }
.pill.off { color: var(--bad); border-color: var(--bad); }
.pill.new { color: var(--muted); border-color: var(--line); }

/* T2.5: notes thread */
.notes-thread { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.note-bubble { padding: 10px 13px; border-radius: 12px; font-size: 13px; max-width: 88%; }
.note-bubble.coach { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.note-bubble.client { background: rgba(199,242,60,0.10); border: 1px solid var(--lime-dim); align-self: flex-end; }
.note-meta { font-size: 10px; color: var(--muted); margin-top: 3px; }

/* T1.5: verdict note quick-reactions */
.reaction-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.react-btn { background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px;
  padding: 5px 12px; font-size: 18px; cursor: pointer; }
.react-btn:hover { border-color: var(--lime-dim); }
.react-note-input { flex: 1; min-width: 120px; font-size: 13px; padding: 7px 10px; border-radius: 9px; }

/* % of daily target bars */
.target-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.target-bar-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); width: 60px; flex: none; }
.target-bar-track { flex: 1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.target-bar-fill { height: 100%; background: var(--lime); border-radius: 3px; transition: width .4s; }
.target-bar-fill.over { background: var(--bad); }
.target-pct { font-family: "JetBrains Mono"; font-size: 10px; color: var(--muted); width: 38px; text-align: right; }

/* T3: coach feedback block on client side */
.coach-feedback-block {
  margin-top: 14px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.coach-fb-note { font-size: 13px; margin: 6px 0 0; }
.coach-fb-summary { font-size: 12px; color: var(--muted); margin: 6px 0 0; font-style: italic; }

/* horizontal overflow guard (one-screen mobile) */
html, body { overflow-x: hidden; max-width: 100vw; }
.page-full, .review-layout, .scroll-body, .wrap, .wrap-narrow { max-width: 100vw; overflow-x: hidden; }
.card, input, select, textarea, .btn { max-width: 100%; }
.deck { max-width: 100%; }
