:root {
  color-scheme: dark;
  --ink: #f3efec;
  --muted: #b7b0b0;
  --quiet: #8f898f;
  --bg: #1d1c22;
  --bg-deep: #17161b;
  --surface: #27262d;
  --surface-2: #302f37;
  --surface-3: #393741;
  --line: #44414b;
  --line-strong: #5a5662;
  --lime: #aac9b8;
  --lime-deep: #8eae9d;
  --lime-ink: #17231d;
  --blue: #a9bddb;
  --orange: #dfc09c;
  --coral: #dda9ab;
  --violet: #c2b3d8;
  --danger: #e7a3a7;
  --success: #a8c8b5;
  --radius: 18px;
  --radius-sm: 13px;
  --shadow: 0 18px 42px rgb(0 0 0 / .26);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); }
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg-deep);
  color: var(--ink);
  line-height: 1.35;
  overscroll-behavior-y: none;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

input, textarea, select, [contenteditable="true"] { user-select: text; -webkit-user-select: text; }

button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--lime); }
img, svg { display: block; }
svg { width: 24px; height: 24px; flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }

.app-shell {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  background: linear-gradient(180deg, #201f25, #1a191f);
}

.app-main {
  min-height: 100dvh;
  padding: calc(14px + var(--safe-top)) 18px calc(94px + var(--safe-bottom));
}

.app-main.focus-mode { padding-bottom: calc(88px + var(--safe-bottom)); }
.app-main.auth-mode { padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom)); }

.topbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar-copy { min-width: 0; }
.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.page-title {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(1.4rem, 7vw, 1.8rem);
  font-weight: 760;
  letter-spacing: -.035em;
  line-height: 1.06;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-subtitle { margin-top: 5px; color: var(--muted); font-size: .84rem; }

.icon-button, .avatar-button, .compact-button {
  min-width: 46px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.icon-button svg, .bottom-nav svg, .list-icon svg, .inline-icon svg { width: 21px; height: 21px; }
.avatar-button { border-radius: 50%; font-weight: 800; color: var(--lime); }
.icon-button:active, .avatar-button:active { transform: scale(.96); }

.back-cluster { display: flex; align-items: center; gap: 12px; min-width: 0; }
.back-cluster .topbar-copy { min-width: 0; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(72px + var(--safe-bottom));
  padding: 8px 10px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgb(30 29 35 / .96);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bottom-nav button {
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--quiet);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  font-size: .7rem;
  font-weight: 700;
}

.bottom-nav button.active { color: var(--lime); background: rgb(170 201 184 / .1); }
.bottom-nav button span { display: block; width: 100%; overflow: hidden; padding: 0 2px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

.stack { display: grid; gap: 14px; }
.stack.tight { gap: 9px; }
.stack.loose { gap: 20px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row.start { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.hidden { display: none !important; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 8px rgb(0 0 0 / .11), inset 0 1px rgb(255 255 255 / .025);
  padding: 16px;
}

.card.soft { background: var(--surface-2); }
.card.lime-tint { border-color: #566d62; background: #29332f; }
.card.danger-tint { border-color: #735357; background: #34272b; }
.card.compact { padding: 13px; }

.hero-card {
  position: relative;
  overflow: hidden;
  border-color: #586b63;
  background: #292c2d;
  padding: 18px;
}

.hero-card::after { content: none; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 20px 2px 10px; }
.section-heading h2 { font-size: 1rem; letter-spacing: -.015em; }
.section-heading p { color: var(--muted); font-size: .77rem; }

.kcal-line { display: flex; align-items: baseline; gap: 7px; margin-top: 8px; }
.kcal-value { font-size: clamp(2.25rem, 12vw, 3.25rem); font-weight: 780; line-height: .96; letter-spacing: -.055em; }
.kcal-unit { color: var(--muted); font-size: .86rem; font-weight: 650; }
.large-value { font-size: 1.65rem; font-weight: 760; letter-spacing: -.04em; }
.medium-value { font-size: 1.18rem; font-weight: 730; letter-spacing: -.025em; }
.label { color: var(--muted); font-size: .76rem; font-weight: 650; }
.caption { color: var(--muted); font-size: .78rem; line-height: 1.48; }
.micro { color: var(--quiet); font-size: .7rem; line-height: 1.4; }
.lime { color: var(--lime); }
.danger { color: var(--danger); }

.progress-track { width: 100%; height: 7px; overflow: hidden; border-radius: 99px; background: #45434b; }
.progress-track > span { display: block; height: 100%; width: var(--progress, 0%); border-radius: inherit; background: var(--accent, var(--lime)); transition: width .25s ease; }
.macro-strip { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.macro-cell { min-width: 0; }
.macro-cell .row { margin-bottom: 6px; gap: 4px; }
.macro-cell strong { font-size: .82rem; }
.macro-cell small { color: var(--quiet); font-size: .66rem; }

.primary-button, .secondary-button, .ghost-button, .danger-button, .text-button {
  min-height: 50px;
  border-radius: 15px;
  padding: 12px 16px;
  border: 1px solid transparent;
  font-weight: 760;
  line-height: 1.1;
  cursor: pointer;
}

.primary-button { background: var(--lime); color: var(--lime-ink); box-shadow: 0 5px 14px rgb(0 0 0 / .18); }
.secondary-button { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink); }
.ghost-button { border-color: var(--line); background: transparent; color: var(--ink); }
.danger-button { border-color: #5e3732; background: #281714; color: #ff978e; }
.text-button { min-height: 44px; padding: 9px 6px; background: transparent; color: var(--lime); }
.primary-button:active, .secondary-button:active, .ghost-button:active, .danger-button:active { transform: translateY(1px); filter: brightness(.96); }
.primary-button:disabled, .secondary-button:disabled { opacity: .45; pointer-events: none; }
.button-wide { width: 100%; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button-row.single { grid-template-columns: 1fr; }

.sticky-action {
  position: sticky;
  z-index: 12;
  bottom: calc(8px + var(--safe-bottom));
  margin: 22px -4px -2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgb(32 31 37 / .94);
  box-shadow: 0 -10px 26px rgb(0 0 0 / .28);
  backdrop-filter: blur(16px);
}

.action-card {
  width: 100%;
  min-height: 88px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 13px;
}

.action-card.primary { border-color: #61766b; background: #303a35; }
.action-card strong { display: block; margin-bottom: 3px; font-size: .93rem; }
.action-card small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.action-card > span:last-child { min-width: 0; }

.list { display: grid; gap: 9px; }
.list-row {
  width: 100%;
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
}

.list-row > .row { min-width: 0; }
.list-row > svg { width: 20px; height: 20px; color: var(--muted); }
.list-row .copy { min-width: 0; }
.list-row .copy strong { display: block; overflow: hidden; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.list-row .copy small { display: block; margin-top: 3px; color: var(--muted); font-size: .73rem; line-height: 1.35; }
.list-icon { width: 43px; height: 43px; flex: 0 0 auto; border-radius: 14px; background: var(--surface-3); color: var(--lime); display: grid; place-items: center; }
.list-icon.food { color: var(--orange); }
.list-icon.blue { color: var(--blue); }
.list-icon.violet { color: var(--violet); }
.list-actions { display: flex; align-items: center; gap: 7px; }
.inline-icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; }

.badge, .status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .67rem;
  font-weight: 750;
  white-space: nowrap;
}

.badge.lime, .status-pill.online { border-color: #5c7468; background: #303b36; color: #c8dfd2; }
.badge.orange { border-color: #74624f; background: #393129; color: #ead1b3; }
.badge.red, .status-pill.conflict { border-color: #77565a; background: #3b292d; color: #efb7ba; }
.status-pill.offline { border-color: #4b4231; color: #e5c37c; }

.segmented {
  display: grid;
  grid-template-columns: repeat(var(--segments, 2), 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #211f26;
}

.segmented button {
  min-height: 42px;
  padding: 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}
.segmented button.active { background: #383a3b; color: var(--lime); box-shadow: inset 0 0 0 1px #5b6962; }

.field { display: grid; gap: 7px; }
.field > label, .field-label { color: #cdd5d1; font-size: .78rem; font-weight: 690; }
.field-hint { color: var(--quiet); font-size: .7rem; }
input, select, textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  outline: 0;
  background: #211f26;
  color: var(--ink);
  padding: 12px 13px;
  appearance: none;
}
textarea { min-height: 92px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #61706a; }
input:focus, select:focus, textarea:focus { border-color: #819a8d; box-shadow: 0 0 0 3px rgb(170 201 184 / .13); }
input[type="checkbox"] { width: 23px; min-height: 23px; height: 23px; padding: 0; appearance: auto; -webkit-appearance: checkbox; accent-color: var(--lime); }
input[type="range"] { min-height: 42px; padding: 0; border: 0; background: transparent; accent-color: var(--lime); }
.input-unit { position: relative; }
.input-unit input { padding-right: 60px; }
.input-unit span { position: absolute; right: 13px; top: 50%; color: var(--muted); font-size: .78rem; transform: translateY(-50%); pointer-events: none; }
.form-error { min-height: 18px; color: #ff9d93; font-size: .75rem; }

.checkbox-row { display: flex; align-items: flex-start; gap: 11px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.checkbox-row label { flex: 1 1 auto; padding-top: 2px; cursor: pointer; }
.consent-block { display: grid; grid-template-columns: 24px 1fr; gap: 6px 11px; align-items: start; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.consent-block label { cursor: pointer; padding-top: 2px; }
.consent-link { grid-column: 2; justify-self: start; min-height: 36px; padding: 4px 0; }
.search-field { position: relative; }
.search-field input { padding-left: 42px; }
.search-field svg { position: absolute; left: 14px; top: 15px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }

.auth-wrap { min-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 48px); display: grid; align-content: space-between; gap: 28px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup img { width: 48px; height: 48px; }
.brand-lockup strong { display: block; font-size: 1.05rem; letter-spacing: -.02em; }
.brand-lockup small { display: block; margin-top: 2px; color: var(--muted); font-size: .75rem; }
.welcome-visual {
  position: relative;
  min-height: 245px;
  overflow: hidden;
  border: 1px solid #55515d;
  border-radius: 28px;
  background: #2c2b33;
  display: grid;
  place-items: center;
}
.welcome-visual::before, .welcome-visual::after { content: ""; position: absolute; border: 1px solid rgb(170 201 184 / .18); border-radius: 50%; }
.welcome-visual::before { width: 245px; height: 245px; }
.welcome-visual::after { width: 175px; height: 175px; }
.scale-mark { position: relative; z-index: 2; width: 128px; height: 128px; border: 10px solid var(--lime); border-top-color: #64796e; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 10px 30px rgb(0 0 0 / .2); }
.scale-mark img { width: 62px; height: 62px; }
.welcome-copy h1 { max-width: 330px; font-size: clamp(2rem, 10vw, 2.75rem); letter-spacing: -.055em; line-height: 1.02; }
.welcome-copy p { max-width: 360px; margin-top: 12px; color: var(--muted); line-height: 1.55; }
.auth-form { display: grid; gap: 14px; }
.auth-switch { text-align: center; color: var(--muted); font-size: .78rem; }
.language-switch { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.language-switch button { min-height: 38px; padding: 6px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: .72rem; font-weight: 700; }
.language-switch button.active { background: var(--surface-3); color: var(--lime); }

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 24px; }
.stepper span { height: 4px; border-radius: 99px; background: #27332e; }
.stepper span.active { background: var(--lime); }
.choice-grid { display: grid; gap: 9px; }
.choice {
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}
.choice strong { display: block; font-size: .88rem; }
.choice small { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; }
.choice.selected { border-color: #71887c; background: #303a35; box-shadow: inset 0 0 0 1px rgb(170 201 184 / .12); }

.scale-display {
  width: min(74vw, 290px);
  aspect-ratio: 1;
  margin: 18px auto;
  border: 1px solid #57535f;
  border-radius: 50%;
  background:
    radial-gradient(circle, #29272f 0 56%, transparent 57%),
    conic-gradient(var(--lime) var(--dial, 25%), #48454e 0);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgb(0 0 0 / .18), inset 0 0 0 10px #211f26;
}
.scale-display .inner { text-align: center; }
.scale-display strong { display: block; margin: 5px 0; color: var(--lime); font-size: clamp(2.8rem, 15vw, 4rem); letter-spacing: -.06em; line-height: 1; }
.scale-display span { color: var(--muted); font-size: .78rem; }
.scale-display.invalid strong { color: var(--danger); }

.quantity-control { display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.quantity-control.compact { padding: 11px; background: var(--surface-2); }
.quantity-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.quantity-heading label { color: var(--muted); font-size: .78rem; font-weight: 690; }
.quantity-heading output { color: var(--ink); font-size: .88rem; font-weight: 760; }
.quantity-control input[type="range"], .macro-range-row input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; min-height: 36px; margin: 0; padding: 0; border: 0; background: transparent; }
.quantity-control input[type="range"]::-webkit-slider-runnable-track, .macro-range-row input[type="range"]::-webkit-slider-runnable-track { height: 7px; border-radius: 99px; background: #4a4751; }
.quantity-control input[type="range"]::-webkit-slider-thumb, .macro-range-row input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -8.5px; border: 3px solid #28272d; border-radius: 50%; appearance: none; -webkit-appearance: none; background: var(--lime); box-shadow: 0 2px 7px rgb(0 0 0 / .28); }
.quantity-control input[type="range"]::-moz-range-track, .macro-range-row input[type="range"]::-moz-range-track { height: 7px; border: 0; border-radius: 99px; background: #4a4751; }
.quantity-control input[type="range"]::-moz-range-thumb, .macro-range-row input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 3px solid #28272d; border-radius: 50%; background: var(--lime); box-shadow: 0 2px 7px rgb(0 0 0 / .28); }
.quantity-stepper { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 10px; }
.quantity-stepper button, .macro-range-row button { min-width: 48px; min-height: 48px; padding: 0; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-3); color: var(--ink); display: grid; place-items: center; }
.quantity-stepper button svg, .macro-range-row button svg { width: 19px; height: 19px; }
.quantity-value { min-height: 48px; border-radius: 14px; background: #211f26; display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.quantity-value strong { font-size: 1.35rem; letter-spacing: -.035em; }
.quantity-value small { color: var(--muted); font-size: .72rem; }
.portion-options { display: flex; gap: 7px; overflow-x: auto; padding: 2px 1px 4px; scrollbar-width: none; }
.portion-options::-webkit-scrollbar { display: none; }
.portion-chip, .preset-chip { min-height: 45px; flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); color: var(--ink); text-align: left; }
.portion-chip span, .portion-chip small { display: block; }
.portion-chip span { font-size: .75rem; font-weight: 720; }
.portion-chip small { margin-top: 2px; color: var(--muted); font-size: .64rem; }
.portion-chip.active, .preset-chip.active { border-color: #71877c; background: #344039; color: #d8e8df; }

.maintenance-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 12px; }
.maintenance-card strong { grid-row: span 2; font-size: 1.3rem; }
.maintenance-card small { color: var(--quiet); font-size: .69rem; }
.macro-editor { display: grid; gap: 16px; }
.macro-editor-head { display: grid; grid-template-columns: 1fr 116px; align-items: center; gap: 12px; }
.macro-pie { width: 112px; aspect-ratio: 1; padding: 13px; border-radius: 50%; background: conic-gradient(var(--blue) 0 var(--protein-stop), var(--orange) var(--protein-stop) var(--carbs-stop), var(--coral) var(--carbs-stop) 360deg); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); }
.macro-pie > span { width: 100%; height: 100%; border-radius: 50%; background: #29282f; display: grid; place-content: center; text-align: center; }
.macro-pie strong, .macro-pie small { display: block; }
.macro-pie strong { font-size: 1.1rem; }
.macro-pie small { color: var(--muted); font-size: .62rem; }
.preset-row { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.preset-chip { text-align: center; font-size: .7rem; font-weight: 700; }
.macro-controls { display: grid; gap: 13px; }
.macro-allocation-control { display: grid; gap: 4px; }
.macro-allocation-control output { color: var(--macro-color); }
.macro-range-row { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; }
.macro-range-row button { min-width: 42px; min-height: 42px; }
.macro-range-row input[type="range"]::-webkit-slider-thumb { background: var(--macro-color); }
.macro-range-row input[type="range"]::-moz-range-thumb { background: var(--macro-color); }
.macro-gram-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.macro-gram-summary > span { min-width: 0; padding: 10px 6px; border-radius: 13px; background: #222127; text-align: center; }
.macro-gram-summary i { display: block; width: 7px; height: 7px; margin: 0 auto 6px; border-radius: 50%; background: var(--dot); }
.macro-gram-summary strong, .macro-gram-summary small { display: block; }
.macro-gram-summary strong { font-size: .82rem; }
.macro-gram-summary small { margin-top: 2px; color: var(--quiet); font-size: .62rem; }

.daily-hero { overflow: visible; }
.day-status { gap: 5px; max-width: 45%; white-space: normal; text-align: right; }
.day-status svg { width: 15px; height: 15px; }
.day-cycle { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin: 16px -4px -4px; padding: 11px; border-radius: 14px; background: rgb(28 28 32 / .42); }
.day-cycle p { color: var(--muted); font-size: .69rem; line-height: 1.4; }
.day-cycle button { min-height: 44px; padding: 9px 12px; font-size: .73rem; white-space: nowrap; }
.meal-primary-cta { min-height: 74px; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 11px; text-align: left; }
.meal-primary-cta span { display: grid; gap: 3px; }
.meal-primary-cta strong { font-size: .95rem; }
.meal-primary-cta small { opacity: .72; font-size: .69rem; }
.details-link { display: inline-flex; align-items: center; gap: 2px; }
.details-link svg { width: 16px; height: 16px; }
.history-preview { display: grid; gap: 16px; }
.history-preview > div > .row strong { font-size: .8rem; }
.history-preview > div > .row small { color: var(--quiet); font-size: .65rem; }
.history-divider { height: 1px; background: var(--line); }
.bar-chart { position: relative; height: 150px; margin-top: 12px; padding: 4px 2px 18px; display: grid; grid-template-columns: repeat(14,minmax(0,1fr)); align-items: end; gap: 3px; }
.bar-chart.compact { height: 96px; grid-template-columns: repeat(7,minmax(0,1fr)); }
.bar-column { position: relative; height: 100%; min-width: 0; display: grid; grid-template-rows: 1fr 14px; align-items: end; gap: 3px; text-align: center; }
.bar-track { position: relative; height: 100%; min-height: 20px; overflow: hidden; border-radius: 7px 7px 3px 3px; background: #3a3841; }
.bar-track i { position: absolute; inset: auto 0 0; height: var(--bar-height); border-radius: inherit; background: var(--violet); }
.bar-column small { color: var(--quiet); font-size: .57rem; }
.bar-value { position: absolute; z-index: 2; top: 3px; left: 50%; color: var(--muted); font-size: .5rem; transform: translateX(-50%); }
.bar-chart.compact .bar-value, .bar-chart.compact .goal-line { display: none; }
.goal-line { position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(18px + var(--goal-position)); border-top: 1px dashed rgb(170 201 184 / .6); pointer-events: none; }
.goal-line small { position: absolute; right: 0; bottom: 2px; color: var(--lime); font-size: .55rem; }
.mini-weight { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin-top: 8px; }
.mini-weight svg { width: 100%; height: 64px; }
.mini-weight polyline { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.mini-weight circle { fill: var(--blue); }
.mini-weight div, .single-weight { text-align: right; }
.mini-weight strong, .mini-weight small, .single-weight strong, .single-weight small { display: block; }
.mini-weight strong, .single-weight strong { font-size: .86rem; white-space: nowrap; }
.mini-weight small, .single-weight small { margin-top: 3px; color: var(--quiet); font-size: .62rem; }
.single-weight { margin-top: 18px; }
.mini-chart-empty { padding: 18px 0 2px; color: var(--quiet); font-size: .7rem; }

.add-ingredient-cta { min-height: 62px; margin-top: 14px; }
.finish-zone { display: grid; gap: 13px; margin-top: 28px; padding: 18px 4px 4px; border-top: 1px solid var(--line); }
.finish-zone p { margin-top: 5px; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.workspace-summary { border-left: 3px solid var(--lime); }
.target-card, .container-choice { display: grid; gap: 12px; }
.container-choice .quantity-control { margin-top: 2px; }
.final-net-card { text-align: center; }
.meal-add-food { min-height: 58px; margin-top: 14px; }
.meal-item-card { padding: 13px; }
.compact-actions { gap: 5px; }
.compact-actions .icon-button, .compact-actions .lock-button { min-width: 42px; width: 42px; min-height: 42px; }
.portion-reference-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.portion-reference-grid strong, .portion-reference-grid small { display: block; }
.portion-reference-grid strong { font-size: .78rem; }
.portion-reference-grid small { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.list-row.unavailable { opacity: .5; }

.prepared-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.prepared-grid > .empty-state { grid-column: 1 / -1; }
.prepared-card { min-width: 0; min-height: 250px; padding: 14px 11px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); color: var(--ink); display: grid; grid-template-rows: 120px auto auto; align-content: start; gap: 11px; text-align: left; }
.batch-vessel { position: relative; width: 82px; height: 112px; margin: 0 auto; overflow: hidden; border: 2px solid #66616d; border-top-width: 4px; border-radius: 12px 12px 27px 27px; background: #211f26; }
.batch-vessel::after { content: ""; position: absolute; inset: 7px; border-radius: 6px 6px 20px 20px; box-shadow: inset 8px 0 12px rgb(255 255 255 / .025); pointer-events: none; }
.batch-vessel > strong { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; color: #f2efec; font-size: .88rem; text-shadow: 0 1px 5px rgb(0 0 0 / .45); }
.batch-liquid { position: absolute; left: 0; right: 0; bottom: 0; height: var(--fill); background: #769688; transition: height .35s ease; }
.batch-liquid span { position: absolute; top: -7px; left: -25%; width: 150%; height: 15px; border-radius: 45%; background: #8eac9e; animation: gentle-wave 3.8s ease-in-out infinite alternate; }
.prepared-copy { min-width: 0; }
.prepared-copy strong, .prepared-copy small { display: block; }
.prepared-copy strong { overflow: hidden; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.prepared-copy small { margin-top: 4px; color: var(--muted); font-size: .64rem; line-height: 1.4; }
.macro-share-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; }
.macro-share-row i { padding: 5px 2px; border-radius: 8px; background: #211f26; font-size: .58rem; font-style: normal; font-weight: 730; text-align: center; }
.macro-share-row .protein { color: var(--blue); }.macro-share-row .carbs { color: var(--orange); }.macro-share-row .fat { color: var(--coral); }

.fridge-intro { display: flex; align-items: center; gap: 12px; }
.fridge-intro p { margin-top: 4px; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.fridge-search { margin-top: 13px; }
.fridge-empty-note { margin: 13px 0; padding: 13px; border: 1px dashed var(--line-strong); border-radius: 15px; background: var(--surface); }
.fridge-empty-note strong { font-size: .8rem; }.fridge-empty-note p { margin-top: 4px; color: var(--muted); font-size: .69rem; }
.fridge-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 13px; }
.fridge-card { position: relative; min-width: 0; min-height: 108px; padding: 11px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); display: grid; grid-template-columns: 38px 1fr 24px; align-items: center; gap: 8px; cursor: pointer; }
.fridge-card.on-hand { border-color: #64796f; background: #303934; }
.fridge-card-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-3); color: var(--orange); display: grid; place-items: center; }
.fridge-card-icon svg { width: 19px; height: 19px; }
.fridge-card .copy { min-width: 0; }
.fridge-card .copy strong { display: -webkit-box; overflow: hidden; font-size: .75rem; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.fridge-card .copy small { display: block; margin-top: 4px; color: var(--quiet); font-size: .62rem; }
.fridge-card input { width: 21px; min-height: 21px; height: 21px; justify-self: end; }
.fridge-check { display: none; }

.history-card + .history-card { margin-top: 12px; }
.section-heading.inside { margin: 0 0 8px; }
.history-day-total { text-align: right; }
.history-day-total strong, .history-day-total small { display: block; }
.history-day-total small { margin-top: 4px; color: var(--lime); font-size: .62rem; }
.history-day-total svg { width: 14px; height: 14px; }
.container-expected-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgb(169 189 219 / .72); outline-offset: 2px; }

@keyframes gentle-wave { from { transform: translateX(-5%) rotate(-2deg); } to { transform: translateX(5%) rotate(2deg); } }

.component-row { align-items: flex-start; }
.component-row .nutrition { margin-top: 5px; color: var(--muted); font-size: .71rem; }
.component-amount { text-align: right; flex: 0 0 auto; }
.component-amount strong { display: block; font-size: .88rem; }
.component-amount small { color: var(--muted); font-size: .68rem; }

.nutrition-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.nutrition-box { min-width: 0; padding: 10px 7px; border: 1px solid var(--line); border-radius: 13px; background: #232128; text-align: center; }
.nutrition-box strong { display: block; overflow: hidden; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.nutrition-box small { color: var(--quiet); font-size: .62rem; }

.empty-state { padding: 30px 18px; border: 1px dashed #33433c; border-radius: 18px; text-align: center; }
.empty-state .empty-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 18px; background: var(--surface-2); color: var(--lime); display: grid; place-items: center; }
.empty-state .empty-icon svg { width: 26px; height: 26px; }
.empty-state strong { display: block; font-size: .94rem; }
.empty-state p { max-width: 290px; margin: 7px auto 0; color: var(--muted); font-size: .77rem; line-height: 1.45; }

.inventory-meter { margin-top: 12px; }
.inventory-meter .row { margin-bottom: 7px; }
.inventory-meter .progress-track { height: 9px; }

.meal-dock { position: sticky; z-index: 12; bottom: calc(8px + var(--safe-bottom)); margin: 20px -4px 0; padding: 12px; border: 1px solid var(--line-strong); border-radius: 18px; background: rgb(37 36 43 / .96); box-shadow: 0 -10px 28px rgb(0 0 0 / .28); backdrop-filter: blur(16px); }
.meal-dock .primary-button { min-width: 115px; }
.portion-line { display: grid; grid-template-columns: 1fr 82px 40px; gap: 8px; align-items: center; }
.portion-line input { min-height: 44px; padding: 8px; text-align: right; }
.lock-button { width: 40px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.lock-button.active { border-color: #527934; color: var(--lime); background: #18251a; }

.sheet-backdrop { position: fixed; z-index: 80; inset: 0; background: rgb(0 0 0 / .62); display: grid; align-items: end; animation: fade-in .16s ease-out; }
.sheet { width: 100%; max-height: min(90dvh, 760px); overflow-y: auto; padding: 10px 18px calc(22px + var(--safe-bottom)); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 26px 26px 0 0; background: #29272f; box-shadow: var(--shadow); animation: sheet-up .22s cubic-bezier(.2,.8,.2,1); }
.sheet-handle { width: 42px; height: 4px; margin: 3px auto 16px; border-radius: 99px; background: #45534d; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.sheet-header h2 { font-size: 1.2rem; letter-spacing: -.025em; }
.sheet .section-heading:first-child { margin-top: 0; }

.dialog-backdrop { position: fixed; z-index: 90; inset: 0; padding: 18px; background: rgb(0 0 0 / .68); display: grid; place-items: center; }
.dialog { width: min(100%, 390px); max-height: 86dvh; overflow-y: auto; padding: 20px; border: 1px solid var(--line-strong); border-radius: 22px; background: #29272f; box-shadow: var(--shadow); }

.toast-region { position: fixed; z-index: 120; left: 50%; bottom: calc(88px + var(--safe-bottom)); width: min(calc(100% - 36px), 430px); transform: translateX(-50%); pointer-events: none; }
.toast { margin-top: 8px; padding: 12px 14px; border: 1px solid #62766c; border-radius: 14px; background: rgb(45 57 51 / .98); color: #d7e7de; box-shadow: 0 12px 35px rgb(0 0 0 / .3); font-size: .8rem; animation: toast-in .2s ease-out; }
.toast.error { border-color: #694039; background: #2a1916; color: #ffc2bc; }

.sync-banner { margin-bottom: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 13px; background: rgb(40 39 46 / .84); color: var(--muted); font-size: .72rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgb(255 255 255 / .04); }

.chart { position: relative; min-height: 150px; margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: #211f26; }
.chart svg { width: 100%; height: 130px; overflow: visible; }
.chart .grid-line { stroke: #26332d; stroke-width: 1; }
.chart .trend-line { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart .point { fill: var(--blue); stroke: #211f26; stroke-width: 2; }

.legal { color: #c7d0cb; font-size: .82rem; line-height: 1.65; }
.legal h2 { margin: 18px 0 8px; color: var(--ink); font-size: 1rem; }
.legal p + p { margin-top: 10px; }

.skeleton { overflow: hidden; position: relative; min-height: 70px; border-radius: 16px; background: var(--surface); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgb(255 255 255 / .04), transparent); animation: shimmer 1.2s infinite; }

@keyframes sheet-up { from { transform: translateY(24px); opacity: .7; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
@keyframes shimmer { to { transform: translateX(100%); } }

@media (min-width: 520px) {
  body { padding: 18px 0; }
  .app-shell { max-width: 480px; min-height: calc(100dvh - 36px); border: 1px solid #2a3932; border-radius: 30px; overflow: hidden; box-shadow: 0 30px 90px rgb(0 0 0 / .45); }
  .app-main { min-height: calc(100dvh - 36px); }
  .bottom-nav { left: 50%; width: 478px; transform: translateX(-50%); bottom: 18px; border: 1px solid #2a3932; border-bottom: 0; border-radius: 0 0 30px 30px; }
  .sheet { max-width: 480px; margin: 0 auto; border-radius: 26px 26px 0 0; }
}

@media (max-width: 359px) {
  .app-main { padding-left: 13px; padding-right: 13px; }
  .macro-strip, .nutrition-summary { gap: 5px; }
  .nutrition-box { padding-inline: 4px; }
  .button-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Mobile application surfaces introduced in the v3 information architecture. */
.daily-energy-head,.weight-command-head,.fridge-section-lead,.meal-day-summary,.workspace-nutrition-hero { display:flex;align-items:center;gap:14px; }
.energy-orbit,.meal-summary-ring { --ring:var(--energy-progress,0deg);width:112px;aspect-ratio:1;border-radius:50%;padding:9px;flex:0 0 auto;background:conic-gradient(var(--lime) var(--ring),#45434b 0); }
.meal-summary-ring { --ring:var(--meal-share,0deg);width:92px; }
.energy-orbit>span,.meal-summary-ring>span { width:100%;height:100%;border-radius:50%;background:#29282f;display:grid;place-content:center;text-align:center;font-weight:800; }
.energy-orbit strong,.energy-orbit small,.meal-summary-ring small { display:block; }.energy-orbit strong{font-size:1.35rem}.energy-orbit small,.meal-summary-ring small{color:var(--muted);font-size:.62rem}
.goal-edit-button { min-height:44px;padding:7px 9px;border:1px solid var(--line);border-radius:13px;background:var(--surface-2);color:var(--ink);display:grid;place-items:center;gap:2px;font-size:.62rem; }.goal-edit-button svg{width:17px;height:17px}
.energy-equation { margin-top:12px;padding:9px;border-radius:13px;background:rgb(20 20 23/.28);display:grid;grid-template-columns:1fr auto 1fr auto 1fr;align-items:center;gap:6px;text-align:center; }.energy-equation strong,.energy-equation small{display:block}.energy-equation strong{font-size:.8rem}.energy-equation small{color:var(--quiet);font-size:.56rem}
.weight-command { margin-top:14px;border-color:#5c5964;background:linear-gradient(145deg,#2d2c34,#26262c); }.weight-orbit{width:52px;height:52px;border-radius:17px;background:#3b3943;color:var(--blue);display:grid;place-items:center}.weight-command-head h2{font-size:1.1rem}.weight-command-head p:last-child{color:var(--muted);font-size:.7rem;line-height:1.45}
.weight-slot-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:14px}.weight-slot-card{min-width:0;min-height:112px;padding:10px 5px;border:1px solid var(--line);border-radius:15px;background:#222127;color:var(--ink);display:grid;place-items:center;align-content:center;gap:5px;text-align:center}.weight-slot-card.has-value{border-color:#606c67;background:#2d3531}.weight-slot-icon{color:var(--blue)}.weight-slot-card strong,.weight-slot-card small{display:block}.weight-slot-card strong{font-size:.67rem}.weight-slot-card small{margin-top:3px;color:var(--muted);font-size:.6rem}.weight-slot-add{width:14px;height:14px;color:var(--lime)}
.weight-insight{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:11px}.weight-insight>span{min-width:0;padding:9px 5px;border-radius:12px;background:#211f26;text-align:center}.weight-insight strong,.weight-insight small{display:block}.weight-insight strong{margin-top:3px;font-size:.75rem}.weight-insight small{color:var(--quiet);font-size:.56rem}
.slot-weight-chart svg{width:100%;height:auto}.slot-line{fill:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.slot-point{stroke:#242329;stroke-width:2}.slot-line.morning,.slot-point.morning{stroke:var(--orange);fill:var(--orange)}.slot-line.midday,.slot-point.midday{stroke:var(--blue);fill:var(--blue)}.slot-line.night,.slot-point.night{stroke:var(--violet);fill:var(--violet)}.slot-chart-legend{display:flex;gap:9px;flex-wrap:wrap}.slot-chart-legend span{display:grid;grid-template-columns:7px 1fr;gap:1px 5px;align-items:center}.slot-chart-legend i{width:7px;height:7px;border-radius:50%;background:currentColor}.slot-chart-legend small{color:var(--muted);font-size:.58rem}.slot-chart-legend strong{grid-column:2;font-size:.63rem}.mini-chart-empty{padding:18px;color:var(--quiet);font-size:.7rem;text-align:center}

.meal-hub-cta,.new-dish-hero,.recipe-secondary,.cooking-live-card{width:100%;min-height:84px;padding:14px;border:1px solid var(--line);border-radius:20px;background:var(--surface);color:var(--ink);display:flex;align-items:center;gap:12px;text-align:left}.meal-hub-cta,.new-dish-hero{border-color:#71877c;background:linear-gradient(135deg,#34423b,#2a312e)}.meal-hub-icon,.new-dish-mark{width:52px;height:52px;border-radius:17px;background:var(--lime);color:var(--lime-ink);display:grid;place-items:center;flex:0 0 auto}.meal-hub-cta strong,.meal-hub-cta small,.new-dish-hero strong,.new-dish-hero small,.new-dish-hero p,.recipe-secondary strong,.recipe-secondary small{display:block}.meal-hub-cta small,.new-dish-hero p,.recipe-secondary small{margin-top:3px;color:var(--muted);font-size:.68rem}.new-dish-hero{min-height:126px}.new-dish-hero strong{font-size:1.25rem}.new-dish-hero small{color:var(--lime);font-weight:800;text-transform:uppercase;letter-spacing:.07em}.recipe-secondary{margin-top:12px;min-height:72px}.cooking-live-card{margin-bottom:13px;border-color:#806f63;background:linear-gradient(135deg,#40352f,#2d2b2c)}.cooking-live-pulse{width:46px;height:46px;border-radius:50%;background:#665044;color:var(--orange);display:grid;place-items:center;box-shadow:0 0 0 7px rgb(223 192 156/.08)}.cooking-live-card h2{font-size:1rem}.cooking-live-card p{color:var(--muted);font-size:.66rem}
.meal-day-summary{margin-top:14px}.macro-ribbon{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:9px}.macro-ribbon span{border-left:3px solid var(--ribbon);padding-left:6px}.macro-ribbon strong,.macro-ribbon small{display:block}.macro-ribbon strong{font-size:.68rem}.macro-ribbon small{color:var(--quiet);font-size:.55rem}

.fridge-tabs,.source-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;margin-bottom:14px;padding:4px;border:1px solid var(--line);border-radius:15px;background:#232228}.fridge-tabs button,.source-tabs button{min-height:44px;padding:7px 4px;border:0;border-radius:11px;background:transparent;color:var(--muted);font-size:.67rem;font-weight:750}.fridge-tabs button.active,.source-tabs button.active{background:var(--surface-3);color:var(--ink)}.source-tabs{display:flex;overflow-x:auto;margin:11px 0}.source-tabs button{min-width:92px;flex:1 0 auto}.fridge-section-lead{justify-content:space-between;margin:12px 1px}.fridge-section-lead h2{font-size:.86rem;color:var(--muted)}.ready-made-grid,.source-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.source-grid>.empty-state{grid-column:1/-1}.ready-made-card,.source-card{min-width:0;padding:12px;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:var(--ink);display:grid;align-content:start;gap:9px;text-align:left}.ready-made-icon,.source-card-icon{width:42px;height:42px;border-radius:14px;background:var(--surface-3);color:var(--orange);display:grid;place-items:center}.ready-made-card strong,.ready-made-card small,.source-card-copy strong,.source-card-copy small{display:block}.ready-made-card strong,.source-card-copy strong{font-size:.78rem;line-height:1.3}.ready-made-card small,.source-card-copy small{margin-top:3px;color:var(--muted);font-size:.61rem}.ready-macro-bar{height:8px;border-radius:99px;overflow:hidden;display:flex;background:#44414b}.ready-macro-bar i{width:var(--share);background:var(--color)}.source-macro-visual{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}.source-macro-visual i{min-height:46px;padding:5px 2px;border-radius:9px;background:linear-gradient(to top,var(--color) var(--macro),#383640 var(--macro));display:grid;place-content:center;text-align:center;font-style:normal;text-shadow:0 1px 2px #000}.source-macro-visual b,.source-macro-visual small{font-size:.58rem}.source-use{display:flex;align-items:center;justify-content:flex-end;color:var(--lime);font-size:.65rem;font-weight:750}

.workspace-nutrition-hero{padding:15px;border:1px solid #655f6d;border-radius:21px;background:linear-gradient(135deg,#33313a,#27262d)}.dish-macro-orbit{width:105px;aspect-ratio:1;padding:10px;border-radius:50%;background:conic-gradient(var(--blue) 0 var(--dish-protein),var(--orange) var(--dish-protein) var(--dish-carbs),var(--coral) var(--dish-carbs));flex:0 0 auto}.dish-macro-orbit>span{width:100%;height:100%;border-radius:50%;background:#28272e;display:grid;place-content:center;text-align:center}.dish-macro-orbit strong,.dish-macro-orbit small{display:block}.dish-macro-orbit strong{font-size:1.15rem}.dish-macro-orbit small{font-size:.58rem;color:var(--muted)}.dish-macro-legend{display:grid;gap:4px;margin-top:8px}.dish-macro-legend span{font-size:.61rem;color:var(--muted)}.dish-macro-legend i{display:inline-block;width:7px;height:7px;margin-right:5px;border-radius:50%;background:var(--legend)}.add-ingredient-cta{min-height:62px;margin-top:14px;font-size:.92rem}.workspace-finish-spacer{height:84px}.workspace-finish-dock{position:fixed;z-index:24;left:10px;right:10px;bottom:calc(8px + var(--safe-bottom));max-width:460px;margin:auto;padding:11px 12px;border:1px solid var(--line-strong);border-radius:18px;background:rgb(43 42 49/.96);box-shadow:0 -12px 30px rgb(0 0 0/.32);backdrop-filter:blur(18px);display:flex;align-items:center;justify-content:space-between;gap:12px}.workspace-finish-dock small,.workspace-finish-dock strong{display:block}.workspace-finish-dock small{color:var(--quiet);font-size:.6rem}.workspace-finish-dock strong{font-size:.8rem}
.weigh-entry-card,.weigh-macro-card,.scale-target-visual,.prior-content-card,.container-weigh-choice{padding:15px;border:1px solid var(--line);border-radius:19px;background:var(--surface);color:var(--ink)}.weigh-entry-card>p{color:var(--muted);font-size:.72rem;line-height:1.45}.weigh-value{display:grid;grid-template-columns:1fr auto auto;align-items:baseline;gap:6px;margin:15px 0}.weigh-value span{color:var(--muted);font-size:.7rem}.weigh-value strong{font-size:3.2rem;letter-spacing:-.07em}.weigh-value small{font-size:1rem;color:var(--muted)}.weigh-stepper{display:grid;grid-template-columns:62px 1fr 62px;gap:10px;align-items:center}.weigh-stepper button,.compact-stepper button{min-height:58px;border:1px solid var(--line-strong);border-radius:17px;background:var(--surface-3);color:var(--ink);display:grid;place-items:center}.weigh-stepper span{text-align:center}.weigh-stepper strong,.weigh-stepper small{display:block}.weigh-stepper small{color:var(--quiet);font-size:.6rem}.weigh-quick-options{display:flex;gap:7px;overflow-x:auto;margin-top:12px}.weigh-quick-options button{min-height:50px;padding:8px 11px;border:1px solid var(--line);border-radius:13px;background:#232228;color:var(--ink);flex:0 0 auto}.weigh-quick-options strong,.weigh-quick-options small{display:block}.weigh-quick-options strong{font-size:.68rem}.weigh-quick-options small{color:var(--muted);font-size:.6rem}.scale-target-visual{display:flex;align-items:center;gap:13px;border-color:#646c78;background:#2c3036}.scale-target-icon{width:48px;height:48px;border-radius:15px;background:#3a414a;color:var(--blue);display:grid;place-items:center}.scale-target-visual strong,.scale-target-visual small,.scale-target-visual p{display:block}.scale-target-visual strong{font-size:1.4rem}.scale-target-visual small,.scale-target-visual p{color:var(--muted);font-size:.65rem}.weigh-macro-card{display:grid;gap:12px}.weigh-macro-card>div:first-child{display:flex;align-items:end;justify-content:space-between}.weigh-macro-card>div:first-child>strong{font-size:1.2rem}.prior-content-card,.container-weigh-choice{width:100%;display:flex;align-items:center;gap:12px;text-align:left}.prior-content-card{justify-content:space-between}.compact-stepper{display:flex;gap:6px}.compact-stepper button{width:48px;min-height:48px}.container-weigh-choice em,.container-weigh-choice small,.container-weigh-choice strong{display:block}.container-weigh-choice em{margin-top:3px;color:var(--muted);font-size:.62rem;font-style:normal}

.macro-controls{height:255px;grid-template-columns:repeat(3,1fr);gap:10px}.macro-allocation-control{min-width:0;grid-template-rows:auto 1fr auto auto;place-items:center;padding:9px 5px;border:1px solid var(--line);border-radius:16px;background:#232228}.macro-control-label{width:100%;display:flex;align-items:center;justify-content:space-between;gap:3px;font-size:.66rem;font-weight:750}.macro-lock{width:38px;min-height:38px;padding:0;border:1px solid var(--line);border-radius:11px;background:var(--surface-3);color:var(--muted);display:grid;place-items:center}.macro-lock svg{width:16px;height:16px}.macro-lock.active{border-color:var(--macro-color);color:var(--macro-color)}.vertical-range-wrap{width:46px;height:145px;display:grid;place-items:center}.vertical-range-wrap input[type="range"]{width:140px;height:40px;min-height:40px;padding:0;transform:rotate(-90deg);appearance:none;-webkit-appearance:none;background:transparent}.vertical-range-wrap input[type="range"]::-webkit-slider-runnable-track{height:14px;border-radius:99px;background:#4b4852}.vertical-range-wrap input[type="range"]::-webkit-slider-thumb{width:30px;height:30px;margin-top:-8px;border:4px solid #28272e;border-radius:50%;appearance:none;-webkit-appearance:none;background:var(--macro-color)}.vertical-range-wrap input[type="range"]::-moz-range-track{height:14px;border-radius:99px;background:#4b4852}.vertical-range-wrap input[type="range"]::-moz-range-thumb{width:24px;height:24px;border:4px solid #28272e;border-radius:50%;background:var(--macro-color)}.macro-allocation-control output{font-size:1.35rem;font-weight:850}.macro-allocation-control>small{font-size:.62rem;color:var(--muted)}.macro-allocation-control.below-reference{border-color:#886f59}.macro-reference-note{display:none;padding:12px;border:1px solid var(--line);border-radius:14px;background:#29282f}.macro-reference-note.show{display:block;border-color:#886f59;background:#352f2b}.macro-reference-note strong{font-size:.76rem}.macro-reference-note p{margin-top:4px;color:var(--muted);font-size:.65rem;line-height:1.4}
.first-weight-visual{text-align:center}.first-weight-visual>span{width:62px;height:62px;margin:auto;border-radius:20px;background:var(--surface-3);color:var(--blue);display:grid;place-items:center}.first-weight-visual h2{margin-top:9px}.first-weight-visual p{margin-top:5px;color:var(--muted);font-size:.72rem}.weight-slot-selector{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.weight-slot-selector label{min-width:0;cursor:pointer}.weight-slot-selector input{position:absolute;width:1px;height:1px;opacity:0}.weight-slot-selector label>span{min-height:100px;padding:9px 5px;border:1px solid var(--line);border-radius:14px;background:var(--surface);display:grid;place-items:center;align-content:center;gap:4px;text-align:center}.weight-slot-selector label.selected>span,.weight-slot-selector label:has(input:checked)>span{border-color:#71877c;background:#334039}.weight-slot-selector strong,.weight-slot-selector small{display:block}.weight-slot-selector strong{font-size:.66rem}.weight-slot-selector small{color:var(--muted);font-size:.56rem}.weight-slot-selector.compact label>span{min-height:83px}

.container-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.container-grid-card{min-height:145px;padding:12px;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:var(--ink);display:grid;place-items:center;align-content:center;gap:7px;text-align:center}.container-grid-card strong,.container-grid-card small{display:block}.container-grid-card strong{font-size:.73rem}.container-grid-card small{color:var(--muted);font-size:.62rem}.container-grid-card.add{border-style:dashed;color:var(--lime)}.container-mini-visual{position:relative;width:58px;height:62px;border:3px solid var(--container-body);border-radius:12px 12px 20px 20px;background:color-mix(in srgb,var(--container-body) 34%,transparent);display:block;flex:0 0 auto}.container-mini-visual::before{content:"";position:absolute;left:-5px;right:-5px;top:-8px;height:9px;border-radius:7px;background:var(--container-lid,var(--container-body))}.container-mini-visual.rectangular{width:70px;height:48px;border-radius:7px 7px 14px 14px}.container-mini-visual.square{width:56px;height:56px;border-radius:7px}.container-mini-visual.oval{width:72px;height:48px;border-radius:50%}.container-mini-visual.bottle{width:32px;height:70px;border-radius:8px 8px 14px 14px}.container-mini-visual.jar{width:49px;height:61px;border-radius:8px 8px 16px 16px}.container-appearance-form{display:grid;gap:11px;padding:12px;border:1px solid var(--line);border-radius:17px;background:var(--surface)}

.activity-visual{position:relative;min-height:170px;overflow:hidden;border:1px solid var(--line);border-radius:21px;background:linear-gradient(#313844,#2e3a35)}.activity-landscape{position:absolute;inset:0}.activity-landscape::after{content:"";position:absolute;left:-10%;right:-10%;bottom:-45px;height:110px;border-radius:50%;background:#566459}.activity-landscape>i{position:absolute;left:0;bottom:58px;width:var(--activity-level);height:7px;border-radius:99px;background:var(--orange)}.activity-person{position:absolute;z-index:2;left:clamp(8px,calc(var(--activity-level) - 18px),calc(100% - 42px));bottom:51px;width:38px;height:38px;border-radius:50%;background:var(--orange);color:#332a22;display:grid;place-items:center}.activity-visual output{position:absolute;z-index:3;left:14px;right:14px;top:14px}.activity-visual output strong,.activity-visual output small{display:block}.activity-visual output strong{font-size:1.1rem}.activity-visual output small{margin-top:4px;color:#c8cdcf;font-size:.68rem}.activity-slider-label{display:flex;justify-content:space-between;color:var(--muted);font-size:.65rem}.activity-day-form>input[type="range"]{accent-color:var(--orange)}.activity-calculation{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;gap:5px;align-items:center;padding:12px;border-radius:15px;background:var(--surface)}.activity-calculation span{text-align:center}.activity-calculation strong,.activity-calculation small{display:block}.activity-calculation strong{font-size:.78rem}.activity-calculation small{color:var(--quiet);font-size:.53rem}

@media (max-width:359px){.weight-slot-grid{gap:4px}.weight-slot-card{padding-inline:2px}.daily-energy-head{align-items:flex-start}.energy-orbit{width:92px}.workspace-nutrition-hero{padding:11px}.dish-macro-orbit{width:88px}.ready-made-grid,.source-grid{gap:7px}.macro-controls{gap:6px}}
