/*
 * Design tokens for dumb food log, per the design handoff
 * (design_handoff_dumb_food_log/README.md). Recreated pixel-close —
 * see that doc for the source of truth on any value here.
 */

@font-face {
  font-family: "Archivo Black";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("/assets/archivo-black-e6dca12e.woff2") format("woff2");
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/figtree-variable-f7c28c58.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/figtree-variable-f7c28c58.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/figtree-variable-f7c28c58.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/figtree-variable-f7c28c58.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/figtree-variable-f7c28c58.woff2") format("woff2");
}

:root {
  /* Paper */
  --paper-outer: #EFE7D4;
  --paper: #FBF6EC;
  --paper-alt: #EDE4D0;

  /* Ink */
  --ink: #2B2118;
  --ink-soft: #6B5D4F;
  --ink-faint: #9B8F7F;

  /* Lines */
  --line: #DCD2BC;
  --line-light: #E3D9C4;
  --line-faint: #C9BFAE;

  /* Tomato */
  --tomato: #E8543C;
  --tomato-dark: #C43D28;

  /* Mustard */
  --mustard: #F0AE0F;
  --mustard-soft: #FCE9B0;
  --mustard-text: #8A6A16;
  --mustard-text-strong: #5C4A1E;

  /* Avocado */
  --avocado: #6E8F4C;
  --avocado-soft: #E4EBD8;
  --avocado-text: #4A6234;

  /* Denim */
  --denim: #4C6E8F;

  /* Meal colors */
  --meal-breakfast: var(--mustard);
  --meal-snack: var(--avocado);
  --meal-lunch: var(--denim);
  --meal-dinner: var(--tomato);
  --meal-other: var(--ink-soft);

  /* Type */
  --font-display: "Archivo Black", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, sans-serif;

  /* Radii */
  --radius-input: 10px;
  --radius-card: 14px;
  --radius-card-lg: 18px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-card: 0 6px 0 rgba(43, 33, 24, 0.15);
}

* { box-sizing: border-box; }

html, body {
  background: var(--paper-outer);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button, input, select, textarea { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--denim);
  outline-offset: 2px;
  border-radius: 4px;
}

/* App shell: a phone-width column on all viewports, growing into more
   horizontal breathing room on larger screens rather than a separate
   desktop layout. */
.app-shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (min-width: 640px) {
  html, body { background: var(--paper-outer); }
  .app-shell {
    min-height: calc(100vh - 48px);
    margin: 24px auto;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(43, 33, 24, 0.18);
    overflow: hidden;
  }
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 28px;
}

.app-main--with-tabbar {
  padding-bottom: 100px;
}

@media (min-width: 480px) {
  .app-main { padding-left: 32px; padding-right: 32px; }
}

/* Flash messages */
.flash {
  margin: 12px 20px 0;
  padding: 10px 14px;
  border-radius: var(--radius-card);
  font-size: 13px;
  font-weight: 600;
}
.flash-notice, .flash-alert { background: var(--mustard-soft); color: var(--mustard-text-strong); }

/* Back-arrow header, used on drill-down screens */
.screen-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.back-button {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-light);
  background: var(--paper);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  text-decoration: none;
}
.screen-header h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  margin: 0;
  color: var(--ink);
}
.screen-header--label h1 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Bottom tab bar */
.tab-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--line-light);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 10px;
}
.tab-item.is-active { color: var(--tomato); }
.tab-fab-slot {
  flex: 1;
  display: flex;
  justify-content: center;
}
.tab-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--tomato);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 24px;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--tomato-dark);
  transform: translateY(-14px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  padding: 14px;
  border-radius: 12px 14px 10px 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  width: 100%;
}
.btn-primary {
  background: var(--tomato);
  color: var(--paper);
  box-shadow: 0 4px 0 var(--tomato-dark);
}
.btn-outline {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: none;
  font-size: 14px;
  padding: 13px;
}
.btn-outline-tomato {
  background: var(--paper);
  color: var(--tomato);
  border: 2px solid var(--tomato);
  border-radius: 12px;
  box-shadow: none;
  font-size: 14px;
  padding: 13px;
}
.btn-outline-quiet {
  background: var(--paper);
  color: var(--ink-faint);
  border: 2px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
  font-size: 14px;
  padding: 13px;
}
.btn-danger {
  background: var(--tomato);
  color: var(--paper);
  border-radius: 12px;
  box-shadow: none;
  font-size: 14px;
  padding: 13px;
}
.btn-text {
  background: none;
  border: none;
  width: auto;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
  text-decoration: none;
}
.btn-text.muted { color: var(--ink-faint); }
.btn-text.tomato { color: var(--tomato); }

/* Cancel / title / save form header */
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.form-header h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: var(--ink);
  margin: 0;
}

/* Form fields */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  border: 2px solid var(--line);
  background: var(--paper);
  font-size: 15px;
  color: var(--ink);
}
.field input::placeholder { color: var(--line-faint); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; }

/* Search field: a text input with an embedded circular search button */
.search-field { position: relative; }
.search-field input[type="text"] {
  width: 100%;
  padding: 12px 46px 12px 14px;
  border-radius: var(--radius-input);
  border: 2px solid var(--line);
  background: var(--paper);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.search-field input::placeholder { color: var(--line-faint); }
.search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tomato);
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
/* Hand-drawn magnifying-glass glyph (matches the design reference exactly --
   not an emoji, which renders as a full-color "clip art" icon everywhere). */
.search-btn .icon {
  width: 13px;
  height: 13px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  position: relative;
}
.search-btn .icon::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 6px;
  background: var(--paper);
  bottom: -5px;
  right: -2px;
  transform: rotate(-45deg);
  border-radius: 1px;
}

.field-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 16px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.field-divider::before,
.field-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-light);
}

.field-errors {
  background: var(--tomato);
  color: var(--paper);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}
.field-errors ul { margin: 0; padding-left: 1.1em; }

.info-strip {
  font-size: 12px;
  color: var(--ink-faint);
  background: var(--paper-alt);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  margin-bottom: 20px;
}

.footnote {
  font-size: 11.5px;
  font-style: italic;
  color: var(--ink-faint);
}

/* Log drawer (bottom sheet from the tab bar's + button) */
.log-drawer {
  position: fixed;
  inset: 0;
  background: rgba(43, 33, 24, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.log-drawer.is-open { opacity: 1; pointer-events: auto; }

.log-drawer-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -12px 30px rgba(43, 33, 24, 0.2);
}
.log-drawer.is-open .log-drawer-sheet { transform: translateY(0); }

.log-drawer-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  margin: 0 auto 18px;
}

.drawer-option {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-bottom: 10px;
  text-decoration: none;
}
.drawer-option .title { font-size: 15px; font-weight: 800; color: var(--ink); }
.drawer-option .subtext { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.tag-testing {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  margin-left: 6px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--mustard-soft);
  color: var(--mustard-text);
  vertical-align: middle;
}

.day-sheet-list {
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: 10px;
}

.drawer-cancel {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-faint);
  text-align: center;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .log-drawer, .log-drawer-sheet { transition: none; }
}

/* Pill toggle group (meal picker) */
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-toggle { position: relative; }
.pill-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.pill-toggle label {
  display: block;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--meal-color, var(--line));
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--paper);
}
.pill-toggle input:checked + label {
  background: var(--meal-color, var(--ink));
  color: var(--paper);
}
.pill-toggle input:focus-visible + label {
  outline: 2px solid var(--denim);
  outline-offset: 2px;
}

/* Wordmark */
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 32px;
  line-height: 1;
  color: var(--ink);
  transform: rotate(-2deg);
  margin: 0 0 10px;
}
.tagline { font-size: 14px; font-weight: 500; color: var(--ink-soft); margin: 0 0 28px; }

.centered-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 8px;
}

/* Headings used throughout */
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 4px;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  color: var(--ink);
  transform: rotate(-1deg);
  margin: 0 0 20px;
}
.subhead { font-size: 13px; color: var(--ink-soft); margin: 6px 0 0; }

/* Calorie summary card */
.calorie-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--ink);
  border-radius: 18px 22px 16px 20px;
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 24px;
  text-decoration: none;
  color: inherit;
}
.calorie-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--tomato) var(--pct, 0%), var(--line-light) var(--pct, 0%));
}
.calorie-ring-inner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.calorie-ring-inner .total { font-size: 15px; font-weight: 800; color: var(--paper); line-height: 1.1; }
.calorie-ring-inner .of { font-size: 9px; color: #C9BFAE; }
.calorie-card .remaining { font-size: 15px; font-weight: 700; color: var(--paper); margin: 0; }
.calorie-card .quip { font-size: 12px; color: #C9BFAE; margin: 3px 0; }
.calorie-card .cta { font-size: 12px; font-weight: 700; color: var(--tomato); }

/* Weekly calorie pace bar */
.weekly-bar-card {
  background: var(--ink);
  border-radius: 18px 22px 16px 20px;
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.weekly-bar-card .label { font-size: 12px; font-weight: 700; color: #C9BFAE; margin: 0 0 12px; }
.weekly-bar-track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: var(--line-light);
  margin-bottom: 12px;
}
.weekly-bar-fill {
  height: 100%;
  border-radius: 7px;
  background: var(--tomato);
  width: var(--pct, 0%);
}
.weekly-bar-pace {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: var(--pace-pct, 0%);
  width: 2px;
  background: var(--paper);
  opacity: 0.7;
}
.weekly-bar-card .remaining { font-size: 15px; font-weight: 700; color: var(--paper); margin: 0; }
.weekly-bar-card .quip { font-size: 12px; color: #C9BFAE; margin: 3px 0 0; }

/* Meal groups */
.meal-group { margin-bottom: 22px; }
.meal-group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.meal-group-header h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  color: var(--meal-color, var(--ink));
  transform: rotate(-1deg);
  margin: 0;
}
.meal-group-header .subtotal { font-size: 12px; font-weight: 600; color: var(--ink-faint); }

.entry-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
}
.entry-row[hidden] { display: none; }
.entry-row .bar {
  width: 6px;
  border-radius: 3px;
  background: var(--meal-color, var(--line-faint));
  flex: none;
}
.entry-row .body { flex: 1; min-width: 0; }
.entry-row .name { font-size: 14px; font-weight: 700; color: var(--ink); }
.entry-row .meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.entry-row .cal { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; }

/* Database-match rows (Reruns fallback, food search): dashed border + denim
   bar distinguishes "found elsewhere" from your own logged history. */
.entry-row.database-match {
  border-style: dashed;
  border-color: var(--line-faint);
  --meal-color: var(--denim);
}

.empty-note {
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
  padding: 32px 16px;
}

/* Barcode scanner viewport */
.scan-viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-card-lg);
  background: var(--ink);
  overflow: hidden;
}
.scan-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  height: 34%;
  border: 3px solid var(--paper);
  border-radius: var(--radius-input);
  opacity: 0.85;
  pointer-events: none;
}

/* Generic card */
.card {
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-card);
  padding: 16px;
}
.card + .card { margin-top: 12px; }

/* Stat grid (week screen) */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: 16px;
  padding: 14px 16px;
}
.stat-card .label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ink-faint); }
.stat-card .value { font-family: var(--font-body); font-size: 24px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.stat-grid--3 { grid-template-columns: 1fr 1fr 1fr; }

/* Goals card (account screen) */
.goals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.goal-stat {
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-card);
  padding: 12px 14px;
}
.goal-stat .label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ink-faint); }
.goal-stat .value { font-size: 20px; font-weight: 800; color: var(--ink); margin-top: 2px; }

/* Weight section (account screen) */
.weight-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 14px; }
.weight-form .field { flex: 1; margin-bottom: 0; }
.weight-form .btn { width: auto; padding: 12px 20px; }

.weight-latest { display: flex; align-items: baseline; gap: 8px; margin-top: 16px; }
.weight-latest .num { font-size: 30px; font-weight: 800; color: var(--ink); }
.weight-latest .unit { font-size: 13px; color: var(--ink-faint); }
.weight-latest .delta { font-size: 12px; font-weight: 700; margin-left: auto; }
.weight-latest .delta.down { color: var(--avocado); }
.weight-latest .delta.up { color: var(--tomato); }

.weight-chart-wrap { margin-top: 14px; }
.weight-chart-wrap svg { width: 100%; height: auto; display: block; }
.weight-chart-empty { font-size: 12.5px; color: var(--ink-faint); margin-top: 14px; }

/* Week stamps */
.stamp-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 22px 0 14px;
}
.stamp-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.stamp-col .day-label { font-size: 11px; font-weight: 700; color: var(--ink-faint); }
.stamp {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--paper);
  text-decoration: none;
}
.stamp-hit { background: var(--avocado); }
.stamp-missed { background: var(--tomato); }
.stamp-none { background: transparent; border: 2px dashed var(--line-faint); }
.stamp-today { background: var(--mustard-soft); border: 2px solid var(--mustard); color: var(--mustard-text-strong); }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.legend .dot { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot::before {
  content: "";
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--dot-color, var(--ink-faint));
  display: inline-block;
}
.legend .dot.dashed::before {
  background: none;
  border: 2px dashed var(--line-faint);
  width: 8px; height: 8px;
}

/* Macro rings */
.macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.macro-card {
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-card-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.macro-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--macro-color, var(--ink)) var(--pct, 0%), var(--line-light) var(--pct, 0%));
  margin-bottom: 10px;
}
.macro-ring-inner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.macro-card .name { font-size: 13px; font-weight: 700; color: var(--ink); }
.macro-card .value { font-size: 11.5px; font-weight: 600; color: var(--ink-faint); margin-top: 2px; }

.macro-bar-row { margin-bottom: 14px; }
.macro-bar-row:last-child { margin-bottom: 0; }
.macro-bar-labels { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.macro-bar-track { height: 10px; border-radius: 6px; background: var(--paper-alt); overflow: hidden; }
.macro-bar-fill { height: 100%; border-radius: 6px; background: var(--macro-color, var(--ink)); width: var(--pct, 0%); }

/* Entry detail */
.meal-badge {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--meal-color, var(--ink)) 15%, var(--paper));
  color: var(--meal-color, var(--ink));
  margin-bottom: 10px;
}
.entry-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 21px;
  color: var(--ink);
  transform: rotate(-0.5deg);
  margin: 0 0 4px;
}
.entry-meta { font-size: 13px; color: var(--ink-soft); margin: 0 0 20px; }
.big-cal-card {
  background: var(--ink);
  border-radius: 20px;
  text-align: center;
  padding: 26px 16px;
  margin-bottom: 16px;
}
.big-cal-card .num { font-size: 34px; font-weight: 800; color: var(--paper); line-height: 1; }
.big-cal-card .label { font-size: 12px; font-weight: 600; color: #C9BFAE; margin-top: 6px; }

.detail-macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.detail-macro-card {
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-card);
  padding: 12px 14px;
}
.detail-macro-card .label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ink-faint); }
.detail-macro-card .value { font-size: 20px; font-weight: 800; color: var(--ink); margin-top: 2px; }

.source-strip {
  background: var(--mustard-soft);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mustard-text-strong);
  margin-bottom: 20px;
}

.entry-fatsecret-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  margin-bottom: 20px;
}
.entry-fatsecret-badge img { display: block; height: 16px; width: auto; }

.action-row { display: flex; gap: 10px; }
.action-row .btn { flex: 1; }

/* Account rows / people list */
.row-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
}
.row-link .title { font-size: 14px; font-weight: 700; color: var(--ink); }
.row-link .subtext { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.row-link .chevron { color: var(--line-faint); font-size: 18px; flex: none; }

.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  font-weight: 700;
  font-size: 15px;
  flex: none;
}
.person-row .body { flex: 1; min-width: 0; }
.person-row .name { font-size: 14px; font-weight: 700; color: var(--ink); }
.person-row .sub { font-size: 11.5px; color: var(--ink-faint); }
.status-pill {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  white-space: nowrap;
}
.status-pill.active { background: var(--avocado-soft); color: var(--avocado-text); }
.status-pill.pending { background: var(--mustard-soft); color: var(--mustard-text); }

/* API key */
.key-card {
  background: var(--ink);
  border-radius: var(--radius-card);
  padding: 18px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  color: var(--mustard);
  word-break: break-all;
  margin-bottom: 12px;
}
.key-note { font-size: 12px; font-style: italic; color: var(--ink-faint); margin-bottom: 20px; }
.key-warning { font-size: 11.5px; color: var(--ink-faint); margin-top: 12px; }
