:root {
  color-scheme: light;
  --page: #dedbd2;
  --paper: #ffffff;
  --ink: #050505;
  --muted: #515151;
  --soft: #f2f1ed;
  --accent: #d92d20;
  --accent-dark: #981b13;
  --thin-rule: 1px solid var(--ink);
  --medium-rule: 5px solid var(--ink);
  --heavy-rule: 11px solid var(--ink);
  --space-1: 0.35rem;
  --space-2: 0.7rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.25rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 46px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.source-list a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  margin-bottom: 0;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.app-shell {
  width: min(100% - 0.75rem, 740px);
  margin: 0 auto;
  padding: max(0.75rem, env(safe-area-inset-top)) 0 max(1.5rem, env(safe-area-inset-bottom));
}

.label-sheet {
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--ink);
}

.facts-header,
.daily,
.capture,
.draft,
.history,
.trend-history {
  padding-right: clamp(0.7rem, 3vw, 1.5rem);
  padding-left: clamp(0.7rem, 3vw, 1.5rem);
}

.facts-header {
  padding-top: var(--space-2);
}

.utility-row,
.serving-row,
.amount-row,
.calorie-row,
.calorie-meta,
.section-heading,
.item-title-row,
.capture-actions,
.draft-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.utility-row {
  gap: var(--space-3);
  min-height: 46px;
  border-bottom: var(--thin-rule);
}

.utility-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.app-kicker,
.eyebrow,
label,
.history-time,
.target-heading,
.section-code {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1.25;
  text-transform: uppercase;
}

.facts-header h1 {
  margin: 0.12em 0 0;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(3.2rem, 12.5vw, 6.1rem);
  font-stretch: condensed;
  font-weight: 950;
  letter-spacing: -0.085em;
  line-height: 0.88;
  white-space: nowrap;
}

.serving-row {
  gap: var(--space-3);
  padding: 0.65rem 0 0.5rem;
  border-top: 2px solid var(--ink);
  font-size: clamp(0.77rem, 2.7vw, 0.9rem);
}

.serving-row strong {
  text-align: right;
}

.view-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0.55rem 0 0.7rem;
  border: 2px solid var(--ink);
}

.view-tab,
.range-button {
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.view-tab + .view-tab,
.range-button + .range-button {
  border-left: 2px solid var(--ink);
}

.view-tab[aria-selected="true"],
.range-button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.rule-heavy {
  height: 0;
  margin: 0;
  border-top: var(--heavy-rule);
}

.rule-medium {
  height: 0;
  margin-top: 0.45rem;
  border-top: var(--medium-rule);
}

.amount-row {
  gap: var(--space-3);
  padding: 0.35rem 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 800;
}

.calorie-row {
  gap: var(--space-4);
  line-height: 1;
}

.calorie-row h2,
.calorie-row > strong {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2.6rem, 11vw, 5.2rem);
  font-weight: 950;
  letter-spacing: -0.07em;
}

.calorie-row > strong {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.calorie-meta {
  gap: var(--space-3);
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.calorie-meta span:last-child {
  text-align: right;
}

progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
}

progress::-webkit-progress-bar {
  background: var(--paper);
}

progress::-webkit-progress-value {
  background: var(--ink);
}

progress::-moz-progress-bar {
  background: var(--ink);
}

.daily > progress {
  margin-top: 0.5rem;
}

.target-heading {
  margin: 0;
  padding: 0.3rem 0 0.22rem;
  border-bottom: var(--thin-rule);
  text-align: right;
}

.macro-stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.1rem var(--space-3);
  align-items: baseline;
  padding: 0.42rem 0 0.32rem;
  border-bottom: var(--thin-rule);
}

.macro-copy {
  min-width: 0;
  font-size: clamp(0.92rem, 3vw, 1.08rem);
  line-height: 1.25;
}

.macro-copy > strong {
  font-weight: 900;
}

.macro-copy > span {
  margin-left: 0.25rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.macro-percent {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.macro-stat progress {
  grid-column: 1 / -1;
  height: 4px;
  margin-top: 0.25rem;
}

.label-footnote {
  margin: 0;
  padding: 0.55rem 0 0.7rem;
  font-size: 0.68rem;
  line-height: 1.35;
}

.capture,
.draft,
.history,
.trend-history {
  padding-top: 0;
}

.capture .rule-heavy,
.draft .rule-heavy,
.history .rule-heavy,
.trend-history .rule-heavy {
  margin-right: 0;
  margin-left: 0;
}

.section-heading {
  gap: var(--space-3);
  align-items: flex-end;
  padding: 0.55rem 0 0.45rem;
  border-bottom: 2px solid var(--ink);
}

.section-heading h2 {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.75rem, 7vw, 2.7rem);
  font-weight: 950;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.section-code {
  flex: 0 0 auto;
  padding-bottom: 0.18rem;
}

.capture-instructions {
  max-width: 56ch;
  margin: 0;
  padding: 0.65rem 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.record-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  width: 100%;
  min-height: 82px;
  padding: 0.8rem;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  box-shadow: 4px 4px 0 #9b9b97;
  color: var(--paper);
  cursor: pointer;
  text-align: left;
}

.record-button:active {
  translate: 2px 2px;
  box-shadow: 2px 2px 0 #9b9b97;
}

.record-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.record-copy {
  display: grid;
  gap: 0.12rem;
}

.record-copy strong {
  font-size: 1.08rem;
  line-height: 1.1;
}

.record-copy small {
  color: #c9c9c9;
  font-size: 0.7rem;
}

.record-button[aria-pressed="true"] {
  border-color: var(--accent-dark);
  background: var(--accent);
}

.source-divider {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin: 0.85rem 0;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.source-divider::before,
.source-divider::after {
  height: 1px;
  background: var(--ink);
  content: "";
  flex: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.photo-trigger {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  width: 100%;
  min-height: 74px;
  margin: 0;
  padding: 0.75rem;
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 #9b9b97;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: normal;
  text-transform: none;
}

.photo-trigger:active {
  translate: 2px 2px;
  box-shadow: 2px 2px 0 #9b9b97;
}

.photo-trigger svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.photo-copy {
  display: grid;
  gap: 0.12rem;
}

.photo-copy strong {
  font-size: 1rem;
  line-height: 1.15;
}

.photo-copy small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.photo-code {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.photo-input:focus-visible + .photo-trigger {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.photo-input:disabled + .photo-trigger {
  cursor: not-allowed;
  opacity: 0.55;
}

.photo-preview-panel {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr);
  gap: var(--space-3);
  margin-top: 0.85rem;
  padding: 0.65rem 0;
  border-top: var(--thin-rule);
  border-bottom: var(--medium-rule);
}

.photo-preview-panel[hidden] {
  display: none;
}

.photo-preview-panel img {
  width: 100%;
  height: 150px;
  border: 2px solid var(--ink);
  background: var(--ink);
  object-fit: contain;
}

.photo-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
}

.photo-meta > p {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.4;
}

.photo-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: flex-end;
}

.photo-actions .primary-button {
  flex: 1;
}

.capture-privacy {
  margin: 0;
  padding: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.signal-bars {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 36px;
}

.signal-bars i {
  display: block;
  width: 3px;
  height: 30%;
  background: currentColor;
}

.signal-bars i:nth-child(2),
.signal-bars i:nth-child(5) {
  height: 65%;
}

.signal-bars i:nth-child(3) {
  height: 100%;
}

.signal-bars i:nth-child(4) {
  height: 48%;
}

.signal-bars i:nth-child(6) {
  height: 82%;
}

.type-fallback {
  margin-top: 0.85rem;
  border-top: var(--thin-rule);
  border-bottom: var(--thin-rule);
}

.type-fallback summary {
  min-height: 48px;
  padding: 0.88rem 1.7rem 0.75rem 0;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  list-style-position: inside;
  text-transform: uppercase;
}

.typed-entry {
  padding-bottom: var(--space-3);
}

label {
  display: block;
  margin-bottom: 0.35rem;
}

textarea,
input[type="text"],
input[type="number"],
input[type="password"] {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--soft);
  color: var(--ink);
}

textarea {
  min-height: 132px;
  padding: 0.75rem;
  resize: vertical;
  line-height: 1.5;
}

textarea::placeholder {
  color: #6c6c6c;
}

.login-shell {
  display: grid;
  width: min(100% - 0.75rem, 540px);
  min-height: 100svh;
  align-items: center;
}

.login-sheet {
  width: 100%;
}

.login-kicker {
  min-height: 46px;
  margin: 0;
  padding-top: 1rem;
  border-bottom: var(--thin-rule);
}

.login-panel {
  padding: 0 clamp(0.7rem, 4vw, 1.5rem) var(--space-4);
}

.login-panel > .eyebrow {
  margin-top: var(--space-3);
}

.login-panel h2 {
  max-width: 12ch;
  margin-top: 0.22rem;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2rem, 9vw, 3.4rem);
  font-weight: 950;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.login-copy {
  max-width: 45ch;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.login-form {
  margin-top: var(--space-4);
  padding: var(--space-3) 0;
  border-top: var(--medium-rule);
  border-bottom: var(--thin-rule);
}

.login-form input {
  min-height: 52px;
  padding: 0.75rem;
  font-size: 1rem;
}

.login-form .primary-button {
  width: 100%;
  margin-top: var(--space-3);
}

.login-privacy {
  max-width: 50ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.45;
}

.capture-actions,
.draft-actions,
.dialog-actions {
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.capture-actions p {
  max-width: 40ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.primary-button,
.label-button {
  appearance: none;
  border-radius: 0;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  min-width: 148px;
  padding: 0.72rem 1rem;
  border: 2px solid var(--ink);
  background: var(--ink);
  box-shadow: 3px 3px 0 #a4a4a0;
  color: var(--paper);
}

.primary-button:active {
  translate: 1px 1px;
  box-shadow: 2px 2px 0 #a4a4a0;
}

.label-button {
  padding: 0.42rem 0.58rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.icon-button {
  display: inline-flex;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.8;
}

.icon-button:active {
  background: var(--ink);
  color: var(--paper);
}

.live-status {
  min-height: 1.3em;
  margin: 0;
  padding: 0.6rem 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.live-status[data-state="error"],
.danger-button,
.warning-list p {
  color: var(--accent-dark);
}

.draft-sources {
  margin: 0;
  padding: 0.7rem 0;
  border-bottom: var(--thin-rule);
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}

.source-list a {
  display: inline-block;
  padding: 0.38rem 0.48rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
}

.source-list a::after {
  content: " ↗";
}

.source-list a:active {
  background: var(--ink);
  color: var(--paper);
}

.source-note {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.draft-total {
  max-width: 48%;
  font-size: 0.75rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  text-align: right;
}

.transcript-preview {
  margin: 0;
  padding: 0.7rem 0;
  border-bottom: var(--thin-rule);
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
  line-height: 1.5;
}

.warning-list p {
  margin: 0;
  padding: 0.45rem 0;
  border-bottom: var(--thin-rule);
  font-size: 0.78rem;
  font-weight: 700;
}

.draft-meal-field {
  padding: 0.75rem 0;
  border-bottom: var(--thin-rule);
}

.draft-meal-field input,
.item-identity-fields input,
.meal-edit-fields input {
  min-height: 48px;
  margin-top: 0.35rem;
  padding: 0.65rem;
}

.draft-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: 0.75rem;
}

.draft-item {
  padding: 0.75rem 0;
  border-bottom: 3px solid var(--ink);
}

.item-title-row {
  gap: var(--space-3);
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.history-name {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}

.item-note,
.history-items {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.item-identity-fields {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 0.65rem;
}

.item-meta-actions,
.history-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.45rem;
  align-items: center;
}

.item-meta-actions {
  flex-direction: column;
}

.basis-label {
  flex: 0 0 auto;
  padding: 0.18rem 0.3rem;
  border: 1px solid var(--ink);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.basis-label[data-basis="exact"] {
  background: var(--ink);
  color: var(--paper);
}

.item-fields,
.target-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.item-fields label,
.target-fields label {
  position: relative;
}

.item-fields input,
.target-fields input {
  min-height: 48px;
  margin-top: 0.35rem;
  padding: 0.65rem 1.8rem 0.65rem 0.65rem;
  font-variant-numeric: tabular-nums;
}

.item-fields label > span {
  position: absolute;
  right: 0.65rem;
  bottom: 0.82rem;
  font-size: 0.7rem;
  text-transform: none;
}

.draft-actions {
  padding: 0.8rem 0;
}

.history {
  padding-bottom: 0.5rem;
}

.trend-history {
  padding-bottom: var(--space-3);
}

.trend-current {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.trend-current span,
.trend-current small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trend-current strong {
  margin: 0.1rem 0;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.55rem;
  letter-spacing: -0.05em;
}

.range-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.75rem;
  border: 2px solid var(--ink);
}

.trend-subtitle {
  margin: 0;
  padding: 0.65rem 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.trend-figure {
  margin: 0;
  padding: 0.25rem 0 0.65rem;
  border-bottom: var(--medium-rule);
}

.trend-figure svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid-line {
  stroke: #ceccc5;
  stroke-width: 1;
}

.chart-data-line {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2.5;
}

.chart-marker {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2;
}

.chart-goal-line {
  stroke: var(--accent);
  stroke-dasharray: 6 4;
  stroke-width: 2;
}

.chart-axis-label,
.chart-x-label,
.chart-goal-label {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.chart-axis-label,
.chart-x-label {
  fill: var(--muted);
}

.chart-goal-label {
  fill: var(--accent-dark);
}

.trend-figure figcaption {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.history-status {
  padding-top: 0.55rem;
}

.history-ledger {
  margin-top: 0.45rem;
}

.history-ledger-heading {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--ink);
}

.history-ledger-heading h3 {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.history-ledger-heading > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-align: right;
}

.history-point-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-point-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem var(--space-3);
  align-items: end;
  padding: 0.65rem 0;
  border-bottom: var(--thin-rule);
  font-variant-numeric: tabular-nums;
}

.history-point-period,
.history-point-value,
.history-point-total {
  display: grid;
  gap: 0.14rem;
}

.history-point-label,
.history-point-average,
.history-point-total strong {
  font-size: 0.84rem;
  line-height: 1.2;
}

.history-point-value,
.history-point-total {
  text-align: right;
}

.history-point-total {
  grid-column: 1 / -1;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding-top: 0.35rem;
  border-top: 1px dotted #777;
}

.history-point-coverage,
.history-point-value span,
.history-point-total span {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}

.history-point-row.is-current {
  border-bottom-width: 3px;
}

.history-list {
  border-top: var(--thin-rule);
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem var(--space-3);
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 3px solid var(--ink);
}

.history-time {
  margin-bottom: 0.2rem;
}

.history-macros {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.45;
}

.empty-copy {
  margin: 0;
  padding: 0.8rem 0;
  font-size: 0.82rem;
  font-weight: 700;
}

dialog {
  width: min(540px, calc(100% - 1rem));
  padding: 1rem;
  border: 4px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--ink);
  color: var(--ink);
}

dialog::backdrop {
  background: rgb(0 0 0 / 68%);
}

.dialog-heading {
  padding-bottom: 0.65rem;
  border-bottom: var(--medium-rule);
}

.dialog-heading h2 {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.target-fields {
  margin-top: var(--space-3);
}

.meal-edit-fields {
  display: grid;
  gap: 0.75rem;
  margin-top: var(--space-3);
}

.meal-edit-fields label {
  margin-bottom: 0;
}

.meal-edit-fields textarea {
  min-height: 112px;
  margin-top: -0.4rem;
  padding: 0.65rem;
}

.field-help {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0;
  text-transform: none;
}

.edit-meal-macros {
  margin-top: var(--space-3);
}

@media (min-width: 620px) {
  .app-shell {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
  }

  .label-sheet {
    box-shadow: 10px 10px 0 var(--ink);
  }

  .item-fields {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .item-identity-fields {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }

  .history-item {
    grid-template-columns: minmax(0, 1fr) minmax(220px, auto) auto;
  }

  .history-macros {
    grid-column: auto;
    text-align: right;
  }

  .history-point-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(100px, auto) minmax(100px, auto);
  }

  .history-point-total {
    grid-column: auto;
    grid-template-columns: none;
    padding-top: 0;
    border-top: 0;
  }
}

@media (max-width: 430px) {
  .facts-header h1 {
    font-size: clamp(2.15rem, 10.8vw, 2.9rem);
  }

  .serving-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }

  .serving-row strong {
    text-align: left;
  }

  .calorie-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.12rem;
  }

  .calorie-meta span:last-child {
    text-align: left;
  }

  .capture-actions,
  .draft-actions,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .photo-preview-panel {
    grid-template-columns: 1fr;
  }

  .photo-preview-panel img {
    height: min(56vw, 220px);
  }

  .section-code {
    display: none;
  }

  .signal-bars {
    gap: 2px;
  }

  .signal-bars i {
    width: 2px;
  }

  .photo-code {
    display: none;
  }

  .target-fields {
    grid-template-columns: 1fr;
  }

  .trend-heading {
    align-items: flex-end;
  }

  .history-ledger-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .history-ledger-heading > span {
    text-align: left;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .record-button[aria-pressed="true"] .signal-bars i {
    animation: level 650ms steps(3, end) infinite alternate;
  }

  .record-button[aria-pressed="true"] .signal-bars i:nth-child(2n) {
    animation-delay: 180ms;
  }

  .record-button[aria-pressed="true"] .signal-bars i:nth-child(3n) {
    animation-delay: 320ms;
  }

  @keyframes level {
    from { height: 22%; }
    to { height: 100%; }
  }
}
