:root {
  --orange: #ff6a00;
  --orange-2: #ff8a2a;
  --orange-dark: #d94f00;
  --orange-soft: #fff1e8;
  --graphite: #111111;
  --graphite-2: #242424;
  --muted: #747474;
  --line: #ece8e3;
  --surface: #ffffff;
  --bg: #f5f4f2;
  --success: #1c9b66;
  --shadow: 0 18px 42px rgba(15, 15, 15, 0.13);
  --soft-shadow: 0 10px 24px rgba(15, 15, 15, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  background:
    linear-gradient(180deg, #151515 0, #151515 18.5rem, var(--bg) 18.5rem),
    var(--bg);
  color: var(--graphite);
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(6.8rem + env(safe-area-inset-bottom));
}

.hero,
main {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 1rem;
}

.hero {
  padding-top: 1rem;
  color: #fff;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--orange);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  color: #fff;
  font-size: clamp(1.7rem, 7.2vw, 3.4rem);
  line-height: 0.98;
}

.calorie-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 2.55rem;
  padding: 0.5rem 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.hero-card,
.panel,
.meal-card {
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  display: grid;
  gap: 1rem;
  overflow: hidden;
  padding: 1.1rem;
  color: var(--graphite);
  animation: riseIn 0.55s ease both;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 106, 0, 0.16), transparent 42%),
    radial-gradient(circle at 88% 16%, rgba(255, 106, 0, 0.24), transparent 7rem);
}

.hero-content,
.progress-wrap {
  position: relative;
  z-index: 1;
}

.hero-label {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.hero-card h2 {
  margin-bottom: 0.75rem;
  max-width: 14ch;
  font-size: clamp(2rem, 9.4vw, 4.1rem);
  line-height: 0.96;
}

.hero-copy {
  margin-bottom: 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}

.hero-stats div {
  min-height: 4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.76);
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats strong {
  margin-bottom: 0.2rem;
  font-size: 1.05rem;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.progress-wrap {
  align-self: end;
  border-radius: 8px;
  padding: 1rem;
  background:
    linear-gradient(145deg, #111, #252525);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.progress-top,
.daily-status,
.history-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.progress-top span {
  color: rgba(255, 255, 255, 0.74);
  font-weight: 800;
}

.progress-top strong {
  font-size: 1.45rem;
}

.progress-bar {
  height: 0.9rem;
  margin: 0.85rem 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ffd05a);
  box-shadow: 0 0 18px rgba(255, 106, 0, 0.45);
  transition: width 0.45s ease;
}

.progress-wrap p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.85rem;
  background: #202020;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.quick-btn span {
  display: inline-grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--orange);
  font-size: 1rem;
}

.quick-btn:active {
  transform: scale(0.98);
}

main {
  display: grid;
  gap: 1rem;
}

.panel,
.meal-card {
  scroll-margin-top: 1rem;
  padding: 1rem;
  color: var(--graphite);
  animation: riseIn 0.48s ease both;
}

.section-heading,
.meal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.meal-title h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
  line-height: 1.1;
}

.section-icon,
.meal-title > span {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 1.15rem;
  font-weight: 800;
}

.meal-title p {
  margin-bottom: 0.2rem;
  color: var(--orange-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.daily-status {
  padding: 0.9rem;
  border-radius: 8px;
  background: linear-gradient(145deg, #111, #2a2a2a);
  color: #fff;
  margin-bottom: 0.65rem;
  box-shadow: var(--soft-shadow);
}

.daily-status div {
  display: grid;
  gap: 0.1rem;
}

.daily-status strong {
  font-size: 1.65rem;
}

.daily-status span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.88rem;
}

.ghost-btn,
.primary-btn {
  min-height: 3rem;
  border: 0;
  border-radius: 8px;
  padding: 0 1rem;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}

.history-title .ghost-btn {
  min-height: 2.65rem;
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.primary-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  box-shadow: 0 12px 26px rgba(255, 106, 0, 0.28);
}

.primary-btn:active,
.ghost-btn:active {
  transform: scale(0.98);
}

.daily-progress {
  height: 0.55rem;
  margin-bottom: 0.85rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e4de;
}

.daily-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ffbf55);
  transition: width 0.35s ease;
}

.checklist-grid {
  display: grid;
  gap: 0.65rem;
}

.check-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 0.85rem;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 15, 15, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.check-item:has(input:checked) {
  border-color: rgba(255, 106, 0, 0.36);
  background: var(--orange-soft);
}

.check-item:active {
  transform: scale(0.99);
}

.check-item span {
  font-weight: 800;
}

.check-item input {
  width: 1.55rem;
  height: 1.55rem;
  accent-color: var(--orange);
}

.meals-panel {
  padding: 1rem;
}

.meal-grid {
  display: grid;
  gap: 0.85rem;
}

.meal-card {
  position: relative;
  box-shadow: 0 12px 30px rgba(15, 15, 15, 0.09);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.meal-card::after {
  content: "";
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.2rem;
  height: 0.22rem;
  border-radius: 999px;
  background: var(--orange);
}

.meal-card:active {
  transform: translateY(1px) scale(0.995);
  box-shadow: 0 8px 20px rgba(15, 15, 15, 0.08);
}

.meal-items {
  display: grid;
  gap: 0.55rem;
}

.meal-items p {
  display: grid;
  gap: 0.18rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.72rem 0.78rem;
  background: #fff;
}

.meal-items strong {
  color: var(--graphite);
  font-size: 0.83rem;
}

.meal-items span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.favorite-box {
  margin-top: 0.75rem;
  border-radius: 8px;
  padding: 0.9rem;
  background: linear-gradient(145deg, #111, #292929);
  color: #fff;
}

.favorite-box p {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.swap-grid {
  display: grid;
  gap: 0.75rem;
}

.swap-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 15, 15, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.swap-grid article:active {
  transform: scale(0.99);
  box-shadow: 0 5px 12px rgba(15, 15, 15, 0.05);
}

.swap-grid h3 {
  margin-bottom: 0.35rem;
  font-size: 0.98rem;
}

.swap-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.weight-form,
.notes-form {
  display: grid;
  gap: 0.8rem;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--graphite-2);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 0.95rem;
  background: #fff;
  color: var(--graphite);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.12);
}

textarea {
  resize: vertical;
}

.weight-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.weight-summary div {
  border-radius: 8px;
  padding: 1rem;
  background: var(--orange-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.12);
}

.weight-summary span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--orange-dark);
  font-weight: 800;
}

.weight-summary strong {
  font-size: 1.55rem;
}

.evolution-message,
.export-copy {
  margin: 1rem 0 0;
  border-left: 0.3rem solid var(--orange);
  padding: 0.78rem 0.85rem;
  border-radius: 8px;
  background: #fff;
  color: var(--graphite-2);
  font-weight: 700;
  line-height: 1.45;
}

.history-block {
  margin-top: 1rem;
}

.history-title {
  margin-bottom: 0.7rem;
}

.history-title h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.history-list {
  display: grid;
  gap: 0.55rem;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  background: #fff;
}

.history-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.history-row strong {
  white-space: nowrap;
}

.empty-history {
  margin: 0;
  color: var(--muted);
}

.export-panel {
  background:
    linear-gradient(145deg, rgba(255, 106, 0, 0.08), rgba(255, 255, 255, 0.96) 42%),
    #fff;
}

.export-btn {
  margin-top: 0.85rem;
}

.save-feedback {
  min-height: 1.4rem;
  margin: 0.7rem 0 0;
  color: var(--success);
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(calc(100% - 1rem), 30rem);
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 0.35rem;
  background: rgba(17, 17, 17, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  gap: 0.16rem;
  min-height: 3.35rem;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.68rem;
  font-weight: 800;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.bottom-nav a span {
  display: grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}

.bottom-nav a:hover,
.bottom-nav a:focus,
.bottom-nav a.is-active {
  background: var(--orange);
  color: #fff;
}

.bottom-nav a:active {
  transform: translateY(1px);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (min-width: 720px) {
  .hero,
  main {
    padding-inline: 1.5rem;
  }

  .hero-card {
    grid-template-columns: 1.14fr 0.86fr;
    align-items: end;
    padding: 1.35rem;
  }

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

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

  .weight-form,
  .notes-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weight-form .primary-btn,
  .notes-form .primary-btn {
    grid-column: 1 / -1;
  }
}

@media (min-width: 980px) {
  .panel,
  .meal-card,
  .hero-card {
    padding: 1.25rem;
  }

  .app-shell {
    padding-bottom: 2rem;
  }

  .bottom-nav {
    top: 1rem;
    right: 1rem;
    bottom: auto;
    left: auto;
    width: 27rem;
    transform: none;
  }
}

@media (max-width: 390px) {
  .hero,
  main {
    padding-inline: 0.75rem;
  }

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

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

  .calorie-pill {
    width: max-content;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .daily-status,
  .history-title {
    align-items: stretch;
    flex-direction: column;
  }

  .bottom-nav {
    width: calc(100% - 0.7rem);
    bottom: calc(0.45rem + env(safe-area-inset-bottom));
  }

  .bottom-nav a {
    min-height: 3.25rem;
    font-size: 0.62rem;
  }
}
