:root {
  --ink: #18352a;
  --muted: #6d7d76;
  --green: #275f48;
  --green-deep: #173f31;
  --green-light: #dceadf;
  --orange: #d98644;
  --orange-light: #f7e4d3;
  --cream: #f5f3ec;
  --paper: rgba(255, 255, 255, 0.9);
  --line: rgba(31, 75, 57, 0.12);
  --shadow: 0 18px 50px rgba(39, 66, 53, 0.09);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f1f0e9;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 5%, rgba(213, 228, 203, 0.72), transparent 32rem),
    linear-gradient(145deg, #f7f5ee 0%, #eff3eb 48%, #f5efe2 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", sans-serif;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(4px);
  pointer-events: none;
}

.ambient-one {
  width: 22rem;
  height: 22rem;
  right: -7rem;
  top: 20%;
  background: rgba(239, 199, 155, 0.24);
}

.ambient-two {
  width: 20rem;
  height: 20rem;
  left: -8rem;
  bottom: 2%;
  background: rgba(176, 207, 180, 0.26);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px 16px 16px 6px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(39, 95, 72, 0.22);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 25px;
  font-weight: 700;
}

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

h1 {
  font-size: 21px;
  letter-spacing: 0.02em;
}

.brand p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-status {
  color: var(--muted);
  font-size: 12px;
}

.save-status.saving {
  color: var(--orange);
}

.save-status.error {
  color: #a14338;
}

.card {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.daybar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  margin-bottom: 16px;
}

.date-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-switcher > div {
  min-width: 148px;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.date-switcher strong {
  display: block;
  margin-top: 1px;
  font-size: 15px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.64);
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
  transition: 0.18s ease;
}

.icon-button:hover {
  background: var(--green-light);
  border-color: transparent;
}

.icon-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.text-button {
  border: 0;
  padding: 4px 2px;
  color: var(--green);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover {
  text-decoration: underline;
}

.danger-text {
  color: #a9574d;
}

.mode-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #e8ebe5;
}

.mode-button {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: 0.18s ease;
}

.mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.mode-button.active {
  color: #fff;
  background: var(--green);
  box-shadow: 0 5px 12px rgba(39, 95, 72, 0.22);
}

.overview-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 16px;
  margin-bottom: 16px;
}

.energy-card,
.macro-card,
.food-card,
.recommendation-card,
.strategy-card {
  padding: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-heading h2 {
  margin-top: 3px;
  font-size: 19px;
  font-weight: 720;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  background: #eef0eb;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-green {
  color: var(--green);
  background: var(--green-light);
}

.badge-orange {
  color: #885022;
  background: var(--orange-light);
}

.energy-layout {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  margin-top: 18px;
}

.calorie-ring {
  --progress: 0;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 155px;
  height: 155px;
  border-radius: 50%;
  background: conic-gradient(
    var(--green) calc(var(--progress) * 1%),
    rgba(39, 95, 72, 0.1) 0
  );
}

.calorie-ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(39, 95, 72, 0.05);
  border-radius: 50%;
  background: #fbfcf8;
}

.ring-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.ring-center strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.ring-center span {
  color: var(--muted);
  font-size: 11px;
}

.energy-copy {
  display: grid;
  flex: 1;
  gap: 12px;
}

.energy-copy > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.energy-copy span {
  color: var(--muted);
  font-size: 12px;
}

.energy-copy strong {
  font-size: 15px;
}

.energy-copy p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.macro-list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.macro-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 12px;
}

.macro-label span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.macro-label strong {
  font-size: 12px;
  font-weight: 650;
}

.legend {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.legend.protein {
  background: #4f8465;
}

.legend.carbs {
  background: #d69a56;
}

.legend.fat {
  background: #9c7254;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebece6;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

#proteinBar {
  background: linear-gradient(90deg, #47795d, #6c9e7b);
}

#carbsBar {
  background: linear-gradient(90deg, #cf8846, #e5ae72);
}

#fatBar {
  background: linear-gradient(90deg, #8d6248, #b2896e);
}

.profile-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 19px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.profile-strip div {
  min-width: 0;
}

.profile-strip span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.profile-strip strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  align-items: start;
  gap: 16px;
}

.weight-card {
  margin-bottom: 16px;
  padding: 22px;
}

.weight-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(330px, 1.35fr) minmax(230px, 0.85fr);
  align-items: stretch;
  gap: 16px;
  margin-top: 18px;
}

.weight-entry-panel,
.weight-chart-panel,
.weight-insight {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 250, 246, 0.72);
}

.weight-entry-panel {
  padding: 14px;
}

.weight-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.weight-form .button {
  padding: 0 12px;
  font-size: 11px;
}

.weight-amount-field input {
  font-size: 17px;
  font-weight: 700;
}

.weight-stats {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.weight-stats > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.weight-stats span {
  color: var(--muted);
  font-size: 10px;
}

.weight-stats strong {
  font-size: 11px;
  text-align: right;
}

.weight-chart-panel {
  min-width: 0;
  padding: 12px 12px 8px;
}

.weight-chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
}

.weight-chart-heading small {
  font-size: 9px;
}

.weight-chart-wrap {
  position: relative;
  min-height: 165px;
  margin-top: 6px;
}

#weightChart {
  display: block;
  width: 100%;
  height: 165px;
  overflow: visible;
}

.weight-chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.weight-insight {
  padding: 15px;
  background: linear-gradient(145deg, #edf5eb, #f8faf5);
}

.weight-insight strong {
  display: block;
  font-size: 13px;
}

.weight-insight p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.weight-insight .insight-action {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.weight-insight.warning {
  background: linear-gradient(145deg, #f9eadb, #fcf5ec);
}

.weight-insight.warning .insight-action {
  color: #925122;
}

.weight-insight.good {
  background: linear-gradient(145deg, #e6f2e7, #f7faf5);
}

.side-column {
  display: grid;
  gap: 16px;
}

.button {
  min-height: 41px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(39, 95, 72, 0.18);
}

.button-primary:hover {
  background: var(--green-deep);
}

.button-ghost {
  color: var(--green);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
}

.button-wide {
  width: 100%;
}

.food-form {
  margin-top: 19px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(246, 248, 243, 0.72);
}

.meal-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.meal-picker label {
  cursor: pointer;
}

.meal-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.meal-picker span {
  display: block;
  border-radius: 9px;
  padding: 6px 11px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.meal-picker input:checked + span {
  color: var(--green);
  background: var(--green-light);
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 116px auto;
  align-items: end;
  gap: 9px;
}

.field {
  display: grid;
  gap: 5px;
}

.field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  height: 41px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 11px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(39, 95, 72, 0.55);
  box-shadow: 0 0 0 3px rgba(39, 95, 72, 0.09);
}

.amount-field {
  position: relative;
}

.amount-field input {
  padding-right: 34px;
}

.amount-field em {
  position: absolute;
  top: 50%;
  right: 11px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.quick-area {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
}

.quick-label {
  flex: 0 0 auto;
  padding-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.quick-adds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  font-size: 11px;
  transition: 0.16s ease;
}

.quick-chip:hover {
  border-color: transparent;
  background: var(--green-light);
}

.custom-toggle {
  border: 0;
  margin-top: 12px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.custom-toggle:hover {
  color: var(--green);
}

.custom-panel {
  margin-top: 13px;
  padding: 13px;
  border-radius: 14px;
  background: var(--orange-light);
}

.custom-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.custom-grid .field:first-child {
  grid-column: span 1;
}

.custom-grid .button {
  grid-column: span 1;
}

.form-note {
  margin-top: 9px;
  color: #896b50;
  font-size: 10px;
}

.log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 9px;
}

.log-heading h3 {
  font-size: 14px;
}

.entries-list {
  display: grid;
  gap: 7px;
}

.empty-state {
  padding: 28px 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.meal-group {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.meal-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.meal-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  align-items: center;
  gap: 12px;
  padding: 9px 7px;
  border-radius: 11px;
}

.entry-row:hover {
  background: rgba(231, 238, 230, 0.56);
}

.entry-main {
  min-width: 0;
}

.entry-main strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-main span {
  color: var(--muted);
  font-size: 10px;
}

.entry-nutrition {
  text-align: right;
}

.entry-nutrition strong {
  display: block;
  font-size: 12px;
}

.entry-nutrition span {
  color: var(--muted);
  font-size: 9px;
}

.delete-entry {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 9px;
  color: #9a756f;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
}

.delete-entry:hover {
  color: #9b3f34;
  background: #f7e2de;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.live-indicator i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #57a773;
  box-shadow: 0 0 0 4px rgba(87, 167, 115, 0.12);
  animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    box-shadow: 0 0 0 7px rgba(87, 167, 115, 0);
  }
}

.recommendation-hint {
  margin: 11px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.rec-list {
  display: grid;
  gap: 9px;
}

.rec-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, #fbfcf8, #f4f7f0);
}

.rec-card:first-child {
  border-color: rgba(39, 95, 72, 0.22);
  background: linear-gradient(145deg, #edf5eb, #f8faf5);
}

.rec-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rec-top strong {
  font-size: 13px;
}

.rec-tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--green);
  background: rgba(39, 95, 72, 0.09);
  font-size: 9px;
  font-weight: 700;
}

.rec-items {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.rec-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
}

.rec-macros {
  color: var(--muted);
  font-size: 9px;
}

.rec-add {
  border: 0;
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.rec-add:hover {
  background: #fff;
  box-shadow: 0 3px 10px rgba(39, 95, 72, 0.08);
}

.strategy-list {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.strategy-item {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.strategy-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.strategy-number {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-light);
  font-size: 10px;
  font-weight: 700;
}

.strategy-item strong {
  display: block;
  font-size: 11px;
}

.strategy-item p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 4px 0;
  color: var(--muted);
  font-size: 10px;
}

.settings-dialog {
  width: min(540px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  border: 0;
  border-radius: 22px;
  padding: 0;
  color: var(--ink);
  background: #fbfcf8;
  box-shadow: 0 30px 100px rgba(18, 48, 36, 0.26);
}

.settings-dialog::backdrop {
  background: rgba(20, 39, 31, 0.35);
  backdrop-filter: blur(4px);
}

.settings-dialog form {
  padding: 23px;
}

.phone-dialog {
  width: min(480px, calc(100% - 28px));
}

.phone-dialog-inner {
  padding: 23px;
}

.phone-loading {
  padding: 48px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.phone-content {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.qr-wrap {
  display: grid;
  place-items: center;
  width: 242px;
  height: 242px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(39, 66, 53, 0.08);
}

.qr-wrap img {
  display: block;
  width: 220px;
  height: 220px;
}

.phone-url {
  margin-top: 4px;
  color: var(--green);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 17px;
  user-select: all;
}

.phone-adapter {
  color: var(--muted);
  font-size: 10px;
}

.alternate-urls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.alternate-url {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 9px;
}

.alternate-url:hover {
  color: var(--green);
  border-color: rgba(39, 95, 72, 0.3);
}

.phone-error {
  margin: 12px 0;
  padding: 14px;
  border-radius: 12px;
  color: #913f35;
  background: #f8e5e1;
  font-size: 11px;
  line-height: 1.6;
}

.network-steps {
  margin: 18px 0 0;
  padding: 14px 14px 14px 32px;
  border-radius: 13px;
  color: var(--muted);
  background: #eff3eb;
  font-size: 10px;
  line-height: 1.75;
}

.network-note {
  margin-top: 11px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dialog-heading h2 {
  margin-top: 3px;
  font-size: 20px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
}

.dialog-note {
  margin: 16px 0;
  padding: 11px 13px;
  border-radius: 12px;
  color: var(--muted);
  background: #eff3eb;
  font-size: 10px;
  line-height: 1.6;
}

.backup-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.backup-block strong {
  display: block;
  font-size: 12px;
}

.backup-block p {
  max-width: 300px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.backup-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
}

.backup-actions .button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 15px);
  max-width: min(420px, calc(100% - 32px));
  padding: 10px 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--green-deep);
  box-shadow: 0 12px 30px rgba(18, 48, 36, 0.24);
  opacity: 0;
  pointer-events: none;
  font-size: 12px;
  transition: 0.22s ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .overview-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .side-column {
    grid-template-columns: 1fr 1fr;
  }

  .weight-layout {
    grid-template-columns: 1fr 1fr;
  }

  .weight-insight {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 13px 13px 13px 5px;
    font-size: 21px;
  }

  h1 {
    font-size: 18px;
  }

  .brand p,
  .save-status {
    display: none;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .button {
    padding: 0 10px;
    font-size: 11px;
  }

  .daybar {
    align-items: stretch;
    flex-direction: column;
  }

  .date-switcher {
    justify-content: space-between;
  }

  .date-switcher > div {
    flex: 1;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-button {
    flex: 1;
    justify-content: center;
  }

  .energy-card,
  .macro-card,
  .food-card,
  .recommendation-card,
  .strategy-card,
  .weight-card {
    padding: 17px;
  }

  .energy-layout {
    align-items: flex-start;
  }

  .calorie-ring {
    width: 132px;
    height: 132px;
  }

  .ring-center strong {
    font-size: 26px;
  }

  .input-grid {
    grid-template-columns: 1fr 105px;
  }

  .input-grid .button {
    grid-column: 1 / -1;
  }

  .custom-grid {
    grid-template-columns: 1fr 1fr;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .weight-layout {
    grid-template-columns: 1fr;
  }

  .weight-insight {
    grid-column: auto;
  }

  .footer {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .energy-layout {
    flex-direction: column;
    align-items: center;
  }

  .energy-copy {
    width: 100%;
  }

  .profile-strip {
    grid-template-columns: 1fr 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .backup-block {
    flex-direction: column;
  }
}
