:root {
  --bg: #FBF7F1;
  --surface: #FFFFFF;
  --ink: #2B2320;
  --ink-soft: #4A3F3A;
  --muted: #7A6E68;
  --line: #EFE6DA;
  --line-soft: #F1EAE0;
  --dash: #D8CCBE;
  --accent: #D9542F;
  --accent-dark: #B8421F;
  --accent-soft: rgba(217, 84, 47, 0.12);
  --amber: #F2B65C;
  --green: #4F9E64;
  --green-light: #9BD08A;
  --green-band: rgba(79, 158, 100, 0.16);
  --bar-past: #E4CFB3;
  --on-dark-muted: #BFB3AA;
  --photo-bg: #14100E;
  --radius-card: 20px;
  --radius-summary: 22px;
  --radius-field: 16px;
  --radius-thumb: 14px;
  --radius-chip: 999px;
  --font-text: 'Figtree', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --dur-fast: 150ms;
  --dur: 260ms;
  --dur-slow: 420ms;
  --dur-sheet: 320ms;
  --dur-count: 500ms;
  --dur-bar: 600ms;
  --dur-flash: 800ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-height: calc(60px + var(--safe-bottom));
  --page-x: 20px;
  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
    --dur-sheet: 0ms;
    --dur-count: 0ms;
    --dur-bar: 0ms;
    --dur-flash: 0ms;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input:not([readonly]):not([type="file"]),
textarea {
  -webkit-user-select: text;
  user-select: text;
}

input[readonly] {
  -webkit-user-select: none;
  user-select: none;
  caret-color: transparent;
}

.qty-card:has(input[readonly]) {
  pointer-events: none;
}

img {
  -webkit-user-drag: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input,
textarea {
  font-size: 16px;
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  min-width: 0;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

a {
  color: var(--accent);
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
  flex-shrink: 0;
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.display--tight {
  letter-spacing: -0.03em;
}

.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  height: auto;
  width: 100%;
  opacity: 0;
  animation: shell-in var(--dur-slow) var(--ease-out) forwards;
}

@keyframes shell-in {
  to {
    opacity: 1;
  }
}

.app-header {
  flex-shrink: 0;
  padding: calc(14px + var(--safe-top)) var(--page-x) 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-header:empty {
  display: none;
}

.view-host {
  position: relative;
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px var(--page-x) calc(var(--tabbar-height) + 88px);
}

.app--no-tabbar .view-host {
  padding-bottom: calc(24px + var(--safe-bottom));
}

.view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.view-enter {
  animation: view-in var(--dur) var(--ease-out) both;
}

.view-leave {
  animation: view-out var(--dur-fast) var(--ease-out) both;
  pointer-events: none;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes view-out {
  to {
    opacity: 0;
  }
}

.stagger > * {
  animation: stagger-in var(--dur) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

@keyframes stagger-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.crossfade-out {
  transition: opacity var(--dur-fast) var(--ease-out);
  opacity: 0;
}

.crossfade-in {
  animation: fade-in var(--dur) var(--ease-out) both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pressable {
  transition: transform 120ms var(--ease-out), opacity 120ms var(--ease-out);
  -webkit-user-select: none;
  user-select: none;
}

.pressable:active,
.pressable.is-pressed {
  transform: scale(0.97);
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-card);
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton--dark {
  background: var(--ink);
  opacity: 0.85;
}

.skeleton--line {
  height: 14px;
  border-radius: 7px;
  background: var(--line);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}

.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.avatar-hit {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -4px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 120ms var(--ease-out), opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.icon-btn--ghost {
  background: transparent;
}

.icon-btn--dark {
  background: rgba(255, 255, 255, 0.08);
  color: var(--bg);
}

.icon-btn-spacer {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.daynav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.daynav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  min-width: 0;
  flex-grow: 1;
}

.daynav-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}

.daynav-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.summary {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-summary);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.summary-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.summary-col--right {
  align-items: flex-end;
  text-align: right;
}

.summary-total {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.summary-caption {
  font-size: 13px;
  color: var(--on-dark-muted);
}

.summary-remaining {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--green-light);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.summary-remaining--over {
  color: var(--amber);
}

.summary-remaining--done {
  color: var(--green-light);
}

.progress {
  position: relative;
  height: 10px;
  border-radius: 6px;
  background: var(--ink-soft);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 6px;
  background: var(--amber);
  transition: width var(--dur-bar) var(--ease-out), background var(--dur) var(--ease-out);
}

.progress-fill--over {
  background: var(--accent);
}

.progress-target {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--green-light);
  opacity: 0.75;
}

.summary-scale {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--on-dark-muted);
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meal-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  width: 100%;
  color: inherit;
}

.meal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  color: inherit;
  min-height: 52px;
}

.meal-thumb {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-thumb);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.meal-thumb--empty {
  background: var(--bg);
}

.meal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.meal-thumb img.is-loaded {
  opacity: 1;
}

.meal-thumb-count {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(43, 35, 32, 0.85);
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meal-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-grow: 1;
  min-width: 0;
  text-align: left;
  color: inherit;
  min-height: 44px;
  justify-content: space-between;
}

.meal-info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex-grow: 1;
}

.meal-chevron {
  display: flex;
  align-items: center;
  color: var(--muted);
  opacity: 0.6;
  flex-shrink: 0;
}

.meal-name {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}

.meal-meta {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.2;
}

.meal-kcal {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.meal-kcal-unit {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.meal-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 64px;
}

.entry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  min-height: 44px;
  width: 100%;
  text-align: left;
  color: inherit;
  border-radius: 10px;
  padding: 0 2px 0 4px;
  margin-left: -4px;
  transition: background var(--dur-fast) var(--ease-out), transform 120ms var(--ease-out);
}

.entry-row:active {
  background: var(--bg);
  transform: scale(0.985);
}

.entry-chevron {
  display: flex;
  align-items: center;
  color: var(--muted);
  opacity: 0.7;
  flex-shrink: 0;
  margin-left: -4px;
}

.meal-extra {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex-shrink: 0;
  overflow: hidden;
  transition: height var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

.meal-extra.is-collapsing {
  opacity: 0;
}

.meal-extra.is-collapsed {
  height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.entry-row--flash {
  animation: row-flash var(--dur-flash) var(--ease-out) both;
}

@keyframes row-flash {
  0% {
    background: var(--accent-soft);
    box-shadow: 0 0 0 6px var(--accent-soft);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 6px transparent;
  }
}

.entry-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-amount {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.entry-kcal {
  color: var(--ink);
  font-weight: 600;
}

.meal-more {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  padding-top: 2px;
  min-height: 44px;
  display: flex;
  align-items: center;
  text-align: left;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.empty-state-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
}

.fab {
  position: absolute;
  right: 20px;
  bottom: calc(var(--tabbar-height) + 16px);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(217, 84, 47, 0.35);
  z-index: 5;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out), background var(--dur-fast);
}

.fab:active {
  transform: scale(0.94);
  background: var(--accent-dark);
}

.fab.is-hidden {
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--tabbar-height);
  background: var(--surface);
  box-shadow: 0 -1px 0 var(--line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px 4px var(--safe-bottom);
  z-index: 4;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

.app--no-tabbar .tabbar {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  min-height: 44px;
  transition: color var(--dur-fast) var(--ease-out), transform 120ms var(--ease-out);
}

.tabbar-item:active {
  transform: scale(0.94);
}

.tabbar-item svg {
  transition: transform var(--dur) var(--ease-out);
}

.tabbar-item.is-active {
  color: var(--accent);
}

.tabbar-item.is-active svg {
  transform: translateY(-1px);
}

.tabbar-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.tabbar-item.is-active .tabbar-label {
  font-weight: 700;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chips--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--page-x));
  padding: 0 var(--page-x);
  scrollbar-width: none;
}

.chips--scroll::-webkit-scrollbar {
  display: none;
}

.chip {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-chip);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform 120ms var(--ease-out);
}

.chip:active {
  transform: scale(0.96);
}

.chip.is-active {
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
}

.chip--ink {
  color: var(--ink);
}

.chip-meta {
  color: var(--muted);
  font-weight: 500;
}

.chip--dark {
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  min-height: 44px;
  padding: 0 16px;
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-field);
  padding: 0 16px;
  min-height: 56px;
  color: var(--muted);
  transition: box-shadow var(--dur-fast) var(--ease-out);
}

.search:focus-within {
  box-shadow: 0 0 0 2px var(--accent);
}

.search input {
  font-size: 17px;
  color: var(--ink);
  flex-grow: 1;
  min-height: 56px;
  caret-color: var(--accent);
}

.search-clear {
  width: 44px;
  height: 44px;
  margin-right: -12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.list {
  background: var(--surface);
  border-radius: var(--radius-field);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  min-height: 60px;
  width: 100%;
  text-align: left;
  color: inherit;
  position: relative;
  transition: background var(--dur-fast) var(--ease-out);
}

.list-item:active {
  background: var(--bg);
}

.list-item + .list-item::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 1px;
  background: var(--line-soft);
}

.list-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex-grow: 1;
}

.list-item-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.list-item-title mark {
  background: none;
  color: var(--accent);
}

.list-item-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.3;
}

.list-item-aside {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.list-item--action {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  justify-content: flex-start;
  gap: 10px;
  min-height: 56px;
}

.list-item--action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item--action-quiet {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.meal-chips {
  gap: 6px;
}

.meal-chips .chip {
  padding: 0 12px;
  font-size: 13px;
}

.search-failed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 4px 0;
}

.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet-root[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 35, 32, 0);
  transition: background var(--dur-sheet) var(--ease-sheet);
}

.sheet-root.is-open .sheet-backdrop {
  background: rgba(43, 35, 32, 0.45);
}

.sheet {
  position: relative;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  height: calc(100dvh - var(--safe-top) - 12px);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--dur-sheet) var(--ease-sheet);
  will-change: transform;
  box-shadow: 0 -8px 40px rgba(43, 35, 32, 0.12);
  touch-action: pan-y;
}

.sheet-root.is-open .sheet {
  transform: translateY(0);
}

.sheet.is-dragging {
  transition: none;
}

.sheet-root.is-dragging .sheet-backdrop {
  transition: none;
}

.sheet-root--popup {
  justify-content: flex-start;
  align-items: center;
  padding-top: calc(var(--safe-top) + 16px);
}

.sheet-root--popup .sheet-backdrop {
  transition: background var(--dur-fast) var(--ease-out);
}

.sheet-root--popup.is-open .sheet-backdrop {
  transition: background var(--dur) var(--ease-out);
}

.sheet-root--popup .sheet {
  width: calc(100% - 32px);
  max-width: 420px;
  height: clamp(360px, calc(100dvh - 420px), 520px);
  border-radius: 28px;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
  will-change: transform, opacity;
  box-shadow: 0 18px 48px rgba(43, 35, 32, 0.22);
  touch-action: auto;
}

.sheet-root--popup.is-open .sheet {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

.sheet-root--popup .sheet-grip {
  display: none;
}

.sheet-root--popup .sheet-step-top {
  padding-top: 14px;
  gap: 12px;
  touch-action: auto;
}

.sheet-root--popup .sheet-step-top .chip {
  flex-shrink: 0;
}

.sheet-grip {
  display: flex;
  justify-content: center;
  padding: 10px 0 2px;
  flex-shrink: 0;
  cursor: grab;
}

.sheet-grip-bar {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--dash);
}

.sheet-body {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex-grow: 1;
}

.sheet-steps {
  position: relative;
  overflow: hidden;
  width: 100%;
  flex-grow: 1;
  min-height: 0;
}

.sheet-step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

.sheet-step[data-pos="left"] {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

.sheet-step[data-pos="right"] {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.sheet-step-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 6px var(--page-x) 14px;
  flex-shrink: 0;
  touch-action: none;
}

.sheet-step-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 4px var(--page-x) calc(24px + var(--safe-bottom) + var(--kb, 0px));
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex-grow: 1;
  min-height: 0;
  touch-action: pan-y;
  transition: padding-bottom var(--dur-fast) var(--ease-out);
}

.sheet-step-scroll > * {
  flex-shrink: 0;
}

.sheet-step-scroll--tight {
  gap: 16px;
}

.sheet-step-scroll--footed {
  padding-bottom: 16px;
}

.sheet-foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px var(--page-x) calc(12px + max(var(--safe-bottom), var(--kb, 0px)));
  background: var(--bg);
  box-shadow: 0 -14px 18px -14px rgba(43, 35, 32, 0.14);
  transition: padding-bottom var(--dur-fast) var(--ease-out);
}

.sheet-foot-extra {
  margin-bottom: -6px;
}

.sheet-foot-extra--danger {
  color: var(--accent);
}

.sheet-zone {
  position: relative;
  display: flex;
  flex-direction: column;
}

.sheet-zone-panel {
  transition: opacity 120ms var(--ease-out);
}

.sheet-zone-panel.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.sheet-zone-panel.is-entering {
  animation: fade-in 200ms var(--ease-out) both;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.sheet-head-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  flex-grow: 1;
  min-width: 0;
}

.sheet-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}

.sheet-title-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  min-height: 44px;
  margin: -8px 0 -6px;
  padding: 0 6px;
  border-radius: 12px;
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease-out), transform 120ms var(--ease-out);
}

.sheet-title-btn:active {
  background: var(--surface);
  transform: scale(0.97);
}

.sheet-title-btn svg {
  flex-shrink: 0;
  color: var(--muted);
}

.sheet-title-btn .sheet-title {
  min-width: 0;
}

.sheet-title-btn .sheet-title--display {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: center;
  line-height: 1.15;
}

.sheet-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}

.sheet-title--display {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.sheet-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.qty-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qty-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  transition: box-shadow var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
  position: relative;
  cursor: text;
}

.qty-card:focus-within {
  box-shadow: 0 0 0 2px var(--accent);
}

.qty-card.is-locked {
  cursor: default;
}

.qty-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.qty-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.qty-input {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  caret-color: var(--accent);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input--accent {
  color: var(--accent);
}

.qty-input[readonly] {
  pointer-events: none;
}

.qty-unit {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
  height: 44px;
  margin: -6px 0;
  overflow: hidden;
}

.calc-note {
  font-size: 13px;
  line-height: 1.3;
  color: var(--muted);
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chips--shortcuts {
  min-height: 44px;
}

.chips--shortcuts:empty {
  display: none;
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -4px;
}

.rate-panel-host:empty {
  display: none;
}

.rate-form {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.rate-form.is-entering {
  animation: qty-swap var(--dur) var(--ease-out) both;
}

.rate-form.is-leaving {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}

.rate-form .field {
  background: var(--bg);
}

.photo-hint {
  min-height: 20px;
}

.link-btn {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  min-height: 44px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  margin: -6px -4px;
}

.field {
  background: var(--surface);
  border-radius: var(--radius-field);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 56px;
  transition: box-shadow var(--dur-fast) var(--ease-out);
}

.field:focus-within {
  box-shadow: 0 0 0 2px var(--accent);
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  font-size: 16px;
  color: var(--ink);
  line-height: 1.4;
  padding: 0;
  resize: none;
  caret-color: var(--accent);
}

.field textarea {
  min-height: 22px;
  max-height: 120px;
}

.field-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.field-suffix {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.photo-pick {
  display: flex;
  gap: 14px;
  align-items: center;
}

.photo-drop {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 18px;
  border: 1.5px dashed var(--dash);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  transition: transform 120ms var(--ease-out), border-color var(--dur-fast);
}

.photo-drop:active {
  transform: scale(0.96);
}

.photo-drop.has-photo {
  border-style: solid;
  border-color: transparent;
}

.photo-drop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: fade-in var(--dur) var(--ease-out) both;
}

.photo-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.photo-remove::before {
  content: '';
  position: absolute;
  inset: -8px;
}

.photo-remove {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(43, 35, 32, 0.8);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.photo-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.photo-text-title {
  font-size: 15px;
  font-weight: 600;
}

.btn {
  min-height: 54px;
  border-radius: var(--radius-field);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  width: 100%;
  padding: 0 16px;
  transition: transform 120ms var(--ease-out), opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.btn--primary {
  background: var(--accent);
  color: #FFFFFF;
}

.btn--primary:active {
  background: var(--accent-dark);
}

.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  min-height: 48px;
  font-size: 15px;
  font-weight: 600;
}

.btn--danger {
  background: var(--surface);
  color: var(--accent);
  min-height: 48px;
  font-size: 15px;
  font-weight: 600;
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
}

.btn--compact {
  width: auto;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 14px;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn.is-busy {
  pointer-events: none;
  opacity: 0.75;
}

.toast-root {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tabbar-height) + 12px + var(--safe-bottom) * 0);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-field);
  padding: 10px 10px 10px 16px;
  min-height: 52px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 32px rgba(43, 35, 32, 0.25);
  transform: translateY(20px);
  opacity: 0;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

.toast.is-in {
  transform: translateY(0);
  opacity: 1;
}

.toast-text {
  flex-grow: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  min-width: 0;
}

.toast-action {
  color: var(--amber);
  font-weight: 700;
  font-size: 14px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.toast-action:active {
  background: rgba(255, 255, 255, 0.08);
}

.toast--error {
  background: var(--accent-dark);
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--photo-bg);
  color: var(--bg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur-sheet) var(--ease-sheet);
  transform-origin: center;
  overflow: hidden;
}

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

.photo-viewer.is-open {
  opacity: 1;
}

.photo-viewer.is-dragging {
  transition: none;
}

.pv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(14px + var(--safe-top)) var(--page-x) 16px;
  flex-shrink: 0;
}

.pv-head-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.pv-title {
  font-weight: 700;
  font-size: 16px;
}

.pv-sub {
  color: var(--on-dark-muted);
  font-size: 13px;
}

.pv-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 55dvh;
}

.pv-track::-webkit-scrollbar {
  display: none;
}

.pv-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pv-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.pv-slide img.is-loaded {
  opacity: 1;
}

.pv-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 14px 0 6px;
  flex-shrink: 0;
  min-height: 26px;
}

.pv-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
  transition: width var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}

.pv-dot.is-active {
  width: 18px;
  background: var(--amber);
}

.pv-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px var(--page-x) calc(24px + var(--safe-bottom));
  overflow-y: auto;
  flex-grow: 1;
  min-height: 0;
}

.pv-body-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pv-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--on-dark-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pv-meta {
  font-size: 13px;
  color: var(--on-dark-muted);
}

.pv-rows {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
}

.pv-row-amount {
  color: var(--on-dark-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pv-row-kcal {
  color: var(--bg);
  font-weight: 600;
}

.pv-delete {
  align-self: center;
  color: var(--on-dark-muted);
  font-size: 13px;
  font-weight: 600;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.segmented {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-chip);
  padding: 4px;
}

.segmented-item {
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-chip);
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.segmented-item.is-active {
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
}

.segmented--fill {
  background: var(--bg);
  width: 100%;
}

.segmented--fill .segmented-item {
  flex: 1 1 0;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  text-align: center;
}

.pref-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pref-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.stat-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-caption {
  font-size: 13px;
  color: var(--muted);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.stat-badge {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--muted);
}

.stat-badge--ok {
  color: var(--green);
}

.stat-badge--over {
  color: var(--accent);
}

.stat-badge--under {
  color: var(--amber);
}

.chart {
  position: relative;
  height: 150px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 22px;
}

.chart--dense {
  gap: 4px;
}

.chart-band {
  position: absolute;
  left: 0;
  right: 0;
  background: var(--green-band);
  pointer-events: none;
}

.chart-col {
  flex-grow: 1;
  flex-basis: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
  color: inherit;
}

.chart-bar {
  width: 100%;
  height: 0;
  border-radius: 8px 8px 4px 4px;
  background: var(--bar-past);
  transition: height var(--dur-bar) var(--ease-out), background var(--dur) var(--ease-out);
  min-height: 3px;
}

.chart--dense .chart-bar {
  border-radius: 4px 4px 2px 2px;
}

.chart-bar--empty {
  background: var(--line);
}

.chart-bar--over {
  background: var(--accent);
}

.chart-bar--today {
  background: var(--amber);
}

.chart-bar--ok {
  background: var(--green-light);
}

.chart-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  height: 14px;
  line-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  position: absolute;
  bottom: 0;
}

.chart-col {
  position: relative;
}

.chart-label--today {
  color: var(--ink);
  font-weight: 700;
}

.stat-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.weight-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.weight-note {
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
}

.day-item {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  color: inherit;
  min-height: 64px;
}

.day-item--empty {
  opacity: 0.7;
}

.day-thumbs {
  display: flex;
  flex-shrink: 0;
}

.day-thumb {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 0 0 2px var(--surface);
  background: var(--line);
  overflow: hidden;
}

.day-thumb + .day-thumb {
  margin-left: -10px;
}

.day-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.day-thumb img.is-loaded {
  opacity: 1;
}

.day-kcal {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding-left: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.day-kcal--muted {
  color: var(--muted);
  font-weight: 600;
}

.login {
  min-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 0 4px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.login-mark {
  width: 132px;
  height: 132px;
  display: block;
  filter: drop-shadow(0 14px 28px rgba(217, 84, 47, 0.32));
}

.login-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}

.login-slogan {
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-field {
  background: var(--surface);
  border-radius: var(--radius-field);
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  transition: box-shadow var(--dur-fast) var(--ease-out);
}

.login-field:focus-within {
  box-shadow: 0 0 0 2px var(--accent);
}

.login-field input {
  font-size: 17px;
  min-height: 56px;
  color: var(--ink);
  caret-color: var(--accent);
}

.login-error {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  min-height: 18px;
  animation: fade-in var(--dur) var(--ease-out) both;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.profile-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.profile-sub {
  font-size: 13px;
  color: var(--muted);
  padding-top: 2px;
}

.food-item-kcal {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.food-item-kcal--unit {
  text-align: right;
}

.food-item-kcal--unit .meal-kcal-unit {
  display: block;
  white-space: nowrap;
}

.measure-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.measure-modes .chip {
  background: var(--surface);
}

.measure-modes .chip.is-active {
  background: var(--ink);
  color: var(--bg);
}

.unit-main {
  background: var(--surface);
  border-radius: var(--radius-field);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.unit-main .field {
  background: var(--bg);
}

.unit-main-known {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
  color: var(--muted);
}

.unit-main-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.unit-main-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit-main-equiv {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  transition: color var(--dur-fast) var(--ease-out);
}

.unit-main-equiv.is-ready {
  color: var(--ink-soft);
  font-weight: 600;
}

.unit-row-principal {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-chip);
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.unit-row--principal .unit-row-principal {
  background: var(--amber);
  color: var(--ink);
}

.food-item-kcal--none {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.list-item--flash {
  animation: row-flash var(--dur-flash) var(--ease-out) both;
}

.food-new-dup {
  background: var(--accent-soft);
  border-radius: var(--radius-field);
  padding: 4px 16px;
  margin-top: -8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent-dark);
  animation: fade-in var(--dur) var(--ease-out) both;
}

.food-new-dup .link-btn {
  margin: 0 -4px;
}

.empty-state--action {
  gap: 10px;
}

.empty-state-btn {
  width: auto;
  min-height: 48px;
  margin-top: 8px;
  padding: 0 20px;
  font-size: 15px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notice {
  background: var(--surface);
  border-radius: var(--radius-field);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.notice--accent {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

@media (min-width: 600px) {
  .app {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px var(--line);
  }
  .sheet-root {
    align-items: center;
  }
  .sheet {
    width: 100%;
    max-width: 480px;
  }
  .toast-root {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(448px, calc(100vw - 32px));
  }
  .fab {
    right: calc(50% - 240px + 20px);
  }
}

@media (hover: hover) {
  .btn--primary:hover {
    background: var(--accent-dark);
  }
  .list-item:hover {
    background: var(--bg);
  }
  .chip:hover:not(.is-active) {
    color: var(--ink);
  }
}

.comida-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.comida-head-center {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
  min-width: 0;
}

.comida-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.comida-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comida-total {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.comida-total-unit {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}

.comida-photo-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comida-photos {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--line);
}

.comida-photo-skeleton {
  aspect-ratio: 4 / 3;
  width: 100%;
}

.comida-photo-track {
  display: flex;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.comida-photo-track::-webkit-scrollbar {
  display: none;
}

.comida-photo-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--line);
}

.comida-photo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.comida-photo-slide img.is-loaded {
  opacity: 1;
}

.comida-photo-slide--pending {
  cursor: default;
}

.upload-state {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  text-align: center;
  background: rgba(43, 35, 32, 0.5);
  color: var(--bg);
  animation: fade-in var(--dur) var(--ease-out) both;
  transition: opacity var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}

.upload-state[data-stage="error"] {
  background: rgba(43, 35, 32, 0.74);
}

.upload-state.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.upload-state--compact {
  gap: 0;
  padding: 0;
}

.upload-ring-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-state--compact .upload-ring-wrap {
  width: 56px;
  height: 56px;
}

.upload-state[data-stage="error"] .upload-ring-wrap {
  display: none;
}

.upload-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.upload-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 3;
}

.upload-ring-bar {
  fill: none;
  stroke: var(--amber);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 125.66;
  stroke-dashoffset: 125.66;
  transform-origin: 24px 24px;
  transition: stroke-dashoffset var(--dur) var(--ease-out), stroke var(--dur) var(--ease-out);
}

.upload-state.is-static .upload-ring-bar {
  transition: none;
}

.upload-state[data-stage="processing"] .upload-ring-bar {
  stroke: var(--accent);
  stroke-dashoffset: 94;
  animation: upload-spin 1s linear infinite;
}

.upload-state[data-stage="done"] .upload-ring-bar {
  stroke: var(--green-light);
  stroke-dashoffset: 0;
}

@keyframes upload-spin {
  to {
    transform: rotate(360deg);
  }
}

.upload-percent {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.upload-state--compact .upload-percent {
  font-size: 14px;
}

.upload-state:not([data-stage="upload"]) .upload-percent {
  opacity: 0;
}

.upload-check {
  position: absolute;
  color: var(--green-light);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

.upload-state[data-stage="done"] .upload-check {
  opacity: 1;
  transform: scale(1);
}

.upload-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  max-width: 260px;
}

.upload-error {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-state[data-stage="error"] .upload-error {
  display: flex;
  animation: fade-in var(--dur) var(--ease-out) both;
}

.upload-error-icon {
  color: var(--amber);
  display: flex;
}

.upload-error-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  max-width: 260px;
}

.upload-error-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-retry {
  min-width: 44px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-chip);
  background: var(--accent);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.upload-state--compact .upload-retry {
  width: 44px;
  height: 44px;
  padding: 0;
}

.upload-cancel {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-chip);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  opacity: 0.85;
}

.photo-hint.is-error {
  color: var(--accent);
  font-weight: 600;
}

.upload-skip {
  display: block;
  margin-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .upload-state[data-stage="processing"] .upload-ring-bar {
    animation: none;
  }
}

.comida-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.comida-dots .pv-dot {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 1px 4px rgba(20, 16, 14, 0.35);
}

.comida-dots .pv-dot.is-active {
  background: #FFFFFF;
}

.comida-photo-actions {
  display: flex;
  gap: 8px;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.comida-photo-actions.is-busy,
.comida-action.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.comida-action {
  position: relative;
  flex: 1 1 0;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.comida-action input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.comida-action--danger {
  color: var(--accent);
}

.comida-photo-empty {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 96px;
  border: 1.5px dashed var(--dash);
  border-radius: var(--radius-card);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), border-color var(--dur-fast);
}

.comida-photo-empty:active {
  border-color: var(--accent);
}

.comida-photo-empty input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.comida-list {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 10px 0 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.comida-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 4px 16px 6px;
}

.comida-list-meta {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.comida-rows {
  display: flex;
  flex-direction: column;
}

.comida-row {
  position: relative;
  overflow: hidden;
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

.comida-row.is-removing {
  opacity: 0;
  transform: translateX(-24px);
  pointer-events: none;
}

.comida-row-delete {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 88px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.comida-row.is-swiping .comida-row-delete {
  opacity: 1;
}

.comida-row-delete:active {
  background: var(--accent-dark);
}

.comida-entry {
  position: relative;
  background: var(--surface);
  border-radius: 0;
  margin: 0;
  padding: 0 12px 0 16px;
  min-height: 52px;
  touch-action: pan-y;
  transition: transform var(--dur) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.comida-row + .comida-row .comida-entry::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--line-soft);
}

.comida-entry-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex-grow: 1;
}

.comida-entry-note {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comida-delete-all {
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform 120ms var(--ease-out);
}

.comida-delete-all.is-confirming {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.comida-delete-all.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.meal-name .meal-hidden-tag {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.meal-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px 0 16px;
  background: var(--surface);
  border-radius: var(--radius-field);
  color: var(--muted);
  text-align: left;
}

.meal-compact-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-compact-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  flex-shrink: 0;
}

.meal-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.meal-extra-chip {
  min-height: 44px;
  padding: 0 16px 0 12px;
  background: transparent;
  color: var(--muted);
  border: 1.5px dashed var(--dash);
  gap: 4px;
}

.meal-extra-chip:active {
  border-color: var(--accent);
  color: var(--ink);
}

.meal-admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meal-admin-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  border-radius: var(--radius-field);
  background: var(--bg);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

.meal-admin-row.is-hidden .meal-admin-name {
  color: var(--muted);
}

.meal-admin-row.is-dragging {
  transition: box-shadow var(--dur-fast) var(--ease-out);
  box-shadow: 0 10px 28px rgba(43, 35, 32, 0.18);
  background: var(--surface);
  position: relative;
  z-index: 2;
}

.meal-admin-row.is-settling {
  position: relative;
  z-index: 2;
}

.meal-admin-handle {
  width: 44px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0.7;
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
}

.meal-admin-row.is-dragging .meal-admin-handle {
  cursor: grabbing;
  opacity: 1;
}

.meal-admin-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
  min-width: 0;
  min-height: 52px;
  justify-content: center;
  text-align: left;
  color: inherit;
}

.meal-admin-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-admin-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
}

.meal-admin-add {
  gap: 6px;
}

.switch {
  min-width: 56px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 4px;
}

.switch-track {
  position: relative;
  display: block;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--dash);
  transition: background var(--dur) var(--ease-out);
}

.switch[aria-checked="true"] .switch-track {
  background: var(--green);
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(43, 35, 32, 0.2);
  transition: transform var(--dur) var(--ease-out);
}

.switch[aria-checked="true"] .switch-knob {
  transform: translateX(18px);
}

.sheet:has(.meal-edit) {
  height: auto;
  max-height: calc(100dvh - var(--safe-top) - 12px);
}

.meal-edit {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.meal-edit-body {
  flex-grow: 0;
}

.meal-edit-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meal-edit-block .field-label {
  padding-left: 4px;
}

.meal-edit-block .segmented--fill {
  background: var(--surface);
}

.meal-edit-block .hint {
  padding-left: 4px;
  min-height: 20px;
}

.meal-edit-hours-row {
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.meal-edit-hours-sep {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--muted);
}

.select-wrap select {
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  padding: 0 22px 0 0;
  min-height: 32px;
  -webkit-appearance: none;
  appearance: none;
}

.select-wrap svg {
  position: absolute;
  right: 2px;
  pointer-events: none;
}

.meal-edit-note {
  text-align: center;
  padding: 6px 0;
}

.sheet-step-top .chips--scroll {
  touch-action: pan-x;
}

.day-export {
  margin-top: 10px;
  min-height: 44px;
  width: 100%;
  border: 0;
  border-radius: var(--radius-field);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.day-export:active {
  color: var(--ink);
  background: var(--surface);
}

.ai-ask {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px 0 12px;
  border-radius: var(--radius-chip);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 120ms var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.ai-ask:active {
  transform: scale(0.97);
}

.ai-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 12px;
  margin: -12px 0 -8px;
}

.ai-row .link-btn {
  gap: 6px;
}

.link-btn--muted {
  color: var(--muted);
  font-weight: 600;
}

.ai-again {
  gap: 6px;
  flex-shrink: 0;
}

.sheet-step-scroll.is-ai-busy > *:not(.ai-lock-path) {
  opacity: 0.38;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease-out);
}

.ai-card-foot--waiting,
.unit-ai-foot--waiting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-cancel {
  flex-shrink: 0;
  min-height: 44px;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-more {
  align-self: center;
}

.post {
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
}

.post-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.post-who {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-grow: 1;
  min-width: 0;
}

.post-who b {
  font-size: 15px;
  font-weight: 700;
}

.post-who span {
  font-size: 12.5px;
  color: var(--muted);
}

.post-delete-confirm {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.post-photos {
  position: relative;
}

.post-photo-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.post-photo-track::-webkit-scrollbar {
  display: none;
}

.post-photo {
  flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 4 / 3;
  background: var(--bg);
}

.post-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.post-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.post-dot.is-active {
  background: #FFFFFF;
  transform: scale(1.25);
}

.post-body {
  padding: 12px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.post-dish {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.post-text {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  white-space: pre-wrap;
}

.post-items-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 14px 0;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-chip);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  align-self: flex-start;
}

.post-items-toggle svg {
  transition: transform var(--dur) var(--ease-out);
}

.post-items-toggle.is-open svg {
  transform: rotate(180deg);
}

.post-items {
  display: flex;
  flex-direction: column;
  padding: 6px 14px 0;
}

.post-items--preview {
  padding: 0;
  background: var(--surface);
  border-radius: var(--radius-field);
}

.post-items--preview .post-item {
  padding: 10px 14px;
}

.post-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  box-shadow: inset 0 -1px 0 var(--line);
}

.post-item:last-child {
  box-shadow: none;
}

.post-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-item-amount {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.post-item-amount b {
  color: var(--ink);
  font-weight: 700;
}

.post-actions {
  display: flex;
  gap: 6px;
  padding: 10px 10px 10px;
  flex-wrap: wrap;
}

.post-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-chip);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform 120ms var(--ease-out);
}

.post-action:active {
  transform: scale(0.96);
}

.post-action.is-on {
  color: var(--accent);
}

.post-action span:empty {
  display: none;
}

.inspirations {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inspiration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inspiration {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 3 / 4;
  display: block;
  transition: transform 120ms var(--ease-out);
}

.inspiration:active {
  transform: scale(0.97);
}

.inspiration img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.inspiration-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 10px 10px;
  background: linear-gradient(to top, rgba(20, 16, 14, 0.82), rgba(20, 16, 14, 0));
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inspiration-big {
  display: block;
  width: 100%;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg);
}

.inspiration-big img {
  width: 100%;
  display: block;
  max-height: 46vh;
  object-fit: cover;
}

.composer-photos {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.composer-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.composer-thumbs:empty {
  display: none;
}

.composer-thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: var(--radius-thumb);
  overflow: hidden;
  background: var(--surface);
}

.composer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.composer-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(20, 16, 14, 0.72);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer-thumb-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 6px 4px;
  background: linear-gradient(to top, rgba(20, 16, 14, 0.8), rgba(20, 16, 14, 0));
  color: #FFFFFF;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}

.composer-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-field);
  border: 1.5px dashed var(--dash);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  align-self: flex-start;
}

.composer-add input {
  display: none;
}

.composer-items {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-field);
  background: var(--surface);
  text-align: left;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.composer-items.is-off {
  opacity: 0.5;
}

.composer-items-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background var(--dur-fast) var(--ease-out);
}

.composer-items.is-off .composer-items-check {
  background: var(--dash);
}

.composer-items-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.composer-items-text b {
  font-size: 15px;
  font-weight: 700;
}

.composer-items-text span {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.comida-share {
  width: 100%;
  gap: 8px;
}

.scan-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 16px;
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: transform 120ms var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.scan-btn > svg {
  color: var(--accent);
  flex-shrink: 0;
}

.scan-btn:active {
  transform: scale(0.98);
}

.scan-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.scan-btn-title {
  font-size: 15px;
  font-weight: 700;
}

.scan-btn-sub {
  font-size: 12px;
  color: var(--muted);
}

.scan-input {
  display: none;
}

.scan-host:empty {
  display: none;
}

.scan-host .scan-card {
  margin-top: 0;
}

.scan-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.scan-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-thumb);
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
}

.scan-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scan-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  padding-top: 4px;
}

.scan-message {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  align-self: center;
}

.scan-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  min-width: 0;
}

.scan-card .scan-name {
  background: var(--bg);
  padding: 10px 14px;
  min-height: 52px;
}

.scan-brand {
  font-size: 13px;
  color: var(--muted);
  padding-left: 2px;
}

.scan-facts {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.scan-kcal {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scan-kcal small {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.scan-kcal--none {
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--muted);
}

.scan-unit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  padding-bottom: 6px;
}

.scan-existing {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.5;
}

.scan-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.scan-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.scan-buttons .scan-btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
}

.scan-buttons .scan-btn-title {
  font-size: 14px;
}

.scan-buttons .scan-btn-sub {
  font-size: 11.5px;
  line-height: 1.3;
}

.plate-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-field);
  background: var(--bg);
  overflow: hidden;
}

.plate-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.plate-summary {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.plate-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plate-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg);
  border-radius: var(--radius-field);
  padding: 10px 12px 10px 8px;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.plate-item.is-off {
  opacity: 0.45;
}

.plate-check {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  flex-shrink: 0;
  position: relative;
}

.plate-check::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--green);
  transition: background var(--dur-fast) var(--ease-out);
}

.plate-check svg {
  position: relative;
}

.plate-item.is-off .plate-check::before {
  background: var(--dash);
}

.plate-item-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  min-width: 0;
}

.plate-item-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  padding: 4px 0 0;
  width: 100%;
}

.plate-item-amount {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.plate-item-grams {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 600;
}

.plate-item-grams input {
  width: 56px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border-radius: 8px;
  padding: 4px 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.plate-item-kcal {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.plate-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.plate-item-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--radius-chip);
  padding: 3px 8px;
}

.plate-item-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.plate-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 2px 0;
}

.plate-total-kcal {
  color: var(--ink);
}

.plate-total-kcal b {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.plate-actions .btn {
  width: 100%;
}

.plate-hint {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plate-card .plate-hint-field {
  background: var(--bg);
  padding: 10px 14px;
  min-height: 52px;
}

.ai-host:empty {
  display: none;
}

.ai-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: stagger-in var(--dur) var(--ease-out) both;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.ai-card.is-leaving {
  opacity: 0;
}

.ai-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ai-card-titles {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}

.ai-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.ai-card-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.ai-card-close {
  margin: -6px -8px 0 0;
  color: var(--muted);
}

.ai-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-skeleton-option {
  height: 64px;
  border-radius: var(--radius-field);
  background: var(--line-soft);
}

.ai-option {
  background: var(--bg);
  border-radius: var(--radius-field);
  display: flex;
  flex-direction: column;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.ai-card.is-busy .ai-option {
  opacity: 0.55;
  pointer-events: none;
}

.ai-card.is-busy .ai-option.is-picking {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--accent);
}

.ai-option-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  min-height: 60px;
  width: 100%;
  text-align: left;
  color: inherit;
  transition: transform 120ms var(--ease-out);
}

.ai-option-main:active {
  transform: scale(0.98);
}

.ai-option-text {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-option-label {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.ai-option-basis {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.ai-option-kcal,
.ai-option-grams {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.ai-option-kcal small,
.ai-option-grams small {
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  margin-top: 4px;
}

.ai-option-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 0 14px 10px;
  font-size: 12px;
  color: var(--muted);
}

.ai-option-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  padding: 0 14px 12px;
  margin-top: -4px;
}

.ai-option-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: -10px 0;
  padding: 0 2px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.ai-option-source--plain {
  color: var(--muted);
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-chip);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ai-badge--high {
  background: var(--green-band);
  color: var(--green);
}

.ai-badge--mid {
  background: var(--amber);
  color: var(--ink);
}

.ai-badge--low {
  background: var(--line);
  color: var(--muted);
}

.ai-badge--tiny {
  min-height: 18px;
  padding: 0 6px;
  font-size: 10px;
}

.ai-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: -4px;
}

.ai-card-cached {
  font-size: 12px;
}

.food-item-origin {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.ai-origin {
  background: var(--surface);
  border-radius: var(--radius-field);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.ai-origin .ai-option-source {
  min-height: 44px;
  margin: -12px 0;
}

.ai-origin-note {
  width: 100%;
}

.ai-wait {
  min-height: 20px;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.qty-value--units {
  align-items: baseline;
}

.qty-value.is-swapping {
  animation: qty-swap var(--dur) var(--ease-out) both;
}

@keyframes qty-swap {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.qty-input--count {
  width: 1.3ch;
  min-width: 1.3ch;
  max-width: 60%;
  flex: 0 0 auto;
}

.qty-unit--stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
  transform: translateY(2px);
}

.qty-unit-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.1;
  transition: color var(--dur-fast) var(--ease-out);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qty-equiv {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
  min-height: 44px;
  padding: 0 6px;
  margin: -10px 0 -10px -6px;
  border-radius: 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.qty-equiv:active {
  background: var(--bg);
  color: var(--ink);
}

.qty-unit-name.is-placeholder {
  color: var(--muted);
  font-weight: 600;
}

.qty-equiv.is-pending {
  color: var(--accent-dark);
}

.measure {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: -4px;
}

.measure-chips {
  min-height: 44px;
}

.measure-chips .chip.is-active .chip-meta {
  color: var(--on-dark-muted);
}

.measure-chips > .is-entering {
  animation: stagger-in var(--dur) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.chips--shortcuts.is-swapping {
  animation: qty-swap var(--dur) var(--ease-out) both;
}

.unit-form-hint {
  margin-top: -2px;
}

.unit-chip-add {
  background: transparent;
  color: var(--muted);
  border: 1.5px dashed var(--dash);
  gap: 4px;
  padding-left: 10px;
}

.unit-chip-add:active {
  border-color: var(--accent);
  color: var(--ink);
}

.unit-panel-host:empty {
  display: none;
}

.unit-form {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.unit-form.is-entering {
  animation: qty-swap var(--dur) var(--ease-out) both;
}

.unit-form.is-leaving {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
}

.unit-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -6px -10px -6px 0;
}

.unit-form-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.unit-form-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit-form .field {
  background: var(--bg);
}

.unit-name-chips {
  margin: 0 -16px;
  padding: 2px 16px;
}

.unit-name-custom {
  margin-top: 2px;
}

.unit-weigh {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unit-weigh-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.unit-weigh-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.unit-weigh-result {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  min-height: 18px;
  transition: color var(--dur-fast) var(--ease-out);
}

.unit-weigh-result.is-ready {
  color: var(--green);
}

.unit-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.unit-form-modes {
  gap: 6px;
}

.unit-form-modes .chip {
  background: var(--bg);
  padding: 0 12px 0 10px;
  gap: 5px;
  font-size: 13px;
}

.unit-form-modes .chip.is-active {
  background: var(--ink);
}

.unit-ai {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unit-ai-lead {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.unit-ai-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unit-ai-loading,
.unit-ai-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.unit-ai .ai-option {
  transition: opacity var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.unit-ai .ai-option.is-active {
  box-shadow: 0 0 0 2px var(--accent);
}

.unit-ai-message {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.unit-ai-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.unit-ai-match {
  color: var(--green);
  font-weight: 600;
}

.unit-form .ai-origin {
  background: var(--bg);
}

.units-block {
  background: var(--surface);
  border-radius: var(--radius-field);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.units-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.units-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.units-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.units-rows:empty {
  display: none;
}

.units-empty {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.unit-row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 48px;
  border-radius: 12px;
  background: var(--bg);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.unit-row.is-dragging {
  transition: box-shadow var(--dur-fast) var(--ease-out);
  box-shadow: 0 10px 28px rgba(43, 35, 32, 0.18);
  background: var(--surface);
  position: relative;
  z-index: 2;
}

.unit-row.is-settling {
  position: relative;
  z-index: 2;
}

.unit-row.is-editing {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.unit-row.is-editing .unit-row-chevron {
  color: var(--accent);
  opacity: 1;
}

.unit-row-handle {
  width: 40px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0.7;
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
}

.unit-row-handle--off {
  width: 12px;
  cursor: default;
}

.unit-row.is-dragging .unit-row-handle {
  cursor: grabbing;
  opacity: 1;
}

.unit-row-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-grow: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 4px;
  text-align: left;
  color: inherit;
}

.unit-row-name {
  font-size: 15px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-row-grams {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.unit-row-chevron {
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0.7;
  flex-shrink: 0;
  transition: color var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.units-form-host:empty {
  display: none;
}

.units-add {
  align-self: flex-start;
  min-height: 44px;
  background: var(--bg);
}

.food-item-units {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login--compact {
  gap: 22px;
  justify-content: flex-start;
  padding-top: 24px;
  min-height: 0;
}

.login-brand--compact {
  gap: 6px;
}

.login-brand--compact .login-mark {
  width: 76px;
  height: 76px;
  filter: drop-shadow(0 8px 18px rgba(217, 84, 47, 0.28));
}

.login-brand--compact .login-title {
  font-size: 22px;
}

.auth-panel {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.auth-panel--out {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.auth-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  padding: 0 4px;
}

.auth-heading-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.auth-heading-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-notice {
  background: var(--surface);
  border-radius: var(--radius-field);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  color: var(--ink-soft);
}

.auth-notice--error {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.login-field--password {
  position: relative;
  padding-right: 52px;
}

.login-field input {
  width: 100%;
  min-width: 0;
}

.auth-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease-out), transform 120ms var(--ease-out);
}

.auth-eye:active {
  transform: translateY(-50%) scale(0.92);
}

.auth-eye[aria-pressed="true"] {
  color: var(--accent);
}

.login-error {
  transition: opacity var(--dur-fast) var(--ease-out);
  opacity: 0;
}

.login-error.is-visible {
  opacity: 1;
}

.login-error--ok {
  color: var(--green);
}

.login-form .btn--secondary {
  min-height: 52px;
}

.auth-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.auth-foot {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.auth-foot a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 2px 4px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--dash);
}

.btn--google {
  background: var(--surface);
  color: var(--ink);
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  min-height: 52px;
}

.btn--google:active {
  background: var(--line-soft);
}

a.btn {
  text-decoration: none;
}

.auth-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.auth-hint {
  text-align: center;
  padding: 0 6px;
}

.auth-note {
  background: var(--surface);
  border-radius: var(--radius-field);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  text-align: center;
}

.auth-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 6px 4px 2px;
}

.auth-result-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  animation: auth-pop var(--dur-slow) var(--ease-out) both;
}

.auth-result--ok .auth-result-icon {
  background: var(--green-band);
  color: var(--green);
}

.auth-result--pending .auth-result-icon {
  animation: none;
}

.auth-result-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.auth-result-text {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
}

@keyframes auth-pop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.auth-inline-form {
  display: flex;
  flex-direction: column;
}

.account-card {
  gap: 8px;
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -6px;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 6px;
  border-radius: 14px;
  text-align: left;
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease-out), transform 120ms var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.account-item:active {
  background: var(--bg);
  transform: scale(0.985);
}

.account-item--static {
  pointer-events: none;
}

.account-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-item-icon svg {
  width: 22px;
  height: 22px;
}

.account-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex-grow: 1;
}

.account-item-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}

.account-item-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.account-item-chevron {
  color: var(--muted);
  opacity: 0.6;
  flex-shrink: 0;
  display: flex;
}

.account-item--danger .account-item-title {
  color: var(--accent);
}

.account-item--danger .account-item-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.account-item.is-confirming {
  background: var(--accent-soft);
}

.account-item.is-confirming .account-item-title {
  color: var(--accent-dark);
  font-weight: 700;
}

.account-item.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.account-sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex-grow: 1;
}

.account-sheet .login-field {
  background: var(--surface);
}

.account-sheet .login-error {
  min-height: 0;
}

.account-warning {
  background: var(--accent-soft);
  border-radius: var(--radius-field);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-warning-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-dark);
}

.account-warning-text {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.account-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 2px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
  min-height: 44px;
}

.account-check input {
  width: 22px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.btn--delete {
  background: var(--accent);
  color: #FFFFFF;
}

.btn--delete:active {
  background: var(--accent-dark);
}
