:root {
  --green: #5cb433;
  --green-dark: #429328;
  --green-soft: #edf8df;
  --orange: #ff9f1f;
  --ink: #151515;
  --muted: #666b72;
  --line: #ece7d9;
  --paper: #fffdf8;
  --soft: #f7f2e4;
  --shadow: 0 14px 34px rgba(55, 42, 20, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 255, 255, 0.98) 0 20%, transparent 42%),
    linear-gradient(135deg, #fbf8ef, #eee6d7);
  color: var(--ink);
}

button {
  font: inherit;
}

.phone-shell {
  width: min(100vw, 430px);
  min-height: min(100vh, 860px);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 2%, rgba(255, 255, 255, 0.98), transparent 44%),
    linear-gradient(180deg, #fff 0%, #fbf7ec 100%);
  border: 1px solid #d8d1c1;
  border-radius: 34px;
  box-shadow: 0 22px 60px rgba(41, 32, 15, 0.24);
  padding: 18px 18px 116px;
}

.tg-header {
  height: 70px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.tg-header > span {
  color: #1f1f1f;
  font-size: 15px;
}

.tg-header div {
  display: grid;
  justify-items: center;
  line-height: 1.05;
}

.tg-header strong {
  font-size: 18px;
}

.tg-header small {
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  justify-self: end;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ddd7ca;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: rise 0.22s ease-out;
}

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

.cat-hero {
  position: relative;
  height: 324px;
  display: grid;
  place-items: center;
}

.hero-cat-art {
  position: relative;
  z-index: 2;
  width: 342px;
  height: 342px;
  object-fit: contain;
  object-position: center;
  transform: translateY(-10px);
  filter: drop-shadow(0 10px 18px rgba(55, 42, 20, 0.08));
}

.cat-hero::before,
.party::before {
  content: "";
  position: absolute;
  width: 245px;
  height: 245px;
  border-radius: 50%;
  background: #f4f0d6;
  opacity: 0.8;
}

.heart-bubble {
  position: absolute;
  right: 20px;
  top: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--green);
  font-size: 28px;
  background: white;
  border: 1px solid #e5dfc2;
  box-shadow: var(--shadow);
  z-index: 4;
}

.cat {
  width: 210px;
  height: 230px;
  position: relative;
  z-index: 2;
}

.head {
  position: absolute;
  inset: 38px 12px 0;
  background: #fff;
  border: 5px solid #111;
  border-radius: 48% 48% 44% 44%;
  overflow: hidden;
}

.ear {
  position: absolute;
  top: 15px;
  width: 56px;
  height: 72px;
  background: #fff;
  border: 5px solid #111;
  border-radius: 14px 70% 14px 14px;
  transform: rotate(-14deg);
  z-index: 1;
}

.ear::after {
  content: "";
  position: absolute;
  inset: 15px 14px;
  background: #ff8936;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.ear.left {
  left: 28px;
}

.ear.right {
  right: 28px;
  transform: rotate(14deg) scaleX(-1);
}

.patch {
  position: absolute;
  right: -5px;
  top: -8px;
  width: 82px;
  height: 78px;
  background: var(--orange);
  border-bottom-left-radius: 70%;
}

.eye {
  position: absolute;
  top: 82px;
  width: 34px;
  height: 18px;
  border-top: 5px solid #111;
  border-radius: 50%;
}

.eye.left {
  left: 45px;
}

.eye.right {
  right: 45px;
}

.nose {
  position: absolute;
  left: 50%;
  top: 99px;
  width: 18px;
  height: 13px;
  background: #111;
  border-radius: 50%;
  transform: translateX(-50%);
}

.mouth {
  position: absolute;
  left: 50%;
  top: 112px;
  width: 30px;
  height: 24px;
  border: 4px solid #111;
  border-top: 0;
  border-radius: 0 0 22px 22px;
  transform: translateX(-50%);
  background: #ff8a6d;
}

.whisker {
  position: absolute;
  width: 46px;
  height: 4px;
  background: #111;
  border-radius: 99px;
}

.w1 {
  left: 12px;
  top: 104px;
  transform: rotate(6deg);
}

.w2 {
  left: 8px;
  top: 126px;
  transform: rotate(-10deg);
}

.w3 {
  right: 12px;
  top: 104px;
  transform: rotate(-6deg);
}

.w4 {
  right: 8px;
  top: 126px;
  transform: rotate(10deg);
}

.bowl {
  position: absolute;
  left: 44px;
  bottom: 0;
  width: 122px;
  height: 62px;
  background: #66bd40;
  border: 5px solid #111;
  border-radius: 18px 18px 45px 45px;
  z-index: 3;
}

.bowl::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: -34px;
  height: 42px;
  background: white;
  border: 5px solid #111;
  border-radius: 50%;
}

.bowl span {
  position: absolute;
  top: -18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111;
  z-index: 4;
}

.bowl span:nth-child(1) { left: 39px; }
.bowl span:nth-child(2) { left: 56px; }
.bowl span:nth-child(3) { left: 73px; }

.status-row,
.calorie-card,
.tip-card,
.meal-card,
.streak-card,
.mission-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.status-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.status-cat-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 5px 10px rgba(72, 157, 43, 0.18));
}

.status-row span,
.tip-card small,
.meal-card small,
.mission-card small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.round-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 21px;
  font-weight: 800;
}

.happy,
.fire {
  background: linear-gradient(145deg, #78c64b, #42a52d);
}

.fire {
  background: transparent;
  box-shadow: none;
}

.fire img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  display: block;
}

.calorie-card {
  margin-top: 16px;
  padding: 20px 16px;
}

.card-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: center;
}

.calorie-card strong {
  display: block;
  font-size: 32px;
  line-height: 1.1;
}

.calorie-card em {
  color: #2b2b2b;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
}

.progress-line {
  height: 13px;
  margin-top: 12px;
  border-radius: 999px;
  background: #eeeade;
  overflow: hidden;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #69c33b);
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.macro-grid > span {
  min-width: 0;
  display: grid;
  grid-template-columns: 17px auto auto;
  align-items: baseline;
  justify-content: center;
  column-gap: 5px;
  white-space: nowrap;
  line-height: 1.1;
  font-weight: 500;
}

.macro-grid b {
  color: var(--green-dark);
  font-size: 18px;
  font-weight: 650;
  text-align: right;
  min-width: 17px;
}

.macro-current {
  color: #262626;
  font-size: 14px;
  font-weight: 700;
  margin-left: 0;
}

.macro-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.macro-grid > span:nth-child(2) b,
.macro-grid > span:nth-child(3) b {
  color: #f28b17;
}

.primary-action {
  width: 100%;
  height: 52px;
  margin-top: 16px;
  border: 0;
  border-radius: 17px;
  color: white;
  background: linear-gradient(180deg, #6fc444, #49a52d);
  box-shadow: 0 9px 18px rgba(72, 157, 43, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 650;
}

.primary-action {
  line-height: 1;
}

.action-plus,
.action-label {
  transform: translateY(-3px);
}

.primary-action .action-plus {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--green);
  position: relative;
  font-size: 0;
  line-height: 0;
  flex: 0 0 22px;
}

.primary-action .action-plus::before,
.primary-action .action-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: var(--green);
  transform: translate(-50%, -50%);
}

.primary-action .action-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.primary-action .action-label {
  display: inline-block;
  line-height: 1;
}

.add-food-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 0;
  margin-top: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  transition: max-height 0.22s ease, margin-top 0.22s ease, opacity 0.18s ease, transform 0.22s ease;
}

.add-food-menu.open {
  max-height: 96px;
  margin-top: 12px;
  opacity: 1;
  transform: translateY(0);
}

.add-food-menu button {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 18px rgba(55, 42, 20, 0.1);
  color: #202020;
  font-size: 15px;
  font-weight: 800;
}

.add-food-menu span {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 28px;
}

.tip-card {
  min-height: 74px;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 34px 1fr 58px;
  align-items: center;
  gap: 12px;
  padding: 11px 10px 11px 14px;
  background: #faf8e8;
  box-shadow: 0 8px 18px rgba(55, 42, 20, 0.1);
  overflow: hidden;
  position: relative;
}

.tip-paw {
  width: 31px;
  height: 31px;
  object-fit: contain;
  transform: rotate(-8deg);
}

.tip-cat {
  width: 74px;
  height: 70px;
  object-fit: contain;
  justify-self: end;
  align-self: end;
  margin-right: -16px;
  margin-bottom: -20px;
}

.day-switch {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.day-arrow {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f0ebdd;
  font-size: 28px;
  line-height: 1;
}

.date-label {
  min-width: 112px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f7f1e2;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  padding: 0 14px;
}

.date-picker {
  position: absolute;
  left: 40px;
  top: 10px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.peek {
  position: absolute;
  right: 28px;
  bottom: -22px;
  transform: rotate(-4deg);
  z-index: 1;
}

.peek-art {
  position: absolute;
  right: 18px;
  bottom: -24px;
  width: 76px;
  height: 76px;
  object-fit: contain;
  object-position: center;
  z-index: 1;
}

.diary-summary {
  position: relative;
  z-index: 2;
  margin-top: 8px;
}

.diary-summary > small {
  font-weight: 700;
}

.boxed > span {
  padding: 12px 8px;
  border-radius: 12px;
  background: #faf6ec;
  flex-wrap: wrap;
  row-gap: 4px;
}

.boxed .macro-percent {
  flex-basis: 100%;
  font-size: 12px;
}

h2 {
  margin: 22px 8px 10px;
  font-size: 18px;
}

.meal-list {
  display: grid;
  gap: 10px;
}

.meal-card {
  overflow: hidden;
}

.meal-toggle {
  width: 100%;
  min-height: 78px;
  border: 0;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  background: transparent;
  text-align: left;
}

.meal-emoji {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fbf5e9;
  overflow: hidden;
}

.meal-emoji img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  object-position: center;
}

.meal-toggle strong {
  color: var(--green-dark);
  font-size: 19px;
  white-space: nowrap;
}

.meal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 0;
  padding: 0 14px;
  border-top: 1px solid transparent;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition: max-height 0.22s ease, padding 0.22s ease, opacity 0.18s ease, transform 0.22s ease;
}

.meal-card.open .meal-actions {
  max-height: 280px;
  padding: 0 14px 14px;
  border-top-color: #f0eadc;
  opacity: 1;
  transform: translateY(0);
}

.dish-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding-top: 12px;
}

.dish-list span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: baseline;
  min-height: 28px;
  padding: 0 2px;
}

.dish-list b {
  font-size: 14px;
}

.dish-list small {
  color: var(--muted);
  font-size: 12px;
}

.dish-list input {
  width: 58px;
  height: 28px;
  border: 1px solid #ded4bf;
  border-radius: 9px;
  padding: 0 6px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.dish-list .amount-unit {
  color: var(--muted);
  font-size: 12px;
  margin-left: -5px;
}

.dish-list strong {
  color: var(--green-dark);
  font-size: 13px;
  white-space: nowrap;
}

.meal-actions button {
  min-height: 38px;
  border: 1px solid #e9e1cf;
  border-radius: 12px;
  background: #fbf7eb;
  color: #303030;
  font-size: 13px;
  font-weight: 800;
}

.meal-actions .danger {
  color: #c6432b;
  background: #fff2ee;
  border-color: #f2d4ca;
}

.meal-card.editing .meal-actions > button:not(.save-grams) {
  display: none;
}

.meal-actions .save-grams {
  grid-column: 1 / -1;
  color: white;
  background: linear-gradient(180deg, #6fc444, #49a52d);
  border-color: transparent;
}

.wide {
  margin-top: 10px;
  grid-template-columns: 34px 1fr 96px;
  column-gap: 10px;
  padding-right: 12px;
}

.wide .tip-cat {
  width: 90px;
  height: 84px;
  margin-right: 2px;
  margin-bottom: -24px;
}

.party {
  height: 292px;
  display: grid;
  place-items: center;
  position: relative;
  margin-top: -24px;
  margin-bottom: 0;
  overflow: hidden;
}

.mission-cat-art {
  position: relative;
  z-index: 2;
  width: 368px;
  max-width: none;
  height: 310px;
  object-fit: contain;
  object-position: center;
  transform: translateY(-18px);
  filter: drop-shadow(0 12px 20px rgba(55, 42, 20, 0.08));
}

.party > span {
  position: absolute;
  color: var(--green);
  font-size: 28px;
}

.party > span:nth-child(1) { left: 20px; top: 82px; color: #ffc22f; }
.party > span:nth-child(2) { right: 28px; top: 92px; color: #ffc22f; }
.party > span:nth-child(3) { left: 42px; bottom: 58px; }
.party > span:nth-child(4) { right: 54px; bottom: 56px; }

.medal {
  transform: scale(0.9);
}

.coin {
  position: absolute;
  left: 78px;
  bottom: 10px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffc54c;
  border: 5px solid #111;
  color: #d57800;
  font-size: 32px;
  z-index: 4;
}

.streak-card {
  position: relative;
  z-index: 5;
  width: min(324px, calc(100% - 56px));
  margin: -28px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 58px;
  font-size: 20px;
}

.streak-card strong {
  color: var(--green-dark);
}

.streak-card b {
  color: #ff771b;
}

.mission-card {
  margin-top: 14px;
  min-height: 104px;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  column-gap: 18px;
  padding: 14px 16px;
  background: #f7f9e8;
}

.mission-icon {
  width: 60px;
  height: 50px;
  display: grid;
  place-items: center start;
}

.mission-icon img {
  width: 58px;
  height: 58px;
  display: block;
  object-fit: contain;
}

.achievements-title {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.achievements-title small {
  color: var(--muted);
}

.badges {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.badges span {
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
  text-align: center;
}

.badges b {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 8px 14px rgba(55, 42, 20, 0.08);
}

.badges b img {
  width: 66px;
  height: 66px;
  display: block;
  object-fit: contain;
}

.badges small {
  color: #3e3e3e;
  font-size: 11px;
  font-weight: 700;
}

.lower {
  margin-top: 24px;
}

.missions-hero {
  height: 260px;
}

.profile-hero,
.profile-panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.profile-hero {
  position: relative;
  min-height: 98px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
}

.avatar {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  overflow: hidden;
}

.avatar img {
  width: 88px;
  height: 88px;
  display: block;
  object-fit: cover;
}

.profile-hero h2 {
  margin: 0;
  font-size: 20px;
}

.profile-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-hero p b,
.profile-panel strong,
.profile-stats strong {
  color: var(--green-dark);
}

.profile-cat-art {
  width: 88px;
  height: 88px;
  object-fit: contain;
  object-position: center;
  margin-right: 2px;
}

.profile-heart {
  position: absolute;
  right: 10px;
  top: 16px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--green);
  box-shadow: 0 6px 14px rgba(55, 42, 20, 0.12);
}

.profile-panel {
  margin-top: 12px;
  padding: 14px;
}

.profile-panel[data-soon-update] {
  cursor: pointer;
}

.profile-panel[data-soon-update]:active {
  transform: translateY(1px);
}

.profile-panel h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  padding-left: 8px;
  font-size: 17px;
}

.profile-panel h2 span,
.profile-panel button > span,
.profile-field > span {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background: #edf8df;
  color: var(--green-dark);
  overflow: hidden;
}

.profile-panel h2 span img,
.profile-panel button > span img,
.profile-field > span img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
  object-position: center;
}

.profile-panel h2 span img[src*="profile-goals"],
.profile-panel button > span img[src*="profile-calorie-goal"],
.profile-panel button > span img[src*="profile-protein-goal"] {
  width: 36px;
  height: 36px;
}

.profile-panel h2 span img[src*="profile-goals-symbol"] {
  width: 21px;
  height: 21px;
}

.profile-panel button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  padding-left: 8px;
  border: 0;
  border-top: 1px dashed #eee5d5;
  background: transparent;
  text-align: left;
  color: #2b2b2b;
  font-weight: 600;
}

.profile-panel button:first-of-type {
  border-top: 0;
}

.profile-panel button b {
  color: #8b8b8b;
  font-size: 24px;
  line-height: 1;
}

.profile-field {
  min-height: 44px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  padding-left: 8px;
  border-top: 1px dashed #eee5d5;
}

.profile-field:first-of-type {
  border-top: 0;
}

.profile-field label {
  font-weight: 600;
}

.profile-field div {
  color: var(--green-dark);
  font-weight: 800;
}

.profile-field input,
.profile-field select {
  width: 74px;
  height: 32px;
  border: 1px solid #ded4bf;
  border-radius: 10px;
  padding: 0 8px;
  background: #fbf7eb;
  color: var(--green-dark);
  font: inherit;
  font-weight: 800;
  text-align: right;
}

.profile-field select {
  width: 112px;
  text-align: left;
}

.reminder-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #333;
  font-size: 15px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  width: 48px;
  height: 30px;
  display: block;
  border-radius: 999px;
  background: #d8d8d8;
  position: relative;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  transition: transform 0.18s ease;
}

.switch input:checked + span {
  background: linear-gradient(180deg, #6fc444, #49a52d);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-stats span {
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 6px;
  padding: 9px;
  border-radius: 14px;
  background: #faf5e8;
}

.profile-stats b {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.profile-stats b img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
  object-position: center;
}

.profile-stats b img[src*="profile-streak"] {
  width: 26px;
  height: 26px;
}

.profile-stats b img[src*="profile-achievements"] {
  width: 26px;
  height: 26px;
}

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

.profile-stats strong {
  font-size: 16px;
}

.tabbar {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  min-height: 80px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 7px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 26px rgba(55, 42, 20, 0.13);
}

.tabbar button {
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  display: grid;
  place-items: center;
  gap: 3px;
}

.tab-icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: grayscale(1) saturate(0) opacity(0.72);
}

.tabbar button.active {
  color: var(--green-dark);
}

.tabbar button.active .tab-icon {
  filter: invert(48%) sepia(71%) saturate(593%) hue-rotate(55deg) brightness(88%) contrast(88%);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  min-width: 230px;
  padding: 14px 18px;
  border-radius: 999px;
  color: white;
  background: rgba(25, 25, 25, 0.9);
  text-align: center;
  transform: translate(-50%, 120px);
  transition: transform 0.22s ease;
  pointer-events: none;
}

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

.onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 22, 18, 0.32);
}

.onboarding-modal[hidden] {
  display: none;
}

.onboarding-sheet {
  width: min(100%, 394px);
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fffdf8;
  box-shadow: 0 22px 50px rgba(31, 24, 11, 0.24);
}

.onboarding-sheet strong {
  display: block;
  font-size: 22px;
}

.onboarding-sheet small {
  color: var(--muted);
}

.onboarding-sheet label {
  display: grid;
  gap: 6px;
  color: #3a3a3a;
  font-size: 13px;
  font-weight: 800;
}

.onboarding-sheet input,
.onboarding-sheet select {
  width: 100%;
  height: 44px;
  border: 1px solid #ded4bf;
  border-radius: 13px;
  padding: 0 12px;
  background: #fbf7eb;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.onboarding-sheet button {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: linear-gradient(180deg, #6fc444, #49a52d);
  font-size: 18px;
  font-weight: 900;
}

.food-modal {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 22, 18, 0.32);
}

.food-modal[hidden],
.hidden-file {
  display: none;
}

.food-sheet {
  width: min(100%, 394px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fffdf8;
  box-shadow: 0 22px 50px rgba(31, 24, 11, 0.24);
}

.food-sheet strong {
  display: block;
  font-size: 22px;
}

.food-sheet small {
  color: var(--muted);
}

.food-sheet textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid #ded4bf;
  border-radius: 15px;
  padding: 12px;
  background: #fbf7eb;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  line-height: 1.35;
}

.food-sheet-actions {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 10px;
}

.food-sheet-actions button {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
}

.food-sheet-actions button:not(.secondary) {
  color: white;
  background: linear-gradient(180deg, #6fc444, #49a52d);
}

.food-sheet-actions .secondary {
  color: #4f5b4b;
  background: #f0eadc;
}

@media (max-width: 440px) {
  body {
    display: block;
    background: #fbf7ec;
  }

  .phone-shell {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .cat-hero {
    height: 310px;
  }

  .party {
    height: 292px;
  }

  .hero-cat-art {
    width: 310px;
    height: 310px;
    transform: translateY(-10px);
  }

  .mission-cat-art {
    width: 368px;
    height: 310px;
  }

  .add-food-menu {
    gap: 8px;
  }

  .add-food-menu button {
    min-height: 72px;
    font-size: 14px;
  }

  .badges {
    gap: 5px;
  }

  .badges b {
    width: 58px;
    height: 58px;
  }

  .badges b img {
    width: 60px;
    height: 60px;
  }
}
