:root {
  --ink: #24372f;
  --muted: #566157;
  --green: #234e43;
  --green-light: #e5eee6;
  --cream: #f5f5ef;
  --paper: #fffefa;
  --line: #dfe4db;
  --orange: #c88b50;
  --sage: #8ba588;
  --blue: #718eaa;
  --shadow: 0 6px 28px #263a2d05;
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-size: 15px;
  line-height: 1.5;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -1.2px;
  line-height: 1.15;
  margin-bottom: 10px;
}
h2 {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.35px;
}
h3 {
  font-size: 15px;
}
p {
  margin-bottom: 16px;
}
strong {
  font-weight: 650;
}
small,
.small {
  font-size: 12px;
  line-height: 1.6;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
  display: block;
  margin-bottom: 10px;
}
.icon {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  vertical-align: middle;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 24px;
  letter-spacing: -1px;
  line-height: 1;
  font-weight: 700;
}
.brand-light {
  font-weight: 350;
}
.brand small {
  font-size: 7px;
  display: block;
  letter-spacing: 2px;
  font-weight: 500;
  margin-top: 9px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 45px;
  background: var(--green);
  color: #e5eadc;
  border-radius: 18px 18px 18px 3px;
}
.brand-mark .icon {
  width: 25px;
  height: 25px;
}
.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 1000;
  background: white;
  padding: 12px;
}
.skip-link:focus {
  top: 10px;
}
:focus-visible {
  outline: 3px solid #ac763b;
  outline-offset: 3px;
}
.loading {
  display: flex;
  min-height: 70vh;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  text-align: center;
}
.button {
  min-height: 47px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
}
.button.primary {
  background: var(--green);
  color: #fff;
}
.button.primary:hover {
  background: #173e34;
}
.button.secondary {
  background: transparent;
  border-color: #c8d2c6;
  color: var(--green);
}
.button.secondary:hover {
  background: #e9eee5;
}
.full {
  width: 100%;
}
.text-button {
  background: transparent;
  border: 0;
  color: var(--green);
  min-height: 44px;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
}
.danger {
  color: #a34535;
}
.icon-button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--green);
}
.icon-button:hover {
  background: var(--green-light);
}
.shell {
  display: grid;
  grid-template-columns: 238px 1fr;
  min-height: 100vh;
}
.sidebar {
  padding: 38px 26px;
  position: fixed;
  top: 0;
  bottom: 0;
  width: 238px;
  background: #eeefe7;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar-caption {
  font-size: 9px;
  letter-spacing: 1.3px;
  line-height: 1.9;
  color: #566157;
  margin: 45px 0 24px;
}
.sidebar nav {
  display: grid;
  gap: 9px;
}
.nav-button {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 0;
  min-height: 50px;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  padding: 12px 16px;
  color: #566157;
}
.nav-button.selected {
  background: var(--green);
  color: white;
}
.sidebar-bottom {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
  padding-top: 60px;
  line-height: 1.8;
}
.sidebar-bottom .icon {
  display: block;
  margin-bottom: 10px;
  width: 18px;
}
.workspace {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  max-width: 1160px;
  margin: auto;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 52px;
}
.desktop-context {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
}
.profile-pill {
  display: flex;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 30px;
  padding: 6px 12px 6px 6px;
  color: var(--green);
  min-height: 44px;
  font-size: 12px;
  max-width: 200px;
}
.profile-pill > span:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-pill > .icon {
  width: 14px;
}
.avatar {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #d9e3d2;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.mobile-brand,
.bottom-nav,
.mobile-add {
  display: none;
}
main#main:not(.auth-layout):not(.wizard-layout):not(.loading) {
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 52px 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}
.page-heading p {
  margin-bottom: 0;
  font-size: 13px;
}
.date-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.date-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}
.date-label {
  position: relative;
  text-align: center;
  min-width: 145px;
  font-size: 13px;
  font-weight: 650;
}
.date-label input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}
.private-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.private-badge .icon {
  width: 13px;
  height: 13px;
}
.overview-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}
.energy-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--green);
  color: #fafbf5;
  border-radius: var(--radius);
  padding: 30px;
  min-height: 265px;
  gap: 10px;
  overflow: hidden;
}
.energy-card .eyebrow {
  color: #b8caba;
  font-size: 9px;
  letter-spacing: 1.4px;
}
.energy-card h2 {
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  max-width: 210px;
}
.energy-number {
  display: flex;
  flex-direction: column;
  margin: 19px 0 13px;
}
.energy-number strong {
  font-weight: 450;
  font-size: 48px;
  letter-spacing: -2px;
  line-height: 1.05;
}
.energy-number span {
  color: #c9d5c8;
  font-size: 11px;
  margin-top: 5px;
}
.energy-card p {
  color: #cfdbcc;
  font-size: 12px;
  margin-bottom: 0;
}
.energy-card p strong {
  color: #fff;
}
.energy-card .small {
  font-size: 10px;
}
.energy-ring {
  position: relative;
  flex-shrink: 0;
  width: 125px;
  height: 125px;
}
.energy-ring > svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}
.ring-track,
.ring-value {
  fill: none;
  stroke-width: 5;
}
.ring-track {
  stroke: #ffffff21;
}
.ring-value {
  stroke: #d4e5bd;
  stroke-linecap: round;
}
.energy-ring > div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.energy-ring .icon {
  width: 31px;
  height: 31px;
  color: #d1dfc4;
}
.energy-ring small {
  font-size: 10px;
  letter-spacing: 1px;
  color: #d9e4d1;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.section-title h2 {
  margin: 0;
}
.section-title > .small {
  font-size: 9px;
  letter-spacing: 1px;
}
.macro-row {
  margin: 19px 0;
}
.macro-row > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 9px;
}
.macro-row > div > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot.protein {
  background: var(--sage);
}
.dot.carbs {
  background: var(--orange);
}
.dot.fat {
  background: var(--blue);
}
progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 4px;
  display: block;
  background: #ecefe7;
}
progress::-webkit-progress-bar {
  background: #ecefe7;
  border-radius: 4px;
}
progress::-webkit-progress-value {
  background: var(--sage);
  border-radius: 4px;
}
progress.carbs::-webkit-progress-value {
  background: var(--orange);
}
progress.fat::-webkit-progress-value {
  background: var(--blue);
}
progress::-moz-progress-bar {
  background: var(--sage);
}
progress.carbs::-moz-progress-bar {
  background: var(--orange);
}
progress.fat::-moz-progress-bar {
  background: var(--blue);
}
.macro-card > .small {
  font-size: 10px;
  margin: 15px 0 0;
  line-height: 1.6;
}
.log-section {
  margin-top: 32px;
}
.meal-group {
  border: 1px solid var(--line);
  border-radius: 17px;
  overflow: hidden;
  background: var(--paper);
  margin-bottom: 16px;
}
.meal-heading {
  display: flex;
  justify-content: space-between;
  padding: 13px 19px;
  background: #edf0e7;
  align-items: center;
}
.meal-heading h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
}
.meal-heading > span {
  font-size: 11px;
  color: var(--muted);
}
.food-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 15px 15px 19px;
  border-top: 1px solid var(--line);
}
.food-icon {
  width: 37px;
  height: 39px;
  border-radius: 12px;
  background: #eef1e7;
  display: grid;
  place-items: center;
  color: var(--green);
  flex-shrink: 0;
}
.food-icon .icon {
  width: 18px;
}
.food-description {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.food-description strong {
  font-size: 13px;
  display: block;
  font-weight: 600;
}
.food-description small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.food-energy {
  font-size: 16px;
  text-align: right;
  flex-shrink: 0;
}
.food-energy small {
  display: block;
  font-size: 9px;
  color: var(--muted);
}
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 42px 20px;
  border: 1px dashed #cbd5c6;
  border-radius: 20px;
  text-align: center;
  margin-top: 18px;
}
.empty-state > .icon {
  width: 35px;
  height: 35px;
  color: #8d9f87;
  margin-bottom: 14px;
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 8px;
}
.empty-state p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 390px;
  margin-bottom: 0;
}
.empty-state .button {
  margin-top: 20px;
}
.empty-state.compact {
  padding: 24px;
}
.activity-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 22px;
  align-items: center;
}
.activity-strip > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.activity-strip strong {
  font-size: 17px;
  font-weight: 500;
}
.activity-strip small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}
.activity-strip .icon {
  color: #8b9d85;
}
.activity-strip + p {
  font-size: 10px;
  margin-top: 15px;
}
.footnote {
  max-width: 1160px;
  margin: auto;
  padding: 45px 52px 30px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #566157;
}
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.favorite-card h2 {
  margin: 16px 0 8px;
  overflow-wrap: anywhere;
}
.favorite-card p {
  margin-bottom: 7px;
}
.favorite-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 12px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat {
  padding: 24px 21px;
}
.stat .eyebrow {
  font-size: 9px;
  letter-spacing: 1px;
}
.stat > strong {
  font-size: 29px;
  font-weight: 450;
  letter-spacing: -1px;
  display: block;
  white-space: nowrap;
}
.stat > strong small {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}
.stat p {
  font-size: 10px;
  margin: 8px 0 0;
}
.chart-card {
  margin-top: 22px;
}
.trend-chart {
  width: 100%;
  height: auto;
  display: block;
}
.trend-chart polyline {
  stroke: var(--green);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-grid {
  fill: none;
  stroke: #e6e9e0;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.trend-chart text {
  font-size: 10px;
  fill: var(--muted);
}
.empty-chart {
  height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.empty-chart p {
  margin-bottom: 8px;
}
.checkin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.checkin-row strong {
  font-size: 13px;
}
.checkin-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.settings-card {
  margin-bottom: 20px;
}
.settings-card p {
  font-size: 13px;
}
.target-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 15px;
  margin: 20px 0;
  padding: 16px;
  background: #f4f6ef;
}
.target-preview strong {
  display: block;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.6px;
}
.target-preview small {
  font-size: 9px;
  color: var(--muted);
  text-transform: capitalize;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #e9eee3;
  border: 1px solid #dbe3d3;
  border-radius: 14px;
  padding: 15px 17px;
  font-size: 12px;
  line-height: 1.7;
  margin: 18px 0;
}
.notice:has(strong) {
  display: block;
}
.notice p {
  margin: 7px 0 0;
  font-size: 12px;
}
.notice .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.notice.warning {
  background: #f5eee0;
  border-color: #e7d9bf;
  color: #6a512d;
}
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.auth-story {
  background: #e6ebdf;
  padding: 55px 65px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 780px;
  overflow: hidden;
}
.auth-story > div {
  margin-top: 70px;
}
.auth-story h1 {
  font-size: 72px;
  line-height: 1.06;
  margin: 20px 0;
}
.auth-story p {
  font-size: 15px;
  color: #60715e;
  line-height: 1.8;
}
.auth-story > small {
  font-size: 11px;
  color: var(--muted);
}
.story-art {
  height: 230px;
  position: relative;
  max-width: 330px;
  margin: 20px 0;
}
.story-art span {
  position: absolute;
  width: 135px;
  height: 200px;
  border-radius: 100px 100px 10px 100px;
  background: #afc0a3;
  bottom: 0;
  left: 15px;
  transform: rotate(-20deg);
}
.story-art span:nth-child(2) {
  height: 170px;
  left: 100px;
  background: #8ca783;
  transform: rotate(20deg);
}
.story-art span:nth-child(3) {
  height: 110px;
  left: 190px;
  width: 100px;
  background: #d1b995;
  transform: rotate(35deg);
}
.story-art > .icon {
  position: absolute;
  left: 105px;
  bottom: 35px;
  width: 110px;
  height: 110px;
  color: #edf2e4;
  stroke-width: 0.8;
}
.auth-card {
  align-self: center;
  max-width: 460px;
  width: 100%;
  padding: 40px;
  margin: 35px auto;
}
.auth-card h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 30px;
  margin: 10px 0 15px;
}
.auth-card > p {
  font-size: 13px;
}
.privacy-note {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 25px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}
.privacy-note .icon {
  width: 15px;
  height: 15px;
  margin-top: 3px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
  min-width: 0;
}
.field input,
.field select {
  width: 100%;
  min-width: 0;
  border: 1px solid #cdd6c9;
  background: #fffefa;
  border-radius: 10px;
  color: var(--ink);
  padding: 12px;
  font-size: 16px;
  min-height: 48px;
  outline-offset: 2px;
}
.field input::placeholder {
  font-size: 13px;
  color: #8b9489;
}
.field select {
  padding-right: 28px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 12px;
  line-height: 1.65;
  min-height: 44px;
  cursor: pointer;
  padding: 9px 0;
}
.check input {
  width: 19px;
  height: 19px;
  min-width: 19px;
  margin: 1px 0 0;
  accent-color: var(--green);
}
.check span {
  flex: 1;
}
.checkbox-stack {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 5px 15px;
}
.checkbox-stack .check + .check {
  border-top: 1px solid #e8ebe3;
}
.check.separated {
  margin-top: 15px;
}
.form-error {
  color: #a04432;
  font-size: 12px;
  margin: 10px 0;
  min-height: 0;
}
.form-error:empty {
  display: none;
}
.form-error:not(:empty) {
  padding: 10px;
  background: #faece5;
  border-radius: 8px;
}
.wizard-layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 35px 30px;
}
.wizard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}
.wizard-card {
  max-width: 540px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 35px 38px;
}
.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.step-header .eyebrow {
  font-size: 9px;
  margin: 0;
}
.step-track {
  display: flex;
  gap: 6px;
  margin: 16px 0 30px;
}
.step-track span {
  height: 3px;
  flex: 1;
  background: #e6eadd;
  border-radius: 3px;
}
.step-track .done {
  background: var(--green);
}
.wizard-card h1 {
  font-size: 31px;
  margin-bottom: 12px;
}
.wizard-card > p {
  font-size: 13px;
  margin-bottom: 25px;
}
.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.wizard-actions .primary {
  flex: 1;
}
.wizard-bottom {
  text-align: center;
  margin-top: 20px;
  font-size: 10px;
}
.target-options {
  border: 0;
  padding: 0;
  margin: 20px 0;
}
.target-options legend {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #213d32;
  color: #fff;
  padding: 14px 20px;
  border-radius: 14px;
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 32px);
  font-size: 13px;
  box-shadow: 0 8px 40px #0002;
}
.connection {
  background: #6a512d;
  color: white;
  padding: 10px 20px;
  text-align: center;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 110;
}
dialog {
  width: min(510px, calc(100vw - 28px));
  max-height: calc(100dvh - 44px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  padding: 24px 30px;
  color: var(--ink);
  box-shadow: 0 25px 100px #12291f33;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #18362b80;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.modal-head .eyebrow {
  font-size: 9px;
  margin: 0;
}
.modal-head + .h2,
dialog h2 {
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 400;
  margin: 5px 0 10px;
}
dialog > p {
  font-size: 12px;
}
details {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  margin-bottom: 18px;
}
summary {
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 24px;
}
details p {
  margin: 12px 0;
}
details .form-grid {
  margin-bottom: -5px;
}
details .field {
  font-size: 10px;
}
@media (min-width: 1450px) {
  .topbar,
  main#main:not(.auth-layout):not(.wizard-layout):not(.loading) {
    padding-left: 65px;
    padding-right: 65px;
  }
  .overview-grid {
    gap: 25px;
  }
  .energy-card {
    padding: 33px;
  }
  .energy-ring {
    width: 150px;
    height: 150px;
  }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .shell {
    grid-template-columns: 200px 1fr;
  }
  .sidebar {
    width: 200px;
    padding: 30px 18px;
  }
  .topbar {
    padding: 0 30px;
  }
  main#main:not(.auth-layout):not(.wizard-layout):not(.loading) {
    padding: 22px 30px 0;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .energy-card {
    min-height: 230px;
  }
  .energy-ring {
    width: 150px;
    height: 150px;
  }
  .page-heading h1 {
    font-size: 31px;
  }
  .stats-grid {
    gap: 9px;
  }
  .stat {
    padding: 18px 12px;
  }
  .stat > strong {
    font-size: 25px;
  }
  .auth-story {
    padding: 45px 35px;
  }
  .auth-story h1 {
    font-size: 54px;
  }
  .auth-card {
    padding: 30px;
  }
}
@media (max-width: 760px) {
  h1 {
    font-size: 30px;
    letter-spacing: -0.8px;
  }
  .shell {
    display: block;
  }
  .sidebar,
  .desktop-context,
  .desktop-add {
    display: none;
  }
  .workspace {
    width: 100%;
  }
  .topbar {
    height: 91px;
    padding: 18px 21px 15px;
    gap: 15px;
  }
  .mobile-brand {
    display: flex;
    font-size: 22px;
  }
  .brand small {
    font-size: 6px;
    letter-spacing: 1.8px;
  }
  .brand-mark {
    width: 33px;
    height: 38px;
    border-radius: 15px 15px 15px 3px;
  }
  .brand-mark .icon {
    width: 22px;
  }
  .brand {
    gap: 9px;
  }
  .profile-pill {
    max-width: 135px;
    padding-right: 9px;
    gap: 7px;
  }
  .profile-pill > .icon {
    display: none;
  }
  .profile-pill > span:nth-child(2) {
    max-width: 68px;
  }
  .avatar {
    width: 27px;
    height: 27px;
  }
  main#main:not(.auth-layout):not(.wizard-layout):not(.loading) {
    padding: 20px 21px 0;
  }
  .page-heading {
    display: block;
    margin-bottom: 19px;
  }
  .page-heading h1 {
    font-size: 29px;
    margin-bottom: 9px;
  }
  .page-heading .eyebrow {
    font-size: 9px;
    letter-spacing: 1.6px;
  }
  .page-heading p {
    font-size: 12px;
    max-width: 340px;
  }
  .page-heading > .button {
    margin-top: 18px;
    width: 100%;
  }
  .date-toolbar {
    margin-bottom: 17px;
  }
  .date-label {
    min-width: 120px;
    font-size: 12px;
  }
  .date-controls {
    margin-left: -10px;
  }
  .date-controls .icon-button {
    width: 35px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .energy-card {
    padding: 25px 24px;
    min-height: 242px;
    border-radius: 20px;
  }
  .energy-card h2 {
    font-size: 22px;
  }
  .energy-number strong {
    font-size: 47px;
  }
  .energy-ring {
    width: 110px;
    height: 110px;
  }
  .energy-card .eyebrow {
    font-size: 8px;
  }
  .card {
    padding: 23px;
    border-radius: 20px;
  }
  .macro-card {
    padding: 22px 23px;
  }
  .macro-card h2 {
    font-size: 17px;
  }
  .macro-row {
    margin: 16px 0;
  }
  .macro-card > .small {
    font-size: 10px;
  }
  .mobile-add {
    display: flex;
    margin: 0 0 18px;
    min-height: 49px;
  }
  .log-section {
    margin-top: 27px;
  }
  .section-title {
    margin-bottom: 15px;
  }
  .section-title h2 {
    font-size: 18px;
  }
  .food-row {
    padding: 12px 9px 12px 14px;
    gap: 10px;
  }
  .food-description strong {
    font-size: 12px;
  }
  .food-description small {
    font-size: 9px;
  }
  .food-icon {
    width: 30px;
    height: 33px;
    border-radius: 9px;
  }
  .food-energy {
    font-size: 14px;
  }
  .food-row > .icon-button {
    width: 34px;
    height: 40px;
  }
  .food-row > .icon-button > .icon {
    width: 16px;
  }
  .meal-heading {
    padding: 11px 15px;
  }
  .activity-strip {
    gap: 8px;
    flex-wrap: wrap;
  }
  .activity-strip .icon {
    width: 19px;
  }
  .activity-strip > div {
    gap: 7px;
  }
  .activity-strip strong {
    font-size: 16px;
  }
  .activity-strip .text-button {
    font-size: 11px;
  }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fffefaf5;
    border-top: 1px solid var(--line);
    padding: 9px 13px calc(9px + env(safe-area-inset-bottom));
    z-index: 30;
    backdrop-filter: blur(15px);
  }
  .bottom-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 5px 2px;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #7b8578;
    font-size: 9px;
    font-weight: 600;
  }
  .bottom-nav button[aria-current] {
    color: var(--green);
    background: #eaf0e5;
  }
  .bottom-nav .icon {
    width: 21px;
    height: 21px;
  }
  .footnote {
    padding: 35px 21px calc(110px + env(safe-area-inset-bottom));
    font-size: 9px;
    text-align: center;
  }
  .favorites-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .favorite-card h2 {
    font-size: 19px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .stat {
    padding: 19px 16px;
  }
  .stat:nth-child(3) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
  .stat:nth-child(3) > .eyebrow {
    grid-column: 1;
  }
  .stat:nth-child(3) > strong {
    grid-column: 2;
    grid-row: 1/3;
    text-align: right;
  }
  .stat:nth-child(3) > p {
    margin: 0;
    grid-column: 1;
  }
  .stat > strong {
    font-size: 28px;
  }
  .stat .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .chart-card {
    padding: 20px 15px;
  }
  .chart-card > .small {
    font-size: 9px;
  }
  .checkin-row small {
    font-size: 10px;
  }
  .settings-card p {
    font-size: 12px;
  }
  .settings-card .button {
    width: 100%;
  }
  .target-preview {
    gap: 6px;
    padding: 12px 10px;
  }
  .target-preview strong {
    font-size: 21px;
  }
  .target-preview small {
    font-size: 8px;
  }
  .auth-layout {
    display: block;
    min-height: 100dvh;
    background: var(--cream);
  }
  .auth-story {
    padding: 30px 25px 27px;
    min-height: auto;
    position: relative;
    background: #e6ebdf;
  }
  .auth-story > div {
    margin: 40px 0 0;
  }
  .auth-story h1 {
    font-size: 44px;
    line-height: 1.05;
    margin: 14px 0;
  }
  .auth-story .eyebrow {
    font-size: 8px;
    letter-spacing: 1.6px;
  }
  .auth-story p {
    font-size: 12px;
    max-width: 260px;
    line-height: 1.7;
    margin-bottom: 0;
  }
  .auth-story > small {
    display: none;
  }
  .story-art {
    display: none;
  }
  .auth-card {
    padding: 28px 25px 45px;
    margin: 0 auto;
    max-width: 500px;
  }
  .auth-card > .eyebrow {
    font-size: 9px;
  }
  .auth-card h2 {
    font-size: 26px;
  }
  .auth-card > p {
    font-size: 12px;
  }
  .auth-card .privacy-note {
    font-size: 10px;
  }
  .wizard-layout {
    padding: 25px 18px;
    min-height: 100dvh;
  }
  .wizard-top {
    margin-bottom: 25px;
    padding: 0 4px;
  }
  .wizard-top .brand {
    font-size: 22px;
  }
  .wizard-card {
    padding: 25px 22px;
    border-radius: 20px;
  }
  .wizard-card h1 {
    font-size: 28px;
  }
  .wizard-card > p {
    font-size: 12px;
    margin-bottom: 20px;
  }
  .step-track {
    margin: 15px 0 24px;
  }
  .step-header {
    font-size: 9px;
  }
  .step-header .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .field {
    font-size: 11px;
    margin-bottom: 17px;
  }
  .form-grid {
    gap: 0 11px;
  }
  .check {
    font-size: 11px;
    min-height: 46px;
  }
  .checkbox-stack {
    padding: 5px 12px;
  }
  .notice {
    font-size: 11px;
    padding: 13px 14px;
  }
  .notice p {
    font-size: 11px;
  }
  .wizard-card .small {
    font-size: 10px;
  }
  .wizard-bottom {
    font-size: 9px;
  }
  .wizard-actions {
    margin-top: 23px;
  }
  .toast {
    bottom: calc(89px + env(safe-area-inset-bottom));
    font-size: 12px;
    width: calc(100vw - 36px);
    text-align: center;
  }
  dialog {
    padding: 20px 21px;
    border-radius: 20px;
    max-height: calc(100dvh - 26px);
  }
  dialog h2 {
    font-size: 25px;
  }
  dialog > p {
    font-size: 11px;
  }
  dialog details .field {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .button,
  .icon-button {
    transition: background 0.15s;
  }
  .ring-value {
    transition: stroke-dasharray 0.3s;
  }
}
[hidden] {
  display: none !important;
}
