:root {
  --background: #f6f7f2;
  --background-soft: #eef6f0;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-subtle: #f4f8f5;
  --ink: #172019;
  --muted: #657068;
  --muted-strong: #465049;
  --line: rgba(23, 32, 25, 0.12);
  --line-strong: rgba(23, 32, 25, 0.18);
  --green-900: #0d432c;
  --green-700: #147a4c;
  --green-600: #23945f;
  --mint: #e5f5eb;
  --mint-strong: #c9ead6;
  --blue: #2f6fb0;
  --blue-soft: #e7f0fb;
  --amber: #f5b84b;
  --amber-soft: #fff3d5;
  --coral: #df6b57;
  --coral-soft: #fdeae6;
  --danger: #a93a32;
  --white: #ffffff;
  --shadow-sm: 0 6px 18px rgba(21, 36, 27, 0.08);
  --shadow-md: 0 18px 48px rgba(21, 36, 27, 0.12);
  --radius: 24px;
  --radius-sm: 16px;
  --radius-lg: 34px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(47, 111, 176, 0.08), transparent 26%),
    linear-gradient(180deg, #fcfdf8 0%, var(--background) 38%, #ffffff 100%);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 0 34px;
}

::selection {
  background: var(--mint-strong);
  color: var(--green-900);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

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

img {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(23, 32, 25, 0.08);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px) saturate(1.35);
}

.navbar {
  width: min(1220px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green-900);
  font-weight: 800;
}

.brand {
  flex: 0 0 auto;
  font-size: 1.18rem;
}

.brand-icon,
.footer-brand span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(20, 122, 76, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, var(--mint));
  box-shadow: 0 8px 22px rgba(20, 122, 76, 0.12);
}

.brand-icon,
.footer-brand span,
.hero-stat > span,
.result-icon,
.upload-icon,
.menu-icon,
.article-icon {
  font-size: 0;
}

.brand-icon::before,
.footer-brand span::before,
.hero-stat > span::before,
.result-icon::before,
.upload-icon::before,
.menu-icon::before,
.article-icon::before {
  font-size: 1.25rem;
  line-height: 1;
}

.brand-icon::before,
.footer-brand span::before {
  content: "\1F957";
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.nav-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted-strong);
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--green-900);
  background: var(--mint);
  outline: none;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--green-900);
  border-radius: 999px;
}

.section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 86px 28px;
  scroll-margin-top: 88px;
  position: relative;
  overflow: clip;
  border: 1px solid rgba(23, 32, 25, 0.08);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 247, 0.98));
}

.section-soft {
  width: min(1180px, calc(100% - 40px));
  max-width: none;
  padding-inline: 28px;
  border-block: 1px solid rgba(23, 32, 25, 0.08);
}

.section::before,
.section-soft::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.5), transparent 28%),
    radial-gradient(circle at bottom left, rgba(20, 122, 76, 0.05), transparent 30%);
  pointer-events: none;
}

.section > *,
.section-soft > * {
  position: relative;
  z-index: 1;
}

.section-tone-hero {
  background: linear-gradient(135deg, #f8fcf8 0%, #eef6f0 48%, #f4f8ff 100%);
}

.section-tone-mint {
  background: linear-gradient(180deg, #ffffff 0%, #f2faf4 100%);
}

.section-tone-sky {
  background: linear-gradient(180deg, #fbfdff 0%, #eef5ff 100%);
}

.section-tone-peach {
  background: linear-gradient(180deg, #fffdf9 0%, #fff0e7 100%);
}

.section-tone-warm {
  background: linear-gradient(180deg, #fffef9 0%, #fff6ea 100%);
}

.section-tone-gold {
  background: linear-gradient(180deg, #fffef9 0%, #fff8df 100%);
}

.section-tone-ice {
  background: linear-gradient(180deg, #ffffff 0%, #eff7fb 100%);
}

.section-tone-leaf {
  background: linear-gradient(180deg, #fbfefb 0%, #edf8ef 100%);
}

.section-tone-about {
  background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 52%, #f6fbf5 100%);
}

.hero {
  min-height: calc(100svh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.78fr);
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
}

.hero-content {
  max-width: 760px;
}

.hero-content h1 {
  margin: 0;
  color: var(--green-900);
  font-size: clamp(4rem, 11vw, 8rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 0.88;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tagline {
  max-width: 720px;
  margin: 24px 0 14px;
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  font-weight: 800;
  line-height: 1.14;
}

.hero-text,
.section-heading p {
  color: var(--muted);
  font-size: 1rem;
}

.hero-text {
  max-width: 650px;
  margin: 0 0 28px;
}

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

.primary-button,
.secondary-button,
.secondary-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.primary-button {
  padding: 12px 22px;
  border: 1px solid rgba(13, 67, 44, 0.08);
  background: var(--green-700);
  color: var(--white);
  box-shadow: 0 12px 28px rgba(20, 122, 76, 0.24);
}

.hero-actions .primary-button::after,
.secondary-link::after {
  content: "->";
  font-weight: 900;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--green-900);
  box-shadow: 0 16px 34px rgba(13, 67, 44, 0.24);
  outline: none;
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.secondary-button {
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  background: var(--surface-solid);
  color: var(--green-900);
}

.secondary-link {
  padding: 12px 4px;
  color: var(--green-900);
}

.secondary-button:hover,
.secondary-button:focus-visible,
.secondary-link:hover,
.secondary-link:focus-visible {
  border-color: rgba(20, 122, 76, 0.36);
  color: var(--green-700);
  outline: none;
  transform: translateY(-1px);
}

.full-button {
  width: 100%;
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(23, 32, 25, 0.1);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}

.hero-panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 4px 8px;
}

.hero-panel-header strong {
  color: var(--green-900);
  font-size: 1.18rem;
}

.panel-kicker {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.hero-stat {
  min-height: 116px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  padding: 18px;
  border: 1px solid rgba(23, 32, 25, 0.09);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f8fbf9);
}

.hero-stat > span {
  grid-row: 1 / span 2;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 20px;
  background: var(--blue-soft);
}

.hero-panel .hero-stat:nth-of-type(2) > span::before {
  content: "\1F4A7";
}

.hero-panel .hero-stat:nth-of-type(3) > span {
  background: var(--amber-soft);
}

.hero-panel .hero-stat:nth-of-type(3) > span::before {
  content: "\1F34C";
}

.hero-panel .hero-stat:nth-of-type(4) > span {
  background: var(--mint);
}

.hero-panel .hero-stat:nth-of-type(4) > span::before {
  content: "\1F3C3";
}

.hero-stat strong,
.hero-stat small {
  display: block;
}

.hero-stat strong {
  color: var(--green-900);
  font-size: 1.16rem;
  line-height: 1.2;
}

.hero-stat small {
  color: var(--muted);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 32px;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1.08;
}

.section-heading p {
  max-width: 690px;
  margin: 12px 0 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.nutrition-layout,
.challenge-layout,
.tool-layout,
.p3k-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.nutrition-form,
.tool-form,
.scanner-card,
.food-result-card,
.p3k-result-card,
.result-card,
.points-card,
.challenge-list,
.article-detail {
  padding: 24px;
}

.nutrition-form label,
.tool-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 800;
}

.nutrition-form input[type="text"],
.nutrition-form input[type="number"],
.tool-form input,
.tool-form select,
.tool-form textarea {
  width: 100%;
  min-height: 48px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  outline: none;
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.nutrition-form input::placeholder,
.tool-form input::placeholder,
.tool-form textarea::placeholder {
  color: #909b94;
}

.nutrition-form input:focus,
.tool-form input:focus,
.tool-form select:focus,
.tool-form textarea:focus {
  border-color: rgba(20, 122, 76, 0.55);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(20, 122, 76, 0.12);
}

.tool-form select {
  cursor: pointer;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.medical-disclaimer {
  margin: -6px 0 24px;
  padding: 16px 18px;
  border: 1px solid rgba(245, 184, 75, 0.42);
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: #715116;
}

.medical-disclaimer strong {
  color: #5f410f;
}

.danger-fieldset {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.scanner-card {
  display: grid;
  gap: 18px;
}

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

.danger-fieldset legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 800;
}

.danger-fieldset .checkbox-item {
  margin: 0;
}

.p3k-result-card {
  min-height: 100%;
}

.p3k-result-card h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.25;
}

.p3k-result-card h4 {
  margin: 18px 0 8px;
  color: var(--green-900);
  font-size: 1.02rem;
}

.p3k-result-card p {
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 10px 0 18px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 800;
}

.badge-safe {
  background: var(--mint);
  color: var(--green-900);
}

.badge-warning {
  background: var(--amber-soft);
  color: #715116;
}

.badge-danger {
  background: var(--coral-soft);
  color: var(--danger);
}

.guide-list,
.medicine-list,
.avoid-list,
.urgent-list,
.danger-list,
.summary-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.guide-list li,
.medicine-list li,
.avoid-list li,
.urgent-list li,
.danger-list li,
.summary-list li {
  margin-bottom: 8px;
}

.medicine-list {
  color: var(--green-900);
}

.avoid-list,
.urgent-list {
  color: #715116;
}

.warning-panel,
.danger-panel,
.safe-panel {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius);
  font-weight: 700;
}

.warning-panel {
  border: 1px solid rgba(245, 184, 75, 0.42);
  background: var(--amber-soft);
  color: #715116;
}

.danger-panel {
  border: 1px solid rgba(169, 58, 50, 0.22);
  background: var(--coral-soft);
  color: var(--danger);
}

.safe-panel {
  border: 1px solid rgba(20, 122, 76, 0.18);
  background: var(--mint);
  color: var(--green-900);
}

.checkbox-group {
  display: grid;
  gap: 10px;
  margin: 4px 0 20px;
}

.checkbox-item,
.challenge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.checkbox-item:hover,
.challenge-item:hover {
  border-color: rgba(20, 122, 76, 0.28);
  background: #ffffff;
}

.checkbox-item input,
.challenge-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--green-700);
  flex: 0 0 auto;
}

.result-card,
.points-card {
  text-align: center;
}

.result-icon {
  display: inline-grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(20, 122, 76, 0.12);
  border-radius: var(--radius);
  background: var(--mint);
}

.result-icon::before {
  content: "\1F4CA";
  font-size: 1.8rem;
}

#bmi .result-icon::before {
  content: "\2696";
}

#scan-makanan .result-icon::before {
  content: "\1F37D";
}

#p3k-sehat .p3k-result-card .result-icon::before {
  content: "\1FA7A";
}

#tantangan .result-icon::before {
  content: "\2605";
}

.result-label {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.score-number {
  display: block;
  margin: 6px 0 16px;
  color: var(--green-900);
  font-size: clamp(3rem, 7vw, 4.8rem);
  font-weight: 850;
  line-height: 1;
}

.progress-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: 1px solid rgba(23, 32, 25, 0.05);
  border-radius: 999px;
  background: #e7eee9;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--green-600), var(--amber));
  transition: width 0.35s ease;
}

.category {
  margin: 14px 0 0;
  color: var(--green-900);
  font-weight: 800;
}

.advice-box {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(23, 32, 25, 0.06);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  text-align: left;
}

.advice-box h3 {
  margin: 0 0 8px;
  color: var(--ink);
}

.advice-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.menu-grid {
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
}

.article-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-button {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--green-900);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.filter-button.active,
.filter-button:hover,
.filter-button:focus-visible {
  border-color: var(--green-700);
  background: var(--green-700);
  color: var(--white);
  outline: none;
  transform: translateY(-1px);
}

.menu-card,
.article-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 20px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.menu-card:hover,
.article-card:hover,
.article-card:focus-visible {
  border-color: rgba(20, 122, 76, 0.28);
  box-shadow: var(--shadow-md);
  outline: none;
  transform: translateY(-2px);
}

.menu-icon,
.article-icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.menu-icon {
  background: var(--amber-soft);
}

.menu-icon::before {
  content: "\1F37D";
}

.article-icon::before {
  content: "\1F4D8";
}

.menu-card h3,
.article-card h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.06rem;
  line-height: 1.25;
}

.menu-card p,
.article-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.price {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: #80580d;
  font-weight: 800;
}

.meal-tag {
  width: fit-content;
  margin-top: auto;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--mint);
  color: var(--green-900);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: capitalize;
}

.article-card {
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.article-card.active {
  border-color: rgba(20, 122, 76, 0.34);
  background: linear-gradient(180deg, #ffffff 0%, #eff8f2 100%);
  box-shadow: 0 14px 34px rgba(20, 122, 76, 0.12);
}

.article-tag,
.article-detail-tag,
.article-link {
  width: fit-content;
  border-radius: 999px;
  font-weight: 800;
}

.article-tag,
.article-detail-tag {
  padding: 6px 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.8rem;
}

.article-link {
  margin-top: auto;
  padding: 7px 0 0;
  color: var(--green-700);
  font-size: 0.9rem;
}

.article-actions {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.article-detail {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.article-detail h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.5rem;
}

.article-detail h4 {
  margin: 0;
  color: var(--green-900);
  font-size: 1rem;
}

.article-detail p {
  margin: 0;
  color: var(--muted);
}

.detail-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.detail-list li {
  margin-bottom: 8px;
}

.article-extra {
  display: grid;
  gap: 12px;
}

.article-detail .secondary-button {
  width: fit-content;
}

.detail-placeholder {
  color: var(--muted);
}

.challenge-list {
  display: grid;
  gap: 12px;
}

.challenge-item {
  justify-content: flex-start;
  font-weight: 800;
  color: var(--green-900);
}

.challenge-item.done {
  border-color: rgba(20, 122, 76, 0.35);
  background: var(--mint);
}

.challenge-fill {
  background: linear-gradient(90deg, var(--amber), var(--green-600));
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 28px;
  align-items: center;
}

.about-story {
  max-width: 620px;
}

.about-story h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
}

.about-story p {
  margin: 16px 0 0;
  color: var(--muted);
}

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

.about-card {
  padding: 20px;
}

.about-icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: var(--mint);
  font-size: 1.45rem;
}

.about-card h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.06rem;
}

.about-card p {
  margin: 0;
  color: var(--muted);
}

.bmi-fill {
  background: linear-gradient(90deg, var(--blue), var(--green-600), var(--amber), var(--coral));
}

.scanner-card input[type="file"] {
  display: none;
}

.upload-box {
  display: grid;
  min-height: 176px;
  place-items: center;
  gap: 8px;
  padding: 24px;
  border: 1.5px dashed rgba(20, 122, 76, 0.36);
  border-radius: var(--radius);
  background: rgba(229, 245, 235, 0.52);
  text-align: center;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.upload-box:hover,
.upload-box:focus-within {
  border-color: var(--green-700);
  background: var(--mint);
}

.upload-icon {
  display: inline-grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

.upload-icon::before {
  content: "\1F4F7";
  font-size: 1.8rem;
}

.upload-box strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.upload-box small,
.preview-box p,
.food-result-card p,
#idealWeightText,
#bmiAdvice {
  color: var(--muted);
}

.preview-box {
  display: grid;
  min-height: 240px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  text-align: center;
}

.food-picker {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.food-picker legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 800;
}

.food-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.food-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.food-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.food-option span {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--muted-strong);
  text-align: center;
  font-weight: 800;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.food-option input:checked + span {
  border-color: rgba(20, 122, 76, 0.32);
  background: linear-gradient(180deg, var(--green-700), var(--green-900));
  color: var(--white);
  box-shadow: 0 12px 24px rgba(20, 122, 76, 0.18);
}

.food-option input:focus-visible + span,
.food-option:hover span {
  border-color: rgba(20, 122, 76, 0.32);
  transform: translateY(-1px);
}

.scanner-note {
  margin: -4px 0 0;
  color: var(--muted);
}

.preview-box img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.food-result-card {
  min-height: 100%;
  text-align: center;
}

.food-result-card h3 {
  margin: 10px 0;
  color: var(--ink);
  font-size: 1.5rem;
}

.food-facts {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.food-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--muted);
  text-align: left;
}

.food-fact strong {
  color: var(--green-900);
}

.food-message {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: #715116;
  font-weight: 800;
}

.loading-box {
  display: grid;
  min-height: 280px;
  place-items: center;
  align-content: center;
  gap: 18px;
}

.hidden {
  display: none;
}

.loader {
  width: 54px;
  height: 54px;
  border: 5px solid var(--mint);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.site-footer {
  padding: 34px 16px;
  color: rgba(255, 255, 255, 0.78);
  background: #102117;
}

.footer-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.footer-brand {
  flex: 0 0 auto;
  color: #ffffff;
}

.footer-brand span {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.site-footer p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.footer-credit {
  flex: 0 0 auto;
  text-align: right;
}

.footer-credit strong {
  color: #ffffff;
}

@media (max-width: 1080px) {
  .navbar {
    width: min(100% - 32px, 1180px);
    min-height: 64px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    min-height: 44px;
  }

  .section {
    width: min(100% - 28px, 1180px);
    padding: 64px 24px;
    scroll-margin-top: 76px;
  }

  .section-soft {
    width: min(100% - 28px, 1180px);
    padding-inline: 24px;
  }

  .hero,
  .nutrition-layout,
  .challenge-layout,
  .tool-layout,
  .p3k-layout,
  .about-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    align-items: start;
  }

  .hero-content h1 {
    font-size: clamp(3.7rem, 17vw, 6.5rem);
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-credit {
    text-align: left;
  }

  .about-story {
    max-width: none;
  }

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

@media (max-width: 700px) {
  .navbar {
    width: min(100% - 24px, 1180px);
  }

  .section {
    width: min(100% - 24px, 1180px);
    padding: 54px 18px;
  }

  .section-soft {
    width: min(100% - 24px, 1180px);
    padding-inline: 18px;
  }

  .hero-actions,
  .button-row {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .secondary-link {
    width: 100%;
  }

  .secondary-link {
    padding-inline: 12px;
    border: 1px solid var(--line);
    background: var(--surface-solid);
  }

  .hero-panel {
    padding: 12px;
  }

  .hero-panel-header,
  .hero-stat {
    align-items: start;
  }

  .hero-stat {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 104px;
    padding: 14px;
  }

  .hero-stat > span {
    width: 48px;
    height: 48px;
  }

  .nutrition-form,
  .tool-form,
  .scanner-card,
  .food-result-card,
  .p3k-result-card,
  .result-card,
  .points-card,
  .challenge-list,
  .article-detail,
  .menu-card,
  .article-card {
    padding: 18px;
  }

  .danger-fieldset {
    grid-template-columns: 1fr;
  }

  .food-picker-grid {
    grid-template-columns: 1fr 1fr;
  }

  .menu-grid,
  .article-grid,
  .about-card-grid {
    grid-template-columns: 1fr;
  }

  .preview-box img {
    height: 220px;
  }

  .food-fact {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 520px) {
  main {
    gap: 14px;
    padding: 14px 0 22px;
  }

  .section,
  .section-soft {
    width: min(100% - 16px, 1180px);
    padding: 42px 14px;
    border-radius: 26px;
  }

  .hero-content h1 {
    font-size: clamp(3rem, 18vw, 4.8rem);
  }

  .tagline {
    font-size: clamp(1.3rem, 7vw, 1.8rem);
  }

  .hero-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .food-picker-grid {
    grid-template-columns: 1fr;
  }

  .score-number {
    font-size: clamp(2.6rem, 12vw, 3.6rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
