:root {
  color-scheme: light;
  --cream-50: #fffdf7;
  --cream-100: #faf4e8;
  --cream-200: #efe1c5;
  --green-950: #082f25;
  --green-850: #0f513d;
  --green-700: #1f7a59;
  --green-600: #29966c;
  --green-200: #cdebd4;
  --green-100: #eaf7ee;
  --mint-100: #f2fbf4;
  --blue-100: #e9f6f8;
  --blue-700: #226c83;
  --amber-100: #fff0d7;
  --amber-700: #a96315;
  --danger-100: #fff0eb;
  --danger-700: #9b3b25;
  --text: #11382e;
  --muted: #6a776f;
  --line: #dce9dd;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 42px rgba(8, 47, 37, 0.09);
  --shadow-soft: 0 10px 24px rgba(8, 47, 37, 0.06);
  --focus: 0 0 0 4px rgba(41, 150, 108, 0.28);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --font-main: "Segoe UI", "Noto Sans Arabic", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
  --motion: 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(145deg, rgba(234, 247, 238, 0.86), rgba(255, 253, 247, 0) 36rem),
    linear-gradient(180deg, var(--cream-50) 0%, var(--cream-100) 100%);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body::selection {
  color: #ffffff;
  background: var(--green-700);
}

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

button {
  font: inherit;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--green-950);
  background: rgba(255, 253, 247, 0.96);
  font-size: 1rem;
  font-weight: 900;
  transition: opacity 220ms ease, visibility 220ms ease;
}

body:not(.is-loading) .app-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.product-shell {
  width: min(100%, 1180px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 12px 12px 18px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
}

.product-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(220, 233, 221, 0.96);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.clinic-logo,
.app-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--green-850);
  background: linear-gradient(180deg, #f7fff8, var(--green-100));
  border: 1px solid rgba(41, 150, 108, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), var(--shadow-soft);
}

.clinic-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  font-size: 1.45rem;
}

.clinic-logo.small {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy p,
.screen-kicker {
  margin: 0;
  color: var(--green-700);
  font-size: 0.78rem;
  font-weight: 900;
}

.brand-copy h1 {
  margin: 1px 0 0;
  color: var(--green-950);
  font-size: clamp(1.08rem, 5vw, 1.35rem);
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-meta {
  display: none;
}

.journey-progress {
  display: none;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.product-shell.has-progress .journey-progress {
  display: flex;
}

.journey-progress::-webkit-scrollbar {
  display: none;
}

.journey-progress button {
  min-width: max-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(8, 47, 37, 0.04);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 900;
  transition: transform var(--motion), color var(--motion), background var(--motion), border-color var(--motion);
}

.journey-progress button[disabled] {
  cursor: default;
  opacity: 0.56;
}

.journey-progress button.is-active {
  color: var(--green-950);
  background: var(--green-100);
  border-color: rgba(41, 150, 108, 0.36);
}

.journey-progress button.is-complete {
  color: var(--green-850);
}

.journey-progress button:not([disabled]):active {
  transform: scale(0.98);
}

.screen {
  width: 100%;
  min-width: 0;
  display: none;
  align-content: start;
  gap: 12px;
  animation: screenEnter 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

@keyframes screenEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.screen-card {
  min-width: 0;
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid rgba(220, 233, 221, 0.98);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.welcome-card,
.thanks-card,
.badge-card {
  min-height: min(74svh, 680px);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
}

.welcome-card h2,
.thanks-card h2,
.badge-card h2,
.step-heading h2,
.result-hero h2,
.report-header h2 {
  margin: 0;
  color: var(--green-950);
  line-height: 1.2;
  letter-spacing: 0;
}

.welcome-card h2,
.thanks-card h2 {
  font-size: clamp(2.1rem, 11vw, 4rem);
}

.lead,
.step-heading p,
.recommendation,
.whatsapp-card p,
.badge-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  font-weight: 750;
}

.app-logo {
  width: 76px;
  height: 76px;
  border-radius: 24px;
  font-size: 2rem;
}

.hero-actions {
  width: 100%;
  display: grid;
  gap: 10px;
}

.primary-button,
.secondary-button,
.quiet-button,
.condition-button,
.food-card,
.swap-button,
.whatsapp-button {
  min-height: 64px;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 950;
  letter-spacing: 0;
  transition:
    transform var(--motion),
    box-shadow var(--motion),
    background-color var(--motion),
    border-color var(--motion),
    opacity var(--motion);
}

.primary-button,
.secondary-button,
.quiet-button {
  width: 100%;
  padding: 14px 18px;
  font-size: 1.1rem;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(180deg, var(--green-700), var(--green-850));
  border: 0;
  box-shadow: 0 18px 30px rgba(15, 81, 61, 0.24);
}

.secondary-button,
.quiet-button {
  color: var(--green-850);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 16px rgba(8, 47, 37, 0.04);
}

.primary-button:hover,
.secondary-button:hover,
.quiet-button:hover,
.condition-button:hover,
.food-card:hover,
.swap-button:hover,
.whatsapp-button:hover {
  transform: translateY(-2px);
}

.primary-button:active,
.secondary-button:active,
.quiet-button:active,
.condition-button:active,
.food-card:active,
.swap-button:active,
.whatsapp-button:active {
  transform: translateY(0) scale(0.985);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.quiet-button:focus-visible,
.condition-button:focus-visible,
.food-card:focus-visible,
.swap-button:focus-visible,
.whatsapp-button:focus-visible,
.journey-progress button:focus-visible {
  outline: 0;
  box-shadow: var(--focus), var(--shadow-soft);
}

.welcome-preview {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.plate-mini {
  position: relative;
  width: min(176px, 54vw);
  aspect-ratio: 1;
  overflow: hidden;
  border: 10px solid #ffffff;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(8, 47, 37, 0.08), 0 16px 34px rgba(8, 47, 37, 0.1);
}

.plate-large {
  width: min(250px, 72vw);
}

.plate-area,
.plate-divider,
.plate-center {
  position: absolute;
}

.area-veg {
  inset: 0 0 0 50%;
  background: linear-gradient(145deg, #dff3df, #bfe7c9);
}

.area-protein {
  inset: 0 50% 50% 0;
  background: linear-gradient(145deg, #e5f5f8, #c8e9ef);
}

.area-carb {
  inset: 50% 50% 0 0;
  background: linear-gradient(145deg, #fff0d4, #f6dca8);
}

.plate-divider {
  z-index: 2;
  background: rgba(255, 255, 255, 0.82);
}

.plate-divider.vertical {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
}

.plate-divider.horizontal {
  top: 50%;
  left: 0;
  width: 50%;
  height: 2px;
}

.plate-center {
  z-index: 3;
  top: 50%;
  left: 50%;
  min-width: 60px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 4px 8px;
  color: var(--green-950);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(220, 233, 221, 0.9);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(8, 47, 37, 0.08);
  font-size: 0.78rem;
  font-weight: 950;
  transform: translate(-50%, -50%);
}

.preview-list {
  width: 100%;
  display: grid;
  gap: 10px;
}

.preview-list span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--green-950);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-weight: 900;
}

.step-card,
.plate-builder-card,
.summary-card,
.result-card,
.improve-card,
.report-card,
.whatsapp-card {
  display: grid;
  gap: 18px;
}

.step-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.step-index {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--green-850);
  border-radius: 50%;
  box-shadow: 0 10px 18px rgba(15, 81, 61, 0.2);
  font-size: 1rem;
  font-weight: 950;
}

.step-heading h2,
.result-hero h2,
.report-header h2 {
  font-size: clamp(1.55rem, 7vw, 2.3rem);
}

.condition-grid,
.swap-grid {
  display: grid;
  gap: 10px;
}

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

.condition-button {
  min-height: 108px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 12px 10px;
  color: var(--green-950);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(8, 47, 37, 0.04);
  font-size: 1.02rem;
}

.condition-button span:first-child {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--mint-100);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 1.35rem;
}

.condition-button[aria-pressed="true"],
.food-card[aria-pressed="true"] {
  border-color: rgba(31, 122, 89, 0.5);
  background: var(--green-100);
  box-shadow: 0 12px 24px rgba(31, 122, 89, 0.12);
}

.condition-button[aria-pressed="true"] span:first-child,
.food-card[aria-pressed="true"] .food-icon {
  animation: pop 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pop {
  50% {
    transform: translateY(-4px) scale(1.08);
  }
}

.plate-status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.live-score-card,
.improve-score-panel,
.report-score {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 18px rgba(8, 47, 37, 0.04);
}

.live-score-card span,
.improve-score-panel span,
.report-score span,
.nutrition-item span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.live-score-card strong,
.improve-score-panel strong,
.report-score strong {
  color: var(--green-950);
  font-size: clamp(1.45rem, 8vw, 2.4rem);
  line-height: 1;
  direction: ltr;
  unicode-bidi: isolate;
}

.live-score-card small,
.report-score small {
  color: var(--green-700);
  font-size: 0.9rem;
  font-weight: 900;
}

.score-track {
  height: 12px;
  overflow: hidden;
  direction: ltr;
  background: #edf4ed;
  border-radius: 999px;
}

.score-track span {
  width: 0;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--green-600), var(--green-850));
  border-radius: inherit;
  transition: width 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.food-groups {
  display: grid;
  gap: 16px;
}

.food-group {
  display: grid;
  gap: 10px;
}

.food-group h3 {
  margin: 0;
  color: var(--green-950);
  font-size: 1.08rem;
}

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

.food-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 12px 8px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(8, 47, 37, 0.04);
  text-align: center;
}

.food-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--mint-100);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 1.38rem;
}

.food-name {
  color: var(--green-950);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.25;
}

.food-note {
  display: none;
}

.sticky-actions {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  width: 100%;
  padding: 8px;
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid rgba(220, 233, 221, 0.72);
  border-radius: 22px;
  box-shadow: 0 14px 30px rgba(8, 47, 37, 0.14);
  backdrop-filter: blur(16px);
}

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

.summary-row {
  min-height: 62px;
  display: grid;
  gap: 4px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.summary-row strong {
  color: var(--green-700);
  font-size: 0.9rem;
}

.summary-row span {
  color: var(--green-950);
  font-size: 1.02rem;
  font-weight: 900;
}

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

.nutrition-item {
  min-height: 82px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
}

.nutrition-item strong {
  color: var(--green-950);
  font-size: 1.18rem;
  line-height: 1;
}

.result-hero {
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}

.score-ring {
  position: relative;
  width: 164px;
  height: 164px;
  display: grid;
  place-items: center;
}

.score-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring circle {
  fill: none;
  stroke: #e8f0e7;
  stroke-width: 10;
}

#scoreRingProgress {
  stroke: var(--green-700);
  stroke-linecap: round;
  stroke-dasharray: 320.44;
  stroke-dashoffset: 320.44;
  transition: stroke-dashoffset 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.score-ring div {
  z-index: 1;
  display: grid;
  justify-items: center;
  color: var(--green-950);
}

.score-ring strong {
  font-size: 2.8rem;
  line-height: 0.9;
}

.score-ring span {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
}

.score-label {
  margin: 8px 0 0;
  color: var(--green-700);
  font-size: 1.35rem;
  font-weight: 950;
}

.recommendation {
  margin-top: 10px;
}

.compact .summary-row {
  min-height: 52px;
  grid-template-columns: 116px 1fr;
  align-items: center;
}

.improve-card {
  overflow: hidden;
}

.improve-score-panel {
  background: linear-gradient(180deg, #ffffff, var(--mint-100));
}

.success-toast {
  min-height: 0;
  display: none;
  place-items: center;
  padding: 12px;
  color: #075d3d;
  background: #dff5e6;
  border: 1px solid rgba(41, 150, 108, 0.32);
  border-radius: 18px;
  font-size: 1.08rem;
  font-weight: 950;
}

.success-toast.is-visible {
  display: grid;
  animation: toastIn 260ms ease both;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.swap-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 22px rgba(8, 47, 37, 0.05);
}

.swap-card.is-applied {
  background: var(--mint-100);
  border-color: rgba(41, 150, 108, 0.38);
}

.swap-card.is-animating {
  animation: swapPulse 640ms ease both;
}

@keyframes swapPulse {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.025);
    box-shadow: 0 22px 40px rgba(31, 122, 89, 0.18);
  }
  100% {
    transform: scale(1);
  }
}

.swap-flow {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.swap-choice {
  width: 100%;
  display: grid;
  gap: 6px;
}

.swap-choice small {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 950;
}

.swap-choice strong {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 1.08rem;
}

.swap-current strong {
  color: var(--danger-700);
  background: var(--danger-100);
}

.swap-better strong {
  color: var(--green-950);
  background: var(--green-100);
}

.swap-arrow {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--green-700);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 950;
}

.swap-button {
  width: 100%;
  padding: 12px 16px;
  color: #ffffff;
  background: var(--green-850);
  border: 0;
  font-size: 1.04rem;
}

.swap-button:disabled {
  cursor: default;
  opacity: 0.76;
}

.celebration-card {
  display: none;
  gap: 10px;
  padding: 16px;
  color: var(--green-950);
  background: linear-gradient(180deg, #ffffff, var(--green-100));
  border: 1px solid rgba(41, 150, 108, 0.26);
  border-radius: 24px;
  text-align: center;
}

.celebration-card.is-visible {
  display: grid;
  animation: screenEnter 380ms ease both;
}

.celebration-card h3 {
  margin: 0;
  font-size: 1.55rem;
}

.celebration-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

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

.report-score {
  text-align: center;
}

.report-score small {
  color: var(--green-700);
}

.report-notes {
  padding: 14px;
  color: var(--green-950);
  background: var(--green-100);
  border: 1px solid rgba(41, 150, 108, 0.22);
  border-radius: 18px;
  font-weight: 850;
}

.report-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.qr-action-layout {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.whatsapp-button {
  width: 100%;
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 14px 18px;
  color: #ffffff;
  background: #1e9a5d;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 18px 32px rgba(30, 154, 93, 0.24);
  text-align: center;
  text-decoration: none;
  font-size: 1.13rem;
}

.qr-card {
  width: min(260px, 100%);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 24px rgba(8, 47, 37, 0.06);
}

.qr-svg {
  width: min(196px, 70vw);
  height: auto;
  aspect-ratio: 1;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #edf3eb;
  border-radius: 16px;
}

.qr-svg rect {
  shape-rendering: crispEdges;
}

.qr-card span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
}

.thanks-card {
  justify-items: center;
  text-align: center;
}

.badge-card {
  min-height: min(78svh, 720px);
  justify-items: center;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(234, 247, 238, 0.78)),
    #ffffff;
}

.badge-title {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.badge-title span {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  font-size: 2.4rem;
}

.badge-card p {
  color: var(--green-850);
  font-size: 1.3rem;
  font-weight: 950;
}

.badge-qr {
  width: min(330px, 88vw);
}

.badge-qr .qr-svg {
  width: min(260px, 74vw);
}

.animated-arrow {
  color: var(--green-700);
  font-size: 2.4rem;
  font-weight: 950;
  animation: arrowBounce 1.1s ease-in-out infinite;
}

@keyframes arrowBounce {
  50% {
    transform: translateY(8px);
  }
}

.product-footer {
  align-self: start;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  display: grid;
  place-items: center;
  color: #69645b;
  background: rgba(255, 253, 247, 0.7);
  border: 1px solid rgba(239, 225, 197, 0.84);
  border-radius: 18px;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 800;
}

@media (min-width: 520px) {
  .product-shell {
    padding: 16px;
  }

  .screen-card {
    padding: 24px;
  }

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

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

@media (min-width: 768px) {
  .product-shell {
    padding: 20px;
    gap: 16px;
  }

  .product-header {
    padding: 14px 16px;
  }

  .clinic-logo {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    font-size: 1.9rem;
  }

  .brand-copy p {
    font-size: 0.92rem;
  }

  .brand-copy h1 {
    font-size: clamp(1.45rem, 2.4vw, 2rem);
  }

  .header-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .header-meta span {
    min-height: 42px;
    display: grid;
    place-items: center;
    padding: 8px 12px;
    color: var(--green-850);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 900;
  }

  .journey-progress {
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
  }

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

  .screen[data-screen="welcome"].is-active {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    align-items: stretch;
  }

  .welcome-card,
  .welcome-preview {
    min-height: 560px;
  }

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

  .screen-card {
    padding: clamp(24px, 3vw, 34px);
  }

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

  .condition-button {
    min-height: 128px;
    font-size: 1.12rem;
  }

  .plate-builder-card {
    grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
    align-items: start;
  }

  .plate-builder-card .step-heading,
  .plate-status {
    grid-column: 1;
  }

  .plate-status {
    grid-template-columns: 1fr;
  }

  .food-groups {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .food-card {
    min-height: 112px;
  }

  .food-note {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
  }

  .summary-card,
  .result-card,
  .report-card,
  .whatsapp-card,
  .improve-card {
    max-width: 960px;
    justify-self: center;
    width: 100%;
  }

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

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

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

  .result-hero {
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: right;
  }

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

  .qr-action-layout {
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: center;
  }

  .sticky-actions {
    position: static;
    max-width: 960px;
    justify-self: center;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
  }

  .sticky-actions .primary-button,
  .sticky-actions .secondary-button {
    max-width: 360px;
    justify-self: center;
  }

  .report-actions {
    max-width: 960px;
  }

  .report-actions .primary-button,
  .report-actions .secondary-button {
    max-width: none;
  }
}

@media (min-width: 1024px) {
  .condition-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

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

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

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

  .screen-card {
    border-radius: 24px;
    padding: 16px;
  }

  .food-card {
    min-height: 88px;
  }

  .condition-button {
    min-height: 100px;
  }

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

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

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  body {
    background: #ffffff !important;
    color: #12382e;
  }

  .app-loader,
  .product-header,
  .journey-progress,
  .screen:not([data-screen="report"]),
  .report-actions,
  .product-footer {
    display: none !important;
  }

  .product-shell {
    width: 100%;
    min-height: auto;
    display: block;
    padding: 0;
  }

  .screen[data-screen="report"] {
    display: block !important;
  }

  .report-card,
  .summary-row,
  .nutrition-item,
  .report-score,
  .report-notes {
    box-shadow: none !important;
    background: #ffffff !important;
  }

  .report-card {
    border: 0;
    padding: 0;
  }

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