/* Macodes on the web: the iOS app's look (grouped lists, sheets, a tab bar), in light and dark. */

:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #000000;
  --secondary: rgba(60, 60, 67, 0.62);
  --tertiary: rgba(60, 60, 67, 0.32);
  --separator: rgba(60, 60, 67, 0.2);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-strong: rgba(118, 118, 128, 0.2);
  --tint: #007aff;
  --tint-soft: rgba(0, 122, 255, 0.12);
  --green: #34c759;
  --yellow: #ffcc00;
  --red: #ff3b30;
  --orange: #ff9500;
  --gray: #8e8e93;
  --bar: rgba(249, 249, 249, 0.94);
  --sheet-bg: #f2f2f7;
  --sheet-card: #ffffff;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --rounded: ui-rounded, -apple-system, "SF Pro Rounded", system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --tabbar: calc(56px + var(--safe-bottom));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #ffffff;
    --secondary: rgba(235, 235, 245, 0.6);
    --tertiary: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.6);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-strong: rgba(118, 118, 128, 0.36);
    --tint: #0a84ff;
    --tint-soft: rgba(10, 132, 255, 0.2);
    --green: #30d158;
    --yellow: #ffd60a;
    --red: #ff453a;
    --orange: #ff9f0a;
    --bar: rgba(22, 22, 24, 0.94);
    --sheet-bg: #1c1c1e;
    --sheet-card: #2c2c2e;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --card: #1c1c1e;
  --text: #ffffff;
  --secondary: rgba(235, 235, 245, 0.6);
  --tertiary: rgba(235, 235, 245, 0.3);
  --separator: rgba(84, 84, 88, 0.6);
  --fill: rgba(118, 118, 128, 0.24);
  --fill-strong: rgba(118, 118, 128, 0.36);
  --tint: #0a84ff;
  --tint-soft: rgba(10, 132, 255, 0.2);
  --green: #30d158;
  --yellow: #ffd60a;
  --red: #ff453a;
  --orange: #ff9f0a;
  --bar: rgba(22, 22, 24, 0.94);
  --sheet-bg: #1c1c1e;
  --sheet-card: #2c2c2e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.3; -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
html.sheet-open body { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.4; }
a { color: var(--tint); text-decoration: none; }
h1, h2, h3 { margin: 0; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

.secondary { color: var(--secondary); }
.tint { color: var(--tint); }
.orange { color: var(--orange); }
.green-text { color: var(--green); }
.error { color: var(--red); padding: 8px 16px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; }
.caption { font-size: 12px; }
.caption2 { font-size: 11px; }
.footnote { font-size: 13px; }
.subheadline { font-size: 15px; }
.callout { font-size: 16px; }
.headline { font-size: 17px; font-weight: 600; }
.title2 { font-size: 22px; font-weight: 700; }
.selectable { user-select: text; -webkit-user-select: text; }
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.two-lines { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.with-icon { display: flex; align-items: center; gap: 8px; }
.pad { padding: 10px 16px; }
.space-between { justify-content: space-between; }
.icon { flex: none; }

.boot { display: grid; place-items: center; height: 100vh; font: 600 28px var(--rounded); color: var(--secondary); }
.boot-error { max-width: 420px; margin: 20vh auto; padding: 24px; text-align: center; display: grid; gap: 14px; }
.boot-error button { justify-self: center; }

/* ---------------------------------------------------------------- layout */

.app { min-height: 100vh; }
.main { min-height: 100vh; }
.tab-page { position: relative; min-height: 100vh; background: var(--bg); }
.screen { max-width: 680px; margin: 0 auto; padding-bottom: calc(var(--tabbar) + 24px); }
.titlebar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(var(--safe-top) + 10px) 16px 8px; background: var(--bg); }
.titlebar h1 { font-size: 30px; }
.screen-body { padding: 0 16px; }
.screen-body.from-right { animation: from-right 0.22s ease-out; }
.screen-body.from-left { animation: from-left 0.22s ease-out; }
@keyframes from-right { from { transform: translateX(24px); opacity: 0.4; } }
@keyframes from-left { from { transform: translateX(-24px); opacity: 0.4; } }
.bottom-room { height: 72px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: space-around; height: var(--tabbar);
  padding-bottom: var(--safe-bottom); background: var(--bar); border-top: 0.5px solid var(--separator); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none;
  color: var(--gray); font-size: 10px; font-weight: 500; min-width: 44px; }
.tab.on { color: var(--tint); }
.dark-tab .tabbar { background: rgba(20, 20, 22, 0.86); border-top-color: rgba(255, 255, 255, 0.12); }
.dark-tab .tab { color: rgba(255, 255, 255, 0.6); }
.dark-tab .tab.on { color: #4da3ff; }

/* ---------------------------------------------------------------- buttons */

.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 0; font-weight: 600; background: var(--fill); color: var(--tint); }
.button.prominent { background: var(--tint); color: #fff; }
.button.bordered { background: var(--tint-soft); color: var(--tint); }
.button.gray { background: var(--fill-strong); color: var(--text); }
.button.pill { border-radius: 999px; min-width: 96px; min-height: 50px; font-size: 17px; }
.button.plain { background: none; padding: 0 6px; font-weight: 400; color: var(--tint); }
.button.plain.strong { font-weight: 600; }
.button.small { min-height: 32px; font-size: 15px; padding: 0; }
.button.wide { width: 100%; }
.destructive { color: var(--red) !important; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 22px; background: none; color: var(--tint); }
.close-circle { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--fill-strong); color: var(--gray); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.round-button { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 24px; border: 0;
  background: rgba(60, 60, 60, 0.55); color: #fff; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.round-button.on { background: #fff; color: #000; }

/* ---------------------------------------------------------------- lists and forms */

.section { margin: 18px 0; }
.section-header { padding: 0 16px 6px; font-size: 13px; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.02em; }
.section-header .meal-header, .section-header .section-header-row { text-transform: none; letter-spacing: 0; }
.section-header-row { display: flex; align-items: center; justify-content: space-between; }
.section-header-row .button { text-transform: none; font-size: 15px; min-height: 44px; }
.meal-header { display: flex; justify-content: space-between; align-items: baseline; color: var(--text); font-size: 20px; font-weight: 600; padding-top: 4px; }
.meal-header .secondary { font-size: 15px; font-weight: 400; }
.section-body { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.section-body > * + * { border-top: 0.5px solid var(--separator); }
.section-footer { padding: 6px 16px 0; font-size: 13px; color: var(--secondary); }
.row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 16px; width: 100%; text-align: left; background: none; border: 0; }
.row-button { cursor: pointer; }
.row-button:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-plain { background: none; border: 0; padding: 0; text-align: left; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.row.link { display: block; font-size: 15px; }
.row-action { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 10px 16px; border: 0; background: none; color: var(--tint); text-align: left; }
.row-action.strong { font-weight: 600; }
.chevron { color: var(--tertiary); }
.choice { justify-content: space-between; }
.field-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 16px; }
.field-row > span:first-child { flex: 1; min-width: 0; }
.field-row input[type="text"], .field-row input[type="date"], .field-row input[type="time"], .field-row select { text-align: right; }
.field-row select { max-width: 62%; border: 0; background: none; color: var(--tint); appearance: none; -webkit-appearance: none; padding: 6px 0; text-overflow: ellipsis; }
.field-row input[type="date"], .field-row input[type="time"] { border: 0; background: var(--fill); border-radius: 8px; padding: 6px 8px; }
.field-row .unit { min-width: 30px; }
.field-pad { padding: 10px 16px; }
.field { display: block; width: 100%; border: 0; background: none; padding: 12px 16px; outline: none; resize: vertical; }
.field.big { font-size: 22px; }
.form { padding: 0 16px 24px; }
.target-row input { width: 90px; text-align: right; border: 0; background: var(--fill); border-radius: 8px; padding: 6px 8px; }
.window-row input { width: auto; }
input[type="search"] { -webkit-appearance: none; appearance: none; }

.number-input { display: inline-flex; align-items: center; gap: 6px; }
.number-input input { width: 110px; text-align: right; border: 0; background: var(--fill); border-radius: 8px; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.number-input.narrow input { width: 54px; }
.number-input .step, .stepper button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 18px; border: 0; background: var(--fill); color: var(--tint); }
.stepper { display: inline-flex; gap: 8px; }

.segmented { display: flex; padding: 2px; border-radius: 9px; background: var(--fill); gap: 2px; }
.segmented button { flex: 1; min-height: 32px; padding: 4px 10px; border: 0; border-radius: 7px; background: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.segmented button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
:root[data-theme="dark"] .segmented button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button.on { background: #636366; } }

.searchbar { position: sticky; top: calc(var(--safe-top) + 60px); z-index: 4; display: flex; align-items: center; gap: 8px; margin: 0 16px 6px; padding: 0 10px;
  border-radius: 10px; background: var(--fill); color: var(--secondary); }
.searchbar.in-sheet { position: static; margin: 4px 16px 6px; }
.searchbar input { flex: 1; min-height: 38px; border: 0; background: none; color: var(--text); outline: none; }

.empty { display: grid; justify-items: center; gap: 8px; padding: 48px 24px 24px; text-align: center; color: var(--secondary); }
.empty-title { font-size: 20px; font-weight: 700; color: var(--text); }
.empty-actions { margin-top: 8px; }

.badge { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 2px 8px; border-radius: 999px; background: var(--tint-soft); color: var(--tint); font-size: 12px; font-weight: 600; }
.spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--fill-strong); border-top-color: var(--secondary); animation: spin 0.8s linear infinite; vertical-align: middle; }
.spinner.light { width: 28px; height: 28px; border-color: rgba(255, 255, 255, 0.3); border-top-color: #fff; }
.spinner.light.small { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- sheets and dialogs */

.sheet-layer, .dialog-layer { position: fixed; inset: 0; z-index: 100; }
.dialog-layer { z-index: 10000; display: grid; align-items: end; justify-items: center; padding: 0 10px calc(var(--safe-bottom) + 10px); }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 680px; display: flex; flex-direction: column; outline: none;
  background: var(--sheet-bg); border-radius: 14px 14px 0 0; box-shadow: var(--shadow); transition: height 0.25s ease, transform 0.2s ease; animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes rise { from { transform: translateY(100%); } }
.sheet-large { height: calc(100% - var(--safe-top) - 12px); }
.sheet-half { height: 58%; }
.sheet-auto { max-height: calc(100% - var(--safe-top) - 12px); }
.sheet-handle { flex: none; width: 36px; height: 5px; margin: 6px auto 2px; border-radius: 3px; background: var(--fill-strong); }
.sheet-top { flex: none; }
.sheet-title { padding: 8px 16px 4px; text-align: center; font-weight: 600; }
.sheet-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-bottom { flex: none; }
.sheet-body { padding: 18px 20px 12px; display: grid; gap: 22px; }
.sheet-dark { background: #000; color: #fff; }
.sheet .section-body, .sheet .card:not(.tint-card) { background: var(--sheet-card); }
.sheet .entry-box { background: var(--sheet-card); }
.sheet-dark .navbar-title { color: #fff; }
.navbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; }
.navbar-title { font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
.navbar-side { display: flex; align-items: center; }
.navbar-right { justify-content: flex-end; }
/* The sheet's X / Log and the Log picker's Cancel / Add sit in the same two spots (D-194). */
.bottombar { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px calc(10px + var(--safe-bottom)); background: var(--bar);
  border-top: 0.5px solid var(--separator); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.dialog { position: relative; width: 100%; max-width: 480px; display: grid; gap: 8px; animation: rise 0.25s cubic-bezier(0.2, 0.9, 0.3, 1); }
.dialog-text { padding: 14px 16px; background: var(--card); border-radius: 14px 14px 0 0; text-align: center; margin-bottom: -8px; border-bottom: 0.5px solid var(--separator); }
.dialog-title { font-size: 13px; font-weight: 600; color: var(--secondary); }
.dialog-message { font-size: 13px; color: var(--secondary); margin-top: 4px; }
.dialog-button { min-height: 56px; border: 0; background: var(--card); color: var(--tint); font-size: 19px; }
.dialog-text + .dialog-button { border-radius: 0; }
.dialog-button + .dialog-button:not(.dialog-cancel) { margin-top: -8px; border-top: 0.5px solid var(--separator); }
.dialog > .dialog-button:not(.dialog-cancel):last-of-type, .dialog-text ~ .dialog-button:nth-last-child(2) { border-radius: 0 0 14px 14px; }
.dialog-cancel { border-radius: 14px; font-weight: 600; }
.dialog:not(:has(.dialog-text)) .dialog-button:first-child { border-radius: 14px 14px 0 0; }

.banner { position: fixed; top: calc(var(--safe-top) + 10px); left: 50%; transform: translateX(-50%); z-index: 20000; display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow); animation: drop 0.25s ease-out; white-space: nowrap; }
.banner .icon { color: var(--green); }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }
.undo-bar { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar) + 10px); z-index: 60; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.undo-bar .one-line { flex: 1; }

/* ---------------------------------------------------------------- product sheet */

.product-header { display: flex; gap: 16px; align-items: flex-start; }
.product-title { display: grid; gap: 4px; min-width: 0; }
.thumb { flex: none; display: block; background: var(--fill); }
.thumb-empty { display: grid; place-items: center; color: var(--secondary); }
.photo-button { position: relative; padding: 0; border: 0; background: none; }
.photo-badge { position: absolute; right: 4px; bottom: 4px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 12px; background: var(--tint); color: #fff; }
.photo-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.block { display: grid; gap: 10px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.message { display: grid; gap: 12px; color: var(--text); }
.message > .icon { color: var(--secondary); }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 160px; }
.score { display: grid; gap: 16px; }
.score-top { display: flex; align-items: center; gap: 16px; }
.ring { flex: none; }
.ring-number { font-family: var(--rounded); font-weight: 600; fill: var(--text); font-variant-numeric: tabular-nums; }
.ring-none { font-weight: 600; fill: var(--secondary); }
.findings { display: grid; gap: 12px; }
.finding { display: flex; gap: 10px; align-items: flex-start; }
.finding.dim { opacity: 0.6; }
.finding > div { display: grid; gap: 4px; min-width: 0; }
.finding-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.evidence { flex: none; font-size: 12px; padding: 2px 6px; border-radius: 999px; background: var(--fill-strong); }
.dot { flex: none; width: 12px; height: 12px; margin-top: 4px; border-radius: 6px; }
.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.nutrients { display: grid; }
.nutrient-row { padding: 7px 0; border-bottom: 0.5px solid var(--separator); }
.nutrient-line { display: flex; align-items: baseline; gap: 12px; }
.nutrient-line > span:first-child { flex: 1; }
.nutrient-value { text-align: right; }
.nutrient-dv { width: 58px; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; flex: none; }
.nutrient-note { font-size: 11px; text-align: right; margin-top: 2px; }
.nutrients-group { padding: 14px 0 4px; font-size: 15px; font-weight: 600; }
.weight-controls { display: grid; gap: 8px; }
.weight-controls .field-row { padding: 0; }
.card { display: grid; gap: 6px; padding: 16px; margin: 12px 0; border-radius: 16px; background: var(--card); }
.tint-card { background: var(--tint-soft); margin: 0; }
.tint-card .field-row { padding: 0; }
.correction-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.attribution { display: grid; gap: 4px; }

/* ---------------------------------------------------------------- forms */

.entry-row { display: flex; align-items: center; gap: 8px; padding: 8px 16px; }
.entry-name { flex: 1; min-width: 0; }
.entry-box { width: 82px; text-align: right; border: 0.5px solid var(--separator); border-radius: 8px; padding: 7px 8px; background: var(--card); }
.entry-none { font-size: 15px; }
.entry-unit { width: 80px; border: 0; background: none; color: var(--tint); text-align: right; font-size: 15px; appearance: none; -webkit-appearance: none; }
.photo-strip { display: flex; gap: 10px; padding: 12px 16px; overflow-x: auto; }
.photo-tile { position: relative; flex: none; }
.photo-tile img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }
.photo-remove { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 12px; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; }
.license { white-space: pre-wrap; font-size: 11px; max-height: 260px; overflow: auto; background: var(--fill); padding: 10px; border-radius: 8px; }

/* ---------------------------------------------------------------- diary */

.diary-bar { padding-left: 6px; padding-right: 6px; }
.bar-group { display: flex; align-items: center; }
.day-title { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; font-size: 17px; font-weight: 600; min-height: 44px; }
.totals-top { display: flex; justify-content: space-between; align-items: baseline; }
.big-number { font: 700 34px var(--rounded); }
.goalbar { width: 100%; border-radius: 999px; background: var(--fill-strong); overflow: hidden; }
.goalbar-fill { height: 100%; border-radius: 999px; background: var(--green); }
.goalbar-fill.over { background: var(--orange); }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 10px; }
.macro { display: grid; gap: 3px; align-content: start; }
.vitamin { padding: 8px 0; border-bottom: 0.5px solid var(--separator); display: grid; gap: 4px; }
.progress { height: 4px; border-radius: 2px; background: var(--fill-strong); overflow: hidden; }
.progress > div { height: 100%; background: var(--tint); }
.progress.green { width: 120px; }
.progress.green > div { background: var(--green); }
.target-line { display: flex; align-items: center; gap: 8px; }
.swipe { position: relative; overflow: hidden; }
.swipe-actions { position: absolute; inset: 0; display: flex; justify-content: space-between; }
.swipe-actions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden; padding: 0; border: 0; color: #fff; font-size: 13px; }
.swipe-edit { background: var(--tint); }
.swipe-delete { background: var(--red); }
.swipe-front { position: relative; background: var(--card); transition: transform 0.2s ease; touch-action: pan-y; }
.diary-entry { align-items: flex-start; }

/* ---------------------------------------------------------------- trends */

.averages { display: grid; grid-template-columns: 1fr 1fr; }
.average { padding: 12px 16px; display: grid; gap: 3px; }
.average + .average { border-left: 0.5px solid var(--separator); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--separator); stroke-width: 0.5; }
.chart .axis { fill: var(--secondary); font-size: 9px; }
.chart .bar { fill: var(--tint); }
.chart .bar.over, .chart .bar.hot { fill: var(--orange); }
.chart .bar.soft { fill: var(--tint); opacity: 0.55; }
.chart .goal-line { stroke: var(--green); stroke-width: 1.5; stroke-dasharray: 5 4; }

/* ---------------------------------------------------------------- scan */

.scan { position: fixed; inset: 0; background: #000; color: #fff; z-index: 0; }
.scan.in-sheet { position: relative; height: 100%; min-height: 420px; }
.camera { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera.hidden { visibility: hidden; }
.brackets { position: absolute; left: 50%; top: 45%; width: min(80vw, 420px); height: min(48vw, 250px); transform: translate(-50%, -50%); pointer-events: none; }
.brackets span { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; border-radius: 4px; }
.brackets span:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; }
.brackets span:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.brackets span:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; }
.brackets span:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.scan-top { position: absolute; top: calc(var(--safe-top) + 10px); right: 20px; display: flex; gap: 12px; z-index: 2; }
.scan-center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; padding: 32px; text-align: center; }
.camera-message .icon { opacity: 0.8; }
.camera-message p { color: rgba(255, 255, 255, 0.75); max-width: 340px; }
.scan-hint { position: absolute; left: 50%; bottom: calc(var(--tabbar) + 24px); transform: translateX(-50%); max-width: calc(100% - 40px); padding: 8px 14px;
  border-radius: 14px; background: rgba(0, 0, 0, 0.5); font-size: 15px; font-weight: 500; text-align: center; }
.scan.in-sheet .scan-hint { bottom: 28px; }
.scan-hint .button { min-height: 32px; color: #4da3ff; }

/* ---------------------------------------------------------------- meal preps */

.qr-wrap { display: grid; place-items: center; padding: 16px; }
.qr-label { width: min(260px, 70vw); padding: 16px; background: #fff; color: #000; border-radius: 6px; display: grid; gap: 10px; justify-items: center; }
.qr-label svg { width: 100%; height: auto; display: block; }
.qr-name { font-weight: 600; text-align: center; }

@media (min-width: 700px) {
  .screen-body, .form { padding-left: 20px; padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.row-main.with-icon { flex-direction: row; align-items: center; gap: 10px; }
