@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/noto-naskh-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/noto-naskh-bold.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/noto-sans-extrabold.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --ink: #163d35;
  --green: #154f43;
  --lime: #d9f395;
  --muted: #75857f;
  --line: #e3e9e5;
  --paper: #f7f9f6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Naskh Arabic", Tahoma, serif;
  font-size: 16px;
  line-height: 1.7;
}
main {
  max-width: 560px;
  margin: auto;
  padding: 0 24px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 38px;
}
.brand {
  text-decoration: none;
  color: var(--ink);
  font-size: 27px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-icon {
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--lime);
  width: 38px;
  height: 38px;
  border-radius: 13px;
  font-size: 28px;
}
.header-note {
  font-size: 12px;
  color: var(--muted);
}
.eyebrow {
  font-size: 13px;
  color: var(--green);
  margin: 12px 0;
}
h1 {
  font-size: 46px;
  line-height: 1.4;
  letter-spacing: normal;
  margin: 12px 0;
}
h1 span {
  color: #619177;
}
.intro {
  color: #6c7b74;
  font-size: 15px;
  margin: 17px 0 30px;
}
.input-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 20px;
  display: block;
  transition: border-color 0.2s;
}
.input-card:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #154f430b;
}
.input-card > span {
  font-size: 14px;
}
.input-card > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.input-card input {
  font:
    500 34px/1.5 Arial,
    sans-serif;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  direction: ltr;
  text-align: right;
  padding: 8px 0 0;
}
.input-card input::placeholder {
  color: #b9c4bc;
}
.input-card div > span {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.macro-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0 26px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: 4px;
}
.protein {
  background: #d49666;
}
.carbs {
  background: #a1b972;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.primary {
  background: var(--green);
  border: 0;
  color: white;
  width: 100%;
  padding: 18px 22px;
  border-radius: 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 58px;
}
.primary:hover {
  background: #103f35;
}
.primary span {
  color: var(--lime);
  font-size: 25px;
  line-height: 1;
}
.primary:disabled {
  opacity: 0.6;
}
.quiet-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 18px 0 30px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 30px;
  color: var(--muted);
  font-size: 12px;
}
details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
  min-height: 32px;
  color: var(--green);
}
:focus-visible {
  outline: 3px solid #9dbd5f;
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
#error {
  color: #9c442c;
  font-size: 14px;
}
#source-content {
  font-size: 13px;
  overflow-wrap: anywhere;
}
a {
  color: var(--green);
}
@media (min-width: 720px) {
  main {
    padding: 0 40px;
  }
  header {
    padding-top: 38px;
  }
  #start {
    padding-top: 12px;
  }
  h1 {
    font-size: 54px;
  }
}
@media (max-width: 375px) {
  main {
    padding: 0 18px;
  }
  .header-note {
    font-size: 12px;
  }
  .input-card {
    padding: 14px;
  }
  .input-card > span {
    font-size: 13px;
  }
  h1 {
    font-size: 42px;
  }
}
.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.result-heading h1 {
  font-size: 30px;
  letter-spacing: normal;
  margin: 0 0 20px;
}
.result-heading .eyebrow {
  margin: 0 0 5px;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 12px 0;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 5px;
  white-space: nowrap;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--green);
  color: #fff;
  border-radius: 20px;
  padding: 24px 12px;
}
.summary-grid > div {
  text-align: center;
  border-left: 1px solid #ffffff24;
}
.summary-grid > div:last-child {
  border: 0;
}
.summary-grid span {
  font-size: 12px;
  color: #e0ebdf;
}
.summary-grid strong {
  display: block;
  font:
    600 27px/1.7 Arial,
    sans-serif;
  color: #e0f4b1;
}
.summary-grid small {
  font-size: 12px;
  color: #c5d8cb;
}
.summary-grid .target-inline {
  opacity: 0.7;
}
.status {
  font-size: 12px;
  color: #497c5d;
  padding: 8px 0;
  margin-bottom: 12px;
}
.status.outside {
  background: #fff0db;
  border: 1px solid #eacb96;
  color: #825318;
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
}
.weight-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 24px;
}
.meal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  margin: 18px 0;
}
.meal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 6px;
}
.meal-heading h2 {
  font-size: 20px;
  margin: 0;
}
.meal-heading > span {
  font: 14px Arial;
  color: #a4b3a9;
}
.food-row {
  display: flex;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid #f0f3ee;
  align-items: flex-start;
}
.food-row img {
  flex: 0 0 64px;
  object-fit: cover;
  border-radius: 13px;
  background: #fff;
}
.food-content {
  min-width: 0;
  flex: 1;
}
h3 {
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}
.quantity {
  font-size: 13px;
  color: #577c67;
  margin: 4px 0;
}
.food-macros {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  color: #75847b;
  font-size: 12px;
}
.food-macros b {
  font-weight: 400;
  color: #4f655a;
}
.preparation {
  margin: 4px 0 0;
  font-size: 12px;
  color: #75847b;
}
.preparation summary {
  min-height: 22px;
  color: #6b8173;
  font-size: 12px;
}
.meal-total {
  background: #f0f5ed;
  padding: 12px 18px;
  font-size: 12px;
}
.meal-total > span {
  color: #74856e;
  display: block;
  margin-bottom: 4px;
}
.meal-total > div {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}
.daily-total {
  margin: 32px 0 22px;
}
.daily-total h2 {
  font-size: 25px;
  margin: 4px 0 20px;
}
.daily-total .eyebrow {
  font-size: 12px;
}
.daily-head,
.daily-line {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 0.75fr;
  gap: 8px;
  align-items: center;
}
.daily-head {
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 12px;
}
.daily-line {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.daily-line small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.daily-line > span:nth-child(2) {
  text-align: right;
  font-family: Arial, sans-serif;
}
.difference {
  text-align: left;
  font:
    500 14px Arial,
    sans-serif;
  color: var(--green);
}
.daily-total > p {
  font-size: 12px;
  color: var(--muted);
}
.secondary {
  width: 100%;
  border: 1px solid var(--green);
  color: var(--green);
  background: transparent;
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 28px;
}
.source-food {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.source-food p {
  font-size: 12px;
}
.source-food img {
  border-radius: 10px;
  float: left;
}
.source-food summary {
  font-size: 13px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
@media (max-width: 375px) {
  .food-row {
    padding: 14px 12px;
    gap: 9px;
  }
  .food-row img {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
  }
  .summary-grid strong {
    font-size: 24px;
  }
  .daily-line {
    font-size: 13px;
  }
  .result-heading h1 {
    font-size: 27px;
  }
}

/* Editorial Arabic typography inspired by the supplied reference. */
body {
  font-size: 18px;
  line-height: 1.7;
}
h1,
h2,
.brand {
  font-family: "Noto Sans Arabic", Tahoma, sans-serif;
  font-weight: 800;
  letter-spacing: normal;
}
h1 {
  line-height: 1.5;
}
h3,
.primary,
.secondary {
  font-family: "Noto Naskh Arabic", Tahoma, serif;
  font-weight: 700;
}
.header-note,
.eyebrow,
.quiet-note,
footer,
.summary-grid span,
.summary-grid small,
.status,
.weight-note,
.food-macros,
.preparation,
.preparation summary,
.meal-total,
.meal-total > div,
.daily-total .eyebrow,
.daily-head,
.daily-line small,
.daily-total > p,
.source-food p,
.source-food summary {
  font-size: 14px;
}
.intro {
  font-size: 18px;
}
.input-card > span,
.input-card div > span,
.quantity,
.text-button,
#source-content {
  font-size: 16px;
}
h3 {
  font-size: 18px;
}
.primary,
.secondary {
  font-size: 19px;
}
.preparation summary {
  min-height: 28px;
}
.daily-line {
  font-size: 16px;
}
@media (max-width: 375px) {
  .header-note {
    font-size: 13px;
  }
  .input-card > span {
    font-size: 16px;
  }
  .daily-line {
    font-size: 15px;
  }
}

.brand {
  font-size: 20px;
  gap: 8px;
}
.brand-icon {
  flex-shrink: 0;
}
.header-note {
  display: none;
}
.macro-inputs {
  margin-bottom: 12px;
}
.meal-count-card {
  margin-bottom: 24px;
}
.meal-count-card select {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: #f7f9f6;
  color: var(--ink);
  font:
    700 21px "Noto Naskh Arabic",
    serif;
  cursor: pointer;
}
.meal-count-card small {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 5px;
}
