:root {
  color-scheme: dark;
  --bg: #050507;
  --surface: #1e1c24;
  --surface-2: #282439;
  --panel: #252136;
  --text: #f8f6ff;
  --muted: #9b96aa;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #8257ff;
  --accent-2: #9a6cff;
  --danger: #ff5d73;
  --nav-h: 76px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

.public-gate-body {
  min-height: 100vh;
  overflow: hidden;
}

.public-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(130, 87, 255, 0.22), transparent 34%),
    #050507;
}

.public-gate-card {
  width: min(420px, 100%);
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(30, 28, 36, 0.88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.public-gate-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.public-gate-card h1 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.public-gate-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.public-gate-card span {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.public-gate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 20px;
  padding: 0 20px;
  border-radius: 999px;
  background: #f8f6ff;
  color: #121018;
  font-weight: 800;
  text-decoration: none;
}

.app-shell {
  width: min(620px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  padding: 12px 16px calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: #050507;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.screen[data-screen="profile"] {
  overflow-x: hidden;
}

.screen[data-screen="diary"] {
  margin: -12px -16px 0;
}

.screen[data-screen="diary"] .topbar,
.screen[data-screen="diary"] .date-row,
.screen[data-screen="diary"] .diary-carousel {
  padding-right: 16px;
  padding-left: 16px;
  background: #262138;
}

.screen[data-screen="diary"] .topbar {
  padding-top: 12px;
}

.screen[data-screen="diary"] .diary-carousel {
  border-radius: 0 0 28px 28px;
}

.screen[data-screen="diary"] .section-block {
  margin-right: 16px;
  margin-left: 16px;
}

.topbar,
.page-head,
.date-row,
.bottom-nav,
.sheet-head,
.tracker-card,
.settings-row,
.recipe-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  min-height: 56px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: 0;
}

h2 {
  font-size: 23px;
  line-height: 1.15;
  font-weight: 820;
}

.round-btn {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 19px;
}

.date-row {
  justify-content: space-between;
  min-height: 46px;
}

.ghost-arrow {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.34);
  font-size: 34px;
  line-height: 1;
}

.date-title {
  background: transparent;
  color: var(--text);
  font-size: 23px;
  font-weight: 840;
}

.hero-card,
.nutrient-card,
.meal-card,
.tracker-card,
.chart-card,
.recipe-row,
.settings-row,
.empty-card {
  border-radius: 22px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.diary-carousel {
  overflow: hidden;
  border-radius: 0 0 28px 28px;
}

.diary-slides {
  display: flex;
  transition: transform 220ms ease;
  touch-action: pan-y;
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr);
  grid-template-areas:
    "target ring left"
    "macros macros macros";
  min-height: 236px;
  gap: 14px 10px;
  align-items: center;
  padding: 12px 8px 12px;
  background: transparent;
  box-shadow: none;
}

.hero-card .calorie-target-side {
  grid-area: target;
}

.hero-card .calorie-left-side {
  grid-area: left;
}

.hero-card .calorie-ring {
  grid-area: ring;
}

.hero-card .macro-row {
  grid-area: macros;
}

.nutrient-card {
  min-height: 236px;
  padding: 10px 22px 10px;
  background: transparent;
  box-shadow: none;
}

.calorie-ring {
  display: grid;
  width: 128px;
  aspect-ratio: 1;
  place-content: center;
  border-radius: 999px;
  background:
    radial-gradient(circle, #262138 0 59%, transparent 60%),
    conic-gradient(var(--accent) var(--progress, 0%), #484159 0);
  text-align: center;
}

.calorie-ring span {
  display: grid;
  width: 82px;
  height: 50px;
  place-items: center;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 25px;
  font-weight: 880;
}

.calorie-ring small {
  display: block;
  margin-top: -12px;
  color: var(--text);
  font-size: 17px;
  font-weight: 760;
}

.calorie-ring small,
.calorie-side span,
.calorie-side small,
.meal-card small,
.tracker-card span,
.chart-card p,
.settings-row small,
.recipe-row p {
  color: var(--muted);
}

.calorie-side {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.calorie-side span {
  order: 2;
  color: var(--text);
  font-size: 17px;
  font-weight: 760;
}

.calorie-side strong {
  color: var(--text);
  font-size: 23px;
  line-height: 1.08;
  font-weight: 880;
}

.calorie-side small {
  display: none;
  font-size: 15px;
  font-weight: 760;
}

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

.nutrient-list {
  display: grid;
  gap: 8px;
}

.nutrient-row {
  display: grid;
  gap: 5px;
}

.nutrient-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 16px;
  font-weight: 820;
}

.nutrient-head span:last-child {
  color: var(--muted);
  white-space: nowrap;
}

.nutrient-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #403a50;
}

.nutrient-bar span {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 0 14px;
}

.carousel-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.carousel-dot.is-active {
  background: var(--text);
}

.pill,
.chip-btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-2);
  font-size: 14px;
  font-weight: 780;
}

.pill {
  display: grid;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  align-content: center;
  padding: 6px 0;
  background: transparent;
  text-align: center;
  color: var(--text);
}

.pill small {
  color: var(--text);
  font-size: 17px;
  font-weight: 820;
}

.pill strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.1;
  font-weight: 780;
}

.macro-bar {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #403a50;
}

.macro-bar span {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.section-block {
  margin-top: 22px;
}

.section-block h2,
.settings-section h2 {
  margin-bottom: 14px;
}

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

.meal-card {
  position: relative;
  min-height: 148px;
  overflow: hidden;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(130, 87, 255, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.meal-card:active {
  transform: scale(0.98);
}

.meal-card.has-meals {
  border-color: rgba(154, 108, 255, 0.24);
  background:
    radial-gradient(circle at 100% 0%, rgba(154, 108, 255, 0.22), transparent 40%),
    rgba(255, 255, 255, 0.075);
}

.meal-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.meal-card h3 {
  min-width: 0;
  margin: 0 30px 0 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 246, 255, 0.86);
}

.meal-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.meal-card-kcal {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 16px;
}

.meal-card strong {
  display: inline;
  font-size: 28px;
  line-height: 0.95;
}

.meal-card-kcal span,
.meal-card-goal {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.meal-card-goal {
  position: relative;
  z-index: 1;
  margin-top: 3px;
}

.meal-progress {
  position: relative;
  z-index: 1;
  height: 5px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.meal-progress span {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), #19c7b7);
}

.meal-card-bottom {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.meal-preview {
  overflow: hidden;
  color: rgba(248, 246, 255, 0.78);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-preview b {
  margin-left: 4px;
  color: var(--accent-2);
  font-weight: 850;
}

.meal-count {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.meal-add {
  position: absolute;
  z-index: 3;
  top: 13px;
  right: 13px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(248, 246, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #f8f6ff;
  font-size: 20px;
  line-height: 1;
}

.meal-note {
  position: relative;
  z-index: 1;
  max-width: 130px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.meal-slot-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.meal-slot-head div {
  display: grid;
  gap: 3px;
}

.meal-slot-head strong {
  font-size: 22px;
  line-height: 1;
}

.meal-slot-head span {
  color: var(--muted);
  font-size: 12px;
}

.meal-slot-actions,
.meal-slot-empty {
  display: grid;
  gap: 8px;
}

.meal-slot-empty {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.meal-slot-empty p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.meal-slot-add {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: white;
  font-size: 13px;
  font-weight: 850;
}

.meal-slot-favorite {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

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

.meal-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  text-align: left;
}

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

.meal-slot-list .meal-entry span {
  display: grid;
  gap: 3px;
}

.meal-slot-list .meal-entry small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-entry b {
  min-width: 70px;
  padding: 8px 9px;
  border-radius: 999px;
  background: rgba(124, 220, 255, 0.13);
  color: var(--accent-2);
  font-size: 12px;
  line-height: 1;
  text-align: center;
}

.meal-more {
  color: var(--muted);
  font-size: 12px;
}

.meal-detail {
  display: grid;
  gap: 14px;
}

.meal-detail-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.meal-detail-total strong {
  font-size: 46px;
  line-height: 1;
}

.meal-detail-total span {
  color: var(--muted);
}

.meal-detail-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.meal-detail-macros span {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-align: center;
}

.meal-detail-items {
  display: grid;
  gap: 8px;
}

.meal-detail-items div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.danger-row {
  color: var(--danger);
}

.field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.tracker-list,
.stats-list,
.recipes-list,
.settings-list {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.tracker-card {
  justify-content: space-between;
  min-height: 76px;
  padding: 16px 18px;
}

.tracker-card strong {
  font-size: 18px;
}

.tracker-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.tracker-toggle-panel {
  display: grid;
  gap: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.sheet-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}

.tracker-toggle-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
}

.tracker-toggle-row span {
  font-size: 24px;
}

.tracker-toggle-row strong {
  font-size: 17px;
}

.tracker-toggle-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
}

.notification-screen {
  display: grid;
  gap: 24px;
  padding-top: 2px;
}

.notification-group {
  display: grid;
  gap: 12px;
}

.notification-group h3 {
  margin: 0;
  padding: 0 2px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.1;
  font-weight: 850;
}

.notification-card {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  background: #1d1b23;
}

.notification-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 74px;
  padding: 0 28px 0 26px;
  color: var(--text);
  cursor: pointer;
}

.notification-row + .notification-row {
  border-top: 1px solid rgba(255, 255, 255, 0.035);
}

.notification-row strong {
  overflow: hidden;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.notification-row time,
.notification-time-input,
.notification-weekday {
  justify-self: end;
  min-width: 62px;
  color: rgba(248, 246, 255, 0.34);
  font-size: 20px;
  font-weight: 650;
  text-align: right;
}

.notification-time-input {
  width: 86px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  outline: none;
}

.notification-weekday {
  width: 58px;
  min-width: 52px;
  min-height: 38px;
  padding: 0 4px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  outline: none;
}

.notification-delete {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 93, 115, 0.13);
  color: var(--danger);
  font-size: 20px;
  line-height: 1;
}

.notification-time-input:focus {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.notification-switch {
  position: relative;
  width: 48px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.notification-switch i {
  position: absolute;
  top: 4px;
  left: 5px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #bcb7d2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  transition: transform 0.18s ease, background 0.18s ease;
}

.notification-row.is-active .notification-switch {
  background: rgba(130, 87, 255, 0.24);
}

.notification-row.is-active .notification-switch i {
  background: var(--accent-2);
  transform: translateX(16px);
}

.notification-add {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 4px 0 16px 26px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(130, 87, 255, 0.18);
  color: var(--accent-2);
  font-size: 18px;
  font-weight: 850;
}

.notification-add span {
  font-size: 26px;
  line-height: 1;
}

.notification-save {
  justify-self: stretch;
  margin-top: -6px;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.18s ease;
}

.switch b {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}

.switch.is-on {
  background: var(--accent);
}

.switch.is-on b {
  transform: translateX(20px);
}

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

.option-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  text-align: left;
}

.option-row.is-active {
  border-color: rgba(189, 236, 99, 0.55);
  background: rgba(189, 236, 99, 0.14);
}

.option-row span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 20px;
  font-weight: 900;
}

.option-row strong {
  display: grid;
  gap: 4px;
  font-size: 17px;
}

.option-row small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.inline-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.inline-form input,
.inline-form textarea,
.inline-form select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  outline: none;
}

.inline-form input,
.inline-form select {
  min-height: 54px;
  padding: 0 16px;
}

.inline-form textarea {
  min-height: 118px;
  padding: 13px 16px;
  line-height: 1.35;
  resize: vertical;
}

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

.ghost-action {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
}

.empty-line {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 15px;
}

.calendar-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.sheet.is-calendar-loading .calendar-grid,
.sheet.is-calendar-loading .calendar-weekdays,
.sheet.is-calendar-loading .calendar-legend {
  opacity: 0.45;
  pointer-events: none;
}

.sheet.is-calendar-loading .calendar-head::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 46px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(-50%);
  animation: calendarPulse 0.8s ease-in-out infinite alternate;
}

.calendar-head {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

@keyframes calendarPulse {
  from {
    opacity: 0.35;
    width: 28px;
  }
  to {
    opacity: 0.9;
    width: 64px;
  }
}

.calendar-head strong {
  text-align: center;
  font-size: 20px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
}

.calendar-weekdays {
  margin-bottom: 8px;
  color: rgba(248, 246, 255, 0.44);
  font-size: 12px;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 13px;
  background: rgba(255, 255, 255, calc(0.045 + var(--intensity, 0) * 0.12));
  color: var(--text);
}

.calendar-day.is-empty {
  background: transparent;
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 1px rgba(189, 236, 99, 0.42);
}

.calendar-day.is-selected {
  background: var(--accent);
  color: #fff;
}

.calendar-day span {
  font-size: 15px;
  font-weight: 750;
}

.calendar-day i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  display: flex;
  justify-content: center;
  gap: 3px;
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meal-dot,
.tracker-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #bdec63;
}

.tracker-dot {
  background: #8f73f6;
}

.page-head {
  justify-content: space-between;
  min-height: 48px;
  padding: 4px 2px 8px;
}

.page-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.page-head.centered {
  justify-content: center;
}

.period-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: #514a62;
  font-size: 14px;
  font-weight: 780;
}

.stat-section {
  display: grid;
  gap: 8px;
}

.stat-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.stat-title h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1;
}

.stat-title span {
  color: rgba(248, 246, 255, 0.72);
  font-size: 13px;
  line-height: 1;
  text-align: right;
}

.chart-card {
  --bar-color: #7d59f7;
  --target-color: #8f73f6;
  padding: 12px 13px;
  border-radius: 16px;
  background: #1d1b23;
  border: 1px solid rgba(255, 255, 255, 0.045);
}

.chart-protein { --bar-color: #f071b6; --target-color: #e86aa5; }
.chart-fat { --bar-color: #ffd66c; --target-color: #f0c663; }
.chart-carbs { --bar-color: #7fd996; --target-color: #79c98d; }
.chart-water { --bar-color: #4e8cff; --target-color: #4e8cff; }
.chart-steps { --bar-color: #815cf6; --target-color: #8f73f6; }
.chart-sleep { --bar-color: #55c7ff; --target-color: #55c7ff; }
.chart-activity { --bar-color: #ff6a7d; --target-color: #ff6a7d; }

.chart-card.is-clickable {
  cursor: pointer;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-head h2 {
  font-size: 17px;
  line-height: 1.05;
}

.chart-head p {
  margin-top: 4px;
}

.chart-head > strong {
  flex: 0 0 auto;
  color: var(--accent-2);
  font-size: 15px;
  line-height: 1;
  text-align: right;
}

.chart-average {
  margin: 0 0 6px;
  color: rgba(248, 246, 255, 0.54);
  font-size: 13px;
  line-height: 1.1;
}

.chart-box {
  position: relative;
  min-height: 144px;
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
  padding: 0 0 20px;
}

.chart-svg {
  width: 100%;
  height: 116px;
}

.chart-bars rect {
  fill: var(--bar-color);
  opacity: 0.96;
}

.chart-svg polyline {
  fill: none;
  stroke: #19c7b7;
  stroke-width: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-weight .chart-bars rect {
  opacity: 0;
}

.chart-weight polyline {
  stroke-width: 0.85;
  stroke: #19c7b7;
}

.chart-weight .chart-grid-line {
  stroke-width: 0.28;
  opacity: 0.82;
}

.chart-weight + .chart-y-labels,
.chart-weight ~ .chart-y-labels {
  font-size: 9.5px;
  color: rgba(248, 246, 255, 0.34);
}

.weight-card {
  display: grid;
  gap: 10px;
  overflow: hidden;
}

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

.weight-line-head div {
  display: grid;
  gap: 3px;
}

.weight-line-head span,
.weight-metrics,
.weight-readings small {
  color: var(--muted);
  font-size: 12px;
}

.weight-line-head strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.weight-line-head > b {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 13px;
}

.weight-line-head > b.is-up {
  color: #ffd66c;
}

.weight-line-head > b.is-down {
  color: #7fd996;
}

.weight-chart-box {
  position: relative;
  min-height: 136px;
  padding-bottom: 20px;
}

.weight-area {
  fill: #19c7b7;
  opacity: 0.11;
}

.weight-metrics {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.weight-readings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.weight-readings span {
  display: grid;
  gap: 3px;
  min-height: 50px;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
}

.weight-readings b {
  color: var(--text);
  font-size: 14px;
}

.chart-dots circle {
  fill: #19c7b7;
  stroke: #19c7b7;
  stroke-width: 0.75;
}

.chart-dots text {
  fill: #f8f6ff;
  font-size: 3.6px;
  font-weight: 650;
}

.chart-target {
  stroke: var(--target-color);
  stroke-width: 0.42;
  opacity: 0.84;
}

.chart-grid-line {
  stroke: rgba(248, 246, 255, 0.13);
  stroke-width: 0.32;
}

.chart-y-labels {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: rgba(248, 246, 255, 0.42);
  font-size: 9.5px;
  font-weight: 500;
  pointer-events: none;
}

.chart-days {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  color: rgba(248, 246, 255, 0.42);
  font-size: 9px;
  font-weight: 500;
  text-align: center;
}

.chart-days span {
  position: absolute;
  left: var(--x);
  transform: translateX(-50%);
}

.macro-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.macro-switch button {
  min-height: 34px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.macro-switch button.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

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

.detail-chart {
  min-height: 190px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(130, 87, 255, 0.14), rgba(255, 255, 255, 0.04));
  padding: 16px 12px 12px;
}

.detail-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  min-height: 164px;
}

.detail-bar {
  display: grid;
  grid-template-rows: 30px 1fr 18px;
  align-items: end;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.detail-bar strong {
  color: var(--text);
  font-size: 10px;
  line-height: 1.1;
}

.detail-bar i {
  display: block;
  width: 100%;
  height: var(--fill);
  min-height: 4px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, #bdec63, #8257ff);
}

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

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.detail-metrics div {
  min-height: 84px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.detail-metrics span,
.detail-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.week-bars {
  display: grid;
  gap: 9px;
  margin: 12px 0;
}

.week-row {
  display: grid;
  grid-template-columns: 34px 1fr 82px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.week-row i {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.week-row b {
  display: block;
  width: var(--fill);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.week-row strong {
  color: var(--text);
  font-size: 13px;
  text-align: right;
}

.recipe-row,
.settings-row {
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
  min-height: 76px;
  padding: 16px 18px;
  text-align: left;
}

.settings-row span {
  color: var(--accent-2);
  font-size: 28px;
}

.settings-row strong,
.recipe-row strong {
  flex: 1;
  min-width: 0;
  font-size: 22px;
}

.recipes-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.recipes-tabs button {
  min-height: 36px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.recipes-tabs button.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.recipe-ideas-head {
  display: grid;
  gap: 4px;
  padding: 4px 2px;
}

.recipe-ideas-head strong {
  font-size: 18px;
}

.recipe-ideas-head span,
.recipe-card small {
  color: var(--muted);
  font-size: 13px;
}

.recipe-card {
  align-items: center;
  min-height: 82px;
  padding: 13px 14px;
  cursor: pointer;
}

.recipe-card div:first-child {
  display: grid;
  gap: 4px;
}

.recipe-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 132px;
}

.recipe-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.recipe-toolbar .chip-btn:last-child {
  grid-column: 1 / -1;
}

.recipe-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.recipe-search input {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 0 13px;
  outline: none;
}

.recipe-search button {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.recipe-search-empty {
  display: grid;
  gap: 7px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.recipe-search-empty span {
  color: var(--muted);
  font-size: 13px;
}

.recipe-search-results {
  display: grid;
  gap: 12px;
}

.primary-chip {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: white;
}

.ghost-chip {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.recipe-empty-state {
  min-height: 300px;
  padding: 18px;
}

.recipe-empty-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.recipe-empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.recipe-empty-actions,
.recipe-more-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.recipe-empty-actions .primary-cta {
  min-height: 46px;
  margin-top: 0;
  font-size: 15px;
}

.recipe-more-panel {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.recipe-more-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.recipe-feedback-sheet {
  display: grid;
  gap: 9px;
}

.recipe-eat-sheet {
  display: grid;
  gap: 9px;
}

.recipe-eat-sheet p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.recipe-eat-sheet button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  text-align: left;
}

.recipe-eat-sheet button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.recipe-feedback-sheet p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.recipe-feedback-sheet button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.recipe-builder {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.recipe-builder > div {
  display: grid;
  gap: 7px;
}

.recipe-builder span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.recipe-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recipe-choice-row button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recipe-choice-row button.is-active {
  background: rgba(154, 108, 255, 0.28);
  color: var(--text);
}

.recipe-detail {
  display: grid;
  gap: 13px;
}

.recipe-hero-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.recipe-hero-line strong {
  font-size: 28px;
  line-height: 1;
}

.recipe-hero-line span,
.recipe-meta-row,
.recipe-block p {
  color: var(--muted);
  font-size: 13px;
}

.recipe-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recipe-meta-row span {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.recipe-block {
  display: grid;
  gap: 8px;
}

.recipe-block h3 {
  margin: 0;
  font-size: 16px;
}

.recipe-block p {
  display: flex;
  gap: 9px;
  line-height: 1.35;
}

.recipe-block p b {
  display: grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(154, 108, 255, 0.18);
  color: var(--accent-2);
  font-size: 12px;
}

.recipe-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.recipe-action-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.recipe-action-btn.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: white;
}

.recipe-action-btn.video {
  background: rgba(82, 190, 128, 0.14);
  color: #aef0c4;
}

.compact-cta {
  min-height: 40px;
  margin-top: 4px;
  padding: 0 14px;
  font-size: 14px;
}

.danger-text {
  color: var(--danger);
}

.compact-empty {
  min-height: 360px;
}

.settings-row strong small {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 650;
}

.settings-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 32px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.055));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.profile-avatar {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: white;
  font-size: 24px;
  font-weight: 900;
}

.profile-card div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.profile-card strong {
  display: block;
  color: var(--text);
  font-size: 22px;
}

.profile-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.profile-pill {
  flex: 0 0 auto;
  max-width: 104px;
  overflow: hidden;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.profile-metrics article,
.profile-sheet-card {
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
}

.profile-metrics span {
  display: block;
  font-size: 20px;
}

.profile-metrics strong,
.profile-sheet-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.05;
}

.profile-metrics small,
.profile-sheet-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-section {
  display: grid;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  gap: 10px;
}

.profile-section h2 {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(189, 236, 99, 0.18), rgba(143, 115, 246, 0.12)),
    rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.profile-hero-main {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 13px;
}

.profile-hero-main > div:last-child {
  min-width: 0;
}

.profile-kicker {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(248, 246, 255, 0.74);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-hero strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--text);
  font-size: 23px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-hero small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-overview-card,
.profile-health-card {
  display: grid;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  gap: 14px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
}

.profile-overview-head,
.profile-health-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-overview-head > div,
.profile-health-card > div {
  min-width: 0;
}

.profile-overview-head span,
.profile-health-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-overview-head strong,
.profile-health-card strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 3px;
  color: var(--text);
  font-size: 25px;
  line-height: 1.05;
}

.profile-health-card small {
  display: block;
  max-width: 430px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
}

.profile-health-card i {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  background: rgba(189, 236, 99, 0.14);
  color: var(--accent);
  font-style: normal;
  font-size: 15px;
  font-weight: 950;
}

.profile-health-card.is-done i {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: white;
}

.profile-mini-action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

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

.profile-macro-strip article {
  min-width: 0;
  padding: 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.055);
}

.profile-macro-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-macro-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.05;
}

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

.profile-quick-action {
  display: grid;
  min-width: 0;
  min-height: 92px;
  justify-items: start;
  align-content: start;
  gap: 5px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  text-align: left;
}

.profile-quick-action span {
  font-size: 21px;
  line-height: 1;
}

.profile-quick-action strong {
  font-size: 16px;
  line-height: 1.1;
}

.profile-quick-action small {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-card {
  display: grid;
  min-height: 520px;
  place-items: center;
  padding: 26px;
  text-align: center;
}

.empty-card .mascot {
  font-size: 118px;
}

.primary-cta {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: white;
  font-size: 15px;
  font-weight: 850;
}

.sheet .primary-cta,
.inline-form .primary-cta,
.profile-sheet-card .primary-cta {
  min-height: 40px;
  margin-top: 8px;
  padding: 0 14px;
  font-size: 14px;
}

.empty-card .primary-cta {
  min-height: 54px;
  margin-top: 20px;
  font-size: 17px;
}

.bottom-nav {
  position: fixed;
  right: auto;
  bottom: 8px;
  left: 50%;
  z-index: 20;
  width: min(588px, calc(100% - 18px));
  transform: translateX(-50%);
  justify-content: space-between;
  height: calc(66px + env(safe-area-inset-bottom));
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 24px;
  background: rgba(20, 18, 27, 0.82);
  box-shadow:
    0 18px 54px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.bottom-nav::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 23px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.nav-btn,
.main-add {
  position: relative;
  z-index: 1;
}

.nav-btn {
  display: grid;
  flex: 1 1 0;
  min-width: 0;
  max-width: 82px;
  min-height: 48px;
  gap: 3px;
  place-items: center;
  border-radius: 18px;
  background: transparent;
  color: rgba(248, 246, 255, 0.62);
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-btn span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  opacity: 0.72;
  transform: translateY(1px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.nav-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
  transition: stroke-width 160ms ease;
}

.nav-btn small {
  max-width: 100%;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 760;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-btn.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #f8f6ff;
}

.nav-btn.is-active span {
  opacity: 1;
  transform: translateY(-1px);
}

.nav-btn.is-active svg {
  stroke-width: 2.05;
}

.nav-btn:active {
  transform: scale(0.96);
}

.main-add {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  margin: -17px 7px 0;
  border-radius: 999px;
  border: 4px solid rgba(20, 18, 27, 0.92);
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.34), transparent 28%),
    linear-gradient(180deg, #a989ff, var(--accent));
  box-shadow:
    0 14px 30px rgba(130, 87, 255, 0.42),
    0 5px 14px rgba(0, 0, 0, 0.35);
  color: white;
  font-size: 31px;
  font-weight: 520;
  line-height: 1;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.main-add:active {
  transform: scale(0.94);
  box-shadow: 0 8px 20px rgba(130, 87, 255, 0.34);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
}

.sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 31;
  max-width: 620px;
  max-height: 88vh;
  margin: 0 auto;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 10px 22px calc(28px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: #050507;
}

.sheet-handle {
  width: 52px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: #3a3545;
}

.sheet-head {
  position: sticky;
  top: -10px;
  z-index: 4;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 8px 0 10px;
  background: #050507;
}

.sheet-body {
  display: grid;
  gap: 14px;
}

.sheet-group-title {
  margin: 14px 0 2px;
  color: var(--text);
  font-size: 18px;
  font-weight: 820;
}

.sheet-action {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--surface);
  text-align: left;
}

.sheet-action span {
  color: var(--accent-2);
  font-size: 30px;
}

.sheet-action strong {
  display: block;
  font-size: 20px;
}

.sheet-action small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.sheet-action em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
  font-size: 28px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  left: 20px;
  z-index: 40;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  text-align: center;
  font-weight: 760;
}

.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  translate: -100% 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  animation: shimmer 1.35s infinite;
}

@keyframes shimmer {
  to { translate: 100% 0; }
}

@media (max-width: 390px) {
  .app-shell {
    padding-inline: 12px;
  }

  h1 {
    font-size: 23px;
  }

  .hero-card {
    grid-template-columns: minmax(0, 1fr) 108px minmax(0, 1fr);
    min-height: 218px;
    gap: 12px 6px;
    padding: 10px 8px;
  }

  .calorie-ring {
    width: 108px;
  }

  .calorie-ring span {
    width: 68px;
    height: 44px;
    font-size: 21px;
  }

  .calorie-ring small {
    margin-top: -8px;
    font-size: 15px;
  }

  .calorie-side strong {
    font-size: 19px;
  }

  .calorie-side span {
    font-size: 15px;
  }

  .macro-row {
    gap: 14px;
  }

  .pill small {
    font-size: 15px;
  }

  .pill strong {
    font-size: 14px;
  }

  .nutrient-head {
    font-size: 15px;
  }

  .meal-grid {
    gap: 10px;
  }

  .meal-card {
    min-height: 140px;
    padding: 12px;
  }

  .meal-card strong {
    font-size: 25px;
  }

  .meal-icon {
    width: 28px;
    height: 28px;
  }

  .meal-icon svg {
    width: 18px;
    height: 18px;
  }

  .bottom-nav {
    width: min(100% - 12px, 588px);
    padding-inline: 7px;
  }

  .nav-btn small {
    font-size: 10px;
  }

  .nav-btn {
    max-width: 70px;
  }

  .nav-btn span {
    width: 23px;
    height: 23px;
  }

  .nav-btn svg {
    width: 22px;
    height: 22px;
  }

  .main-add {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
    margin-inline: 5px;
  }
}
