/* Geneprint portal (version 1).
   Same colours and components as the marketing website (../geneprint-website).
   Mobile-first; logical properties (inline-start/end) so Arabic can be added later. */

/* ---------- 0. Fonts (same files as the website) ----------
   Neue Montreal: PENDING web licence (same as the website).
   IBM Plex Sans Arabic: SIL Open Font License. unicode-range keeps it to Arabic letters. */
@font-face { font-family: "Neue Montreal"; src: url("../assets/fonts/NeueMontreal-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Neue Montreal"; src: url("../assets/fonts/NeueMontreal-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Neue Montreal"; src: url("../assets/fonts/NeueMontreal-Bold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../assets/fonts/IBMPlexSansArabic-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../assets/fonts/IBMPlexSansArabic-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../assets/fonts/IBMPlexSansArabic-Bold.woff2") format("woff2"); font-weight: 600 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }

/* ---------- 1. Design tokens (from the website) ---------- */
:root {
  --navy: #0B0B3B;
  --forest: #20524C;
  --forest-dark: #173E39;
  --sage-mid: #8DA88F;
  --lime: #DFE5A9;
  --mint: #74C7B1;
  --soft: #E7EEE4;
  --mist: #F3F5EE;
  --white: #FFFFFF;
  --line: #D3DDCC;
  --muted: #4B5B57;       /* secondary text, passes 4.5:1 on white */
  --alert: #A8392C;       /* needs attention */
  --alert-bg: #FCEFEC;
  --alert-line: #E9B9B1;
  --avg: #5E4A0E;
  --avg-bg: #F4E7B8;
  --low-bg: #DCE6DA;
  --r1: #7E9F87;          /* gauge: lower */
  --r2: #D2B44F;          /* gauge: average */

  /* Same fonts as the website. Headings use the same family (no serif), like the website. */
  --font: "Neue Montreal", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: var(--font);

  --radius: 16px;
  --radius-pill: 999px;
  --side-w: 264px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;          /* 17px, never below 16px */
  line-height: 1.55;
  color: var(--navy);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 10px; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
[hidden] { display: none !important; }
svg.illus { fill: none; stroke: none; }
button { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; inset-inline-start: 8px; top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: 8px; background: var(--white); color: var(--navy);
}
.skip-link:focus { top: 8px; }
.load-error { margin: 0; padding: 16px; background: var(--alert-bg); color: var(--alert); text-align: center; }

/* ---------- 3. Buttons, fields, links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn--primary { background: var(--forest); color: var(--white); }
.btn--primary:hover { background: var(--forest-dark); }
.btn--line { border: 2px solid var(--forest); background: transparent; color: var(--forest); }
.btn--line:hover { background: var(--white); }
.btn--block { width: 100%; }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; }
.field input {
  width: 100%; min-height: 50px; padding: 10px 14px;
  border: 1px solid #8A968F; border-radius: 12px; font: inherit; color: var(--navy);
}
.field input:focus { outline: 3px solid var(--mint); outline-offset: 1px; border-color: var(--forest); }
.link { font-weight: 700; color: var(--forest); text-underline-offset: 3px; }

/* ---------- 4. Sign in ---------- */
.signin {
  display: grid; place-items: center; align-content: center; gap: 24px;
  min-height: 100vh; padding: 32px 16px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(223, 229, 169, .55), transparent 60%),
    linear-gradient(160deg, #2E4A43 0%, #3F6158 45%, #7E9C86 100%);
}
.signin__card {
  width: 100%; max-width: 420px; padding: 32px 24px;
  border-radius: 24px; background: var(--white); box-shadow: 0 24px 60px rgba(11, 11, 59, .25);
}
.signin__logo { margin-bottom: 24px; }
.signin__title { margin: 0 0 4px; font-family: var(--serif); font-size: 1.875rem; font-weight: 400; line-height: 1.15; color: var(--forest); }
.signin__title:focus { outline: none; }
.signin__lead { margin: 0 0 24px; color: var(--muted); }
.disclaimer { max-width: 640px; margin: 0; font-size: 1rem; color: var(--muted); }
.disclaimer--light { color: rgba(255, 255, 255, .9); text-align: center; }
@media (min-width: 600px) { .signin__card { padding: 40px; } }

/* ---------- 5. Shell: sidebar + main ---------- */
.side {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 40;
  display: flex; flex-direction: column;
  width: var(--side-w); padding: 20px 14px; overflow-y: auto;
  background: var(--forest); color: var(--white);
  translate: -100% 0; transition: translate .25s ease;
}
[dir="rtl"] .side { translate: 100% 0; }
.side.is-open { translate: 0 0; }
.side-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(11, 11, 59, .45); }
.side__logo { display: block; padding: 6px 10px 22px; }
.side__nav { display: grid; gap: 2px; }
.side__group { margin: 18px 10px 6px; font-size: 1rem; font-weight: 700; color: var(--lime); }
.side__link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px;
  border-radius: 12px; color: var(--white); text-decoration: none; font-weight: 500;
}
.side__link:hover { background: rgba(255, 255, 255, .08); }
.side__link.is-active { background: var(--lime); color: var(--forest); font-weight: 700; }
.side__link--quiet { opacity: .85; }
.side__icon { flex: none; width: 26px; height: 26px; }
.side__icon--line { width: 22px; height: 22px; margin-inline: 2px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side__count {
  margin-inline-start: auto; min-width: 24px; padding: 0 7px; border-radius: var(--radius-pill);
  background: #F4C9C1; color: #6E1E14; font-size: 1rem; font-weight: 700; line-height: 24px; text-align: center;
}
.side__foot { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .15); }
.person { display: flex; align-items: center; gap: 10px; padding: 6px 10px 10px; color: var(--white); text-decoration: none; border-radius: 12px; }
.person:hover { background: rgba(255, 255, 255, .08); }
.person__name { font-weight: 700; }
.avatar {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--lime); color: var(--forest); font-size: 1rem; font-weight: 700; text-decoration: none;
}
.avatar--small { width: 38px; height: 38px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 16px;
  border-bottom: 1px solid var(--line); background: rgba(243, 245, 238, .92); backdrop-filter: blur(8px);
}
.topbar__title { flex: 1; margin: 0; font-weight: 700; color: var(--forest); }
.menu-btn {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--white); cursor: pointer;
}
.menu-btn__bars, .menu-btn__bars::before, .menu-btn__bars::after {
  display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--forest);
}
.menu-btn__bars { position: relative; }
.menu-btn__bars::before, .menu-btn__bars::after { content: ""; position: absolute; inset-inline-start: 0; }
.menu-btn__bars::before { top: -6px; }
.menu-btn__bars::after { top: 6px; }

.page { max-width: 1040px; margin: 0 auto; padding: 24px 16px 40px; }
.page:focus { outline: none; }
.foot { max-width: 1040px; margin: 0 auto; padding: 0 16px 32px; }

/* Welcome screen: no menu, centred card */
.shell.is-bare .side, .shell.is-bare .topbar, .shell.is-bare .side-scrim { display: none; }
.shell.is-bare .main { margin: 0; }
.shell.is-bare .page { display: grid; place-items: center; min-height: 80vh; }

@media (min-width: 1000px) {
  .side { translate: none; transition: none; }
  .side-scrim, .menu-btn { display: none; }
  .main { margin-inline-start: var(--side-w); }
  .topbar { padding-inline: 32px; }
  .page { padding: 32px 32px 48px; }
  .foot { padding-inline: 32px; }
}

/* ---------- 6. Shared result pieces ---------- */
.badge {
  display: inline-block; margin: 0 0 12px; padding: 3px 10px; border-radius: 6px;
  background: var(--forest); color: var(--lime);
  font-size: 1rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.page__title { margin: 0 0 8px; font-family: var(--serif); font-size: clamp(1.875rem, 4vw, 2.5rem); font-weight: 400; line-height: 1.12; color: var(--forest); }
.page__title:focus { outline: none; }
.lead { margin: 0 0 20px; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: var(--radius-pill); font-size: 1rem; font-weight: 700; white-space: nowrap;
}
.pill--up { background: var(--alert-bg); color: var(--alert); }
.pill--avg { background: var(--avg-bg); color: var(--avg); }
.pill--down { background: var(--low-bg); color: var(--forest); }

/* Three-zone gauge: lower / average / higher */
.gauge {
  position: relative; display: block; height: 8px; border-radius: 8px;
  background: linear-gradient(to right, #DCE6DA 0 33.3%, #F1E6BE 33.3% 66.6%, #EBD3AE 66.6% 100%);
}
[dir="rtl"] .gauge { background: linear-gradient(to left, #DCE6DA 0 33.3%, #F1E6BE 33.3% 66.6%, #EBD3AE 66.6% 100%); }
.gauge__dot {
  position: absolute; top: 50%; inset-inline-start: var(--at);
  width: 16px; height: 16px; border: 3px solid var(--white); border-radius: 50%;
  translate: -50% -50%; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
[dir="rtl"] .gauge__dot { translate: 50% -50%; }
.gauge__dot--up { background: var(--alert); }
.gauge__dot--avg { background: var(--r2); }
.gauge__dot--down { background: var(--r1); }
.gauge--big { height: 12px; margin: 34px 0 8px; }
.gauge--big .gauge__dot { width: 22px; height: 22px; }
.gauge__you {
  position: absolute; bottom: calc(100% + 6px); left: 50%; translate: -50% 0;
  padding: 1px 8px; border-radius: 6px; background: var(--forest); color: var(--white);
  font-size: 1rem; font-weight: 700; white-space: nowrap;
}
.gauge-labels { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 16px; font-size: 1rem; font-weight: 600; text-align: center; }
.gauge-labels span:nth-child(1) { color: var(--forest); text-align: start; }
.gauge-labels span:nth-child(2) { color: var(--avg); }
.gauge-labels span:nth-child(3) { color: var(--alert); text-align: end; }

.panel {
  margin-bottom: 14px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
}
.panel > :last-child { margin-bottom: 0; }
.panel__title { margin: 0 0 6px; font-size: 1.0625rem; color: var(--forest); }
.panel--plan { border-color: var(--forest); background: #F2F7F0; }
.note-box { padding: 14px 16px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); }
.warn { margin: 16px 0; padding: 12px 16px; border-radius: 12px; background: #FBF1DA; color: #6B4A12; font-size: 1rem; font-weight: 600; }

.dos { margin: 0; padding-inline-start: 20px; }
.dos li { margin-bottom: 6px; }
.dos li::marker { color: var(--forest); }

.science { margin-top: 4px; padding: 12px 16px; border: 1px dashed var(--sage-mid); border-radius: 12px; background: var(--white); font-size: 1rem; }
.science summary { font-weight: 700; color: var(--forest); cursor: pointer; }
.science p { margin: 10px 0 0; color: var(--muted); }

/* ---------- 7. Welcome ---------- */
.welcome-card {
  width: 100%; max-width: 640px; padding: 28px 22px;
  border-radius: 24px; background: var(--white); box-shadow: 0 20px 50px rgba(32, 82, 76, .12);
}
.how-read { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.how-read li { display: flex; align-items: center; gap: 14px; }
.how-read .pill { min-width: 110px; justify-content: center; }
.welcome-card .note-box { margin-bottom: 20px; background: var(--mist); }
@media (min-width: 600px) { .welcome-card { padding: 40px; } }

/* ---------- 8. Home ---------- */
.welcome { margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat {
  display: grid; align-content: start; gap: 2px; margin: 0; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  color: var(--forest); font-size: 1rem; line-height: 1.3; text-decoration: none;
}
.stat__num { font-family: var(--serif); font-size: clamp(2.25rem, 6vw, 3rem); font-weight: 400; line-height: 1; }
.stat__num small { font-size: .5em; color: var(--muted); }
.stat--alert { border-color: var(--alert-line); background: var(--alert-bg); color: var(--alert); }
.stat--alert .stat__num { font-weight: 700; }
.stat--link { grid-column: 1 / -1; }
.stat--link:hover { border-color: var(--forest); }
.bar { display: block; height: 8px; margin-top: 10px; border-radius: 8px; background: var(--soft); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 8px; background: var(--forest); }
@media (min-width: 700px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat--link { grid-column: auto; }
}

.block { margin-bottom: 32px; }
.block--plan { margin-top: 28px; }
.block__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.block__title { margin: 0 0 12px; font-size: 1.25rem; color: var(--forest); }
.block__group { margin: 8px 0 10px; font-size: 1rem; font-weight: 700; color: var(--muted); }

.att-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.att {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border: 1px solid var(--alert-line); border-inline-start: 4px solid var(--alert); border-radius: 14px;
  background: var(--white); text-align: start; cursor: pointer;
}
.att:hover { box-shadow: 0 8px 20px rgba(32, 82, 76, .1); }
.att__icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--alert-bg); color: var(--alert); }
.att__icon svg { width: 34px; height: 34px; }
.att__text { flex: 1; min-width: 0; line-height: 1.3; }
.att__text b { display: block; }
.att__text span { font-size: 1rem; color: var(--muted); }
.att__go { color: var(--forest); font-weight: 700; }
@media (max-width: 480px) {
  .att { flex-wrap: wrap; }
  .att .pill { margin-inline-start: 56px; }
  .att__go { display: none; }
}

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.tile {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  color: var(--forest); text-decoration: none; transition: border-color .2s, box-shadow .2s;
}
.tile:hover { border-color: var(--forest); box-shadow: 0 10px 24px rgba(32, 82, 76, .12); }
.tile__icon { width: 44px; height: 44px; margin-bottom: 4px; }
.tile__name { font-weight: 700; }
.tile__status { font-size: 1rem; line-height: 1.35; color: var(--muted); }
.tile--alert { border-top: 4px solid var(--alert); }
.tile--alert .tile__status { color: var(--alert); font-weight: 700; }
@media (min-width: 800px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- 9. Plan steps ---------- */
.todo { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.todo__item {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--white);
}
.todo__text { flex: 1; min-width: 0; line-height: 1.4; }
.todo__text b { display: block; }
.todo__detail { display: block; font-size: 1rem; color: var(--muted); }
.todo__why { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.todo__why a, .todo__why span {
  padding: 1px 10px; border-radius: var(--radius-pill); background: var(--soft);
  font-size: 1rem; color: var(--forest); text-decoration: none;
}
.todo__why a:hover { background: var(--lime); }
.todo__when { flex: none; font-size: 1rem; font-weight: 700; color: var(--forest); white-space: nowrap; }
.todo__item.is-done { background: #F7F9F4; }
.todo__item.is-done .todo__text b { color: var(--muted); text-decoration: line-through; }
.tick {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-top: 1px;
  border: 2px solid var(--forest); border-radius: 50%; background: var(--white); cursor: pointer;
}
.tick[aria-pressed="true"] { background: var(--forest); }
.tick[aria-pressed="true"]::after { content: "✓"; color: var(--white); font-weight: 700; }
.tick:hover { background: var(--soft); }
.tick[aria-pressed="true"]:hover { background: var(--forest-dark); }
@media (max-width: 560px) {
  .todo__item { flex-wrap: wrap; }
  .todo__when { order: -1; width: 100%; margin-inline-start: 46px; margin-bottom: -6px; }
}

.progress { margin-bottom: 24px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--forest); }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline__group { position: relative; padding-inline-start: 26px; padding-bottom: 22px; }
.timeline__group::before { content: ""; position: absolute; top: 8px; bottom: 0; inset-inline-start: 6px; width: 2px; background: var(--line); }
.timeline__group::after { content: ""; position: absolute; top: 6px; inset-inline-start: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--forest); }
.timeline__group:last-child::before { display: none; }
.timeline__when { margin: 0 0 10px; font-size: 1.0625rem; color: var(--forest); }
.timeline .todo__when { display: none; }

/* ---------- 10. Result cards (cancer, heart, autoimmune, mental health) ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.card {
  display: flex; flex-direction: column; gap: 8px; width: 100%; height: 100%; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
  text-align: start; cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.card:hover { border-color: var(--forest); box-shadow: 0 10px 24px rgba(32, 82, 76, .12); }
.card--up { border-color: var(--alert-line); border-top: 4px solid var(--alert); }
.card__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.card__icon { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--soft); color: var(--forest); }
.card__icon svg { width: 40px; height: 40px; }
.card--up .card__icon, .card__icon--up { background: var(--alert-bg); color: var(--alert); }
.card__name { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.card__name small { display: block; font-size: 1rem; font-weight: 400; color: var(--muted); }
.card .gauge { margin: 4px 0; }
.card__more { margin-top: auto; font-size: 1rem; font-weight: 600; color: var(--forest); }
.others { margin: 14px 0 0; font-weight: 600; color: var(--forest); }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Alzheimer's single result */
.result {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 14px; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
}
.result--avg { border-top: 4px solid var(--r2); }
.result--up { border-top: 4px solid var(--alert); }
.result__icon { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--avg-bg); color: var(--avg); }
.result__icon svg { width: 46px; height: 46px; }
.result__body { flex: 1 1 220px; }
.result__body p:last-child { margin: 0; }
.result__label { margin: 0; font-size: 1rem; color: var(--muted); }
.result__value { margin: 0 0 4px; font-family: var(--serif); font-size: 1.75rem; color: var(--forest); }
.result .pill { align-self: flex-start; }

/* Private results */
.private { max-width: 560px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); text-align: center; }
.private__icon { width: 64px; height: 64px; margin: 0 auto 10px; color: var(--forest); }
.private h2 { margin: 0 0 8px; color: var(--forest); }
.private__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; margin-top: 18px; }

/* ---------- 11. Medications ---------- */
.med-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.med {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--white); text-align: start; cursor: pointer;
}
.med:hover { border-color: var(--forest); }
.med__mark { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--forest); color: var(--white); font-weight: 700; }
.med__name { flex: 1; font-weight: 700; }
.med__status { font-size: 1rem; color: var(--muted); }
.med--review { border-color: var(--alert-line); background: var(--alert-bg); }
.med--review .med__mark { background: var(--alert); }
.med--review .med__status { color: var(--alert); font-weight: 700; }
@media (max-width: 480px) {
  .med { flex-wrap: wrap; }
  .med__status { width: 100%; margin-inline-start: 42px; }
}

.pharm { text-align: start; }
.pharm img { margin-bottom: 16px; }
.pharm__who { color: var(--muted); }
.pharm__list { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.pharm__list li { display: grid; padding: 12px 14px; border-radius: 12px; background: var(--alert-bg); color: var(--alert); }
.pharm__note { margin-top: 12px; font-size: 1rem; color: var(--muted); }

/* ---------- 12. Lifestyle traits ---------- */
.traits { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.trait { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.trait__name { font-weight: 700; color: var(--forest); }
.trait__ends { display: flex; justify-content: space-between; font-size: 1rem; color: var(--muted); }
.trait__track { position: relative; display: block; height: 6px; margin-top: 8px; border-radius: 6px; background: #DCE3D8; }
.trait__knob {
  position: absolute; top: 50%; inset-inline-start: var(--pos); width: 18px; height: 18px;
  border: 3px solid var(--forest); border-radius: 50%; background: var(--lime); translate: -50% -50%;
}
[dir="rtl"] .trait__knob { translate: 50% -50%; }
.trait__tip { padding: 8px 12px; border-radius: 10px; background: var(--mist); font-size: 1rem; }
@media (min-width: 760px) { .trait { grid-template-columns: 120px 1fr 1fr; align-items: center; gap: 20px; } }

/* ---------- 13. Ancestry map ---------- */
.map-wrap { position: relative; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.map-loading { margin: 0; padding: 40px; text-align: center; color: var(--muted); }
.world-map { display: block; width: 100%; height: auto; }
.world-map path { fill: #DCE4D6; stroke: var(--white); stroke-width: .6; transition: opacity .2s; }
.world-map .wm-arabia { fill: var(--forest); }
.world-map .wm-levant { fill: #5FAF98; }
.world-map .wm-nafrica { fill: #C9B24A; }
.world-map path[data-region] { cursor: pointer; }
.world-map[data-focus] path[data-region] { opacity: .3; }
.world-map[data-focus="arabia"] path.wm-arabia[data-region],
.world-map[data-focus="levant"] path.wm-levant[data-region],
.world-map[data-focus="nafrica"] path.wm-nafrica[data-region] { opacity: 1; stroke: var(--navy); stroke-width: 1.4; }
.map-tip {
  position: absolute; z-index: 2; padding: 4px 10px; border-radius: 8px; background: var(--navy); color: var(--white);
  font-size: 1rem; font-weight: 700; white-space: nowrap; pointer-events: none;
  translate: -50% calc(-100% - 6px); opacity: 0; transition: opacity .2s;
}
.map-tip.is-visible { opacity: 1; }
.regions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.region {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--white); text-align: start; cursor: pointer;
}
.region i { flex: none; width: 14px; height: 14px; border-radius: 50%; }
.region b { margin-inline-start: auto; color: var(--forest); }
.region.is-active, .region:hover { border-color: var(--forest); }
@media (max-width: 480px) { .regions { grid-template-columns: 1fr; } }

/* ---------- 14. Profile ---------- */
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 700; }
.switches { display: grid; gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }
.switches li { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.switch {
  position: relative; width: 52px; height: 30px; border: 0; border-radius: var(--radius-pill);
  background: #B9C4B8; cursor: pointer; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--white); transition: translate .2s;
}
.switch[aria-checked="true"] { background: var(--forest); }
.switch[aria-checked="true"]::after { translate: 22px 0; }
[dir="rtl"] .switch[aria-checked="true"]::after { translate: -22px 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ---------- 15. Detail sheet ---------- */
.sheet {
  width: min(560px, 100vw); max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0 0 0 auto;
  overflow-x: hidden;
  padding: 0; border: 0; background: var(--mist); color: var(--navy); box-shadow: -20px 0 60px rgba(11, 11, 59, .2);
}
[dir="rtl"] .sheet { margin: 0 auto 0 0; }
.sheet::backdrop { background: rgba(11, 11, 59, .45); }
.sheet__inner { position: relative; padding: 24px 20px 32px; }
.sheet__close {
  position: sticky; top: 0; float: inline-end; z-index: 2; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--white); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.sheet__head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; padding-inline-end: 50px; }
.sheet__title { margin: 0 0 6px; font-family: var(--serif); font-size: 1.75rem; font-weight: 400; line-height: 1.15; color: var(--forest); }
@media (min-width: 600px) { .sheet__inner { padding: 28px 28px 40px; } }

@media (prefers-reduced-motion: reduce) {
  .side, .tile, .card, .switch, .switch::after, .map-tip, .world-map path { transition: none; }
}
.shell.is-bare .foot { text-align: center; }
.shell.is-bare .disclaimer { margin-inline: auto; }

/* ---------- 16. Headings in the website's style (Neue Montreal 600, tight spacing) ---------- */
.signin__title, .page__title, .stat__num, .result__value, .sheet__title { font-weight: 600; letter-spacing: -.02em; }
:lang(ar) .signin__title, :lang(ar) .page__title, :lang(ar) .stat__num, :lang(ar) .result__value, :lang(ar) .sheet__title,
:lang(ar) .badge { letter-spacing: 0; }

/* ---------- 17. Sign in with an email code ---------- */
.signin { position: relative; }
.lang-switch {
  position: absolute; top: 16px; inset-inline-end: 16px;
  min-height: 44px; padding: 8px 16px; border: 1px solid rgba(255, 255, 255, .6); border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .12); color: var(--white); font-weight: 700; cursor: pointer;
}
.lang-switch:hover { background: rgba(255, 255, 255, .22); }
.field__hint { margin: 6px 0 0; font-size: 1rem; color: var(--muted); }
.form-error { margin: -4px 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--alert-bg); color: var(--alert); font-weight: 600; }
.form-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--soft); color: var(--forest); font-weight: 600; }
.code-input { font-size: 1.5rem !important; letter-spacing: .3em; text-align: center; }
.signin__alt { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; margin-top: 18px; }
.linkbtn {
  min-height: 44px; padding: 0; border: 0; background: none; color: var(--forest);
  font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
button:disabled { opacity: .6; cursor: progress; }
button.side__link { width: 100%; border: 0; background: none; font: inherit; text-align: start; cursor: pointer; }
[dir="rtl"] .arrow { display: inline-block; transform: scaleX(-1); }

/* ---------- 18. Test journey (sample taken -> at the lab -> results ready) ---------- */
.panel--journey { padding: 22px 20px 8px; }
.journey { margin: 0; padding: 0; list-style: none; }
.journey__step { position: relative; display: flex; gap: 16px; padding-bottom: 22px; }
.journey__step::before {
  content: ""; position: absolute; top: 34px; bottom: 0; inset-inline-start: 15px; width: 2px; background: var(--line);
}
.journey__step:last-child::before { display: none; }
.journey__step.is-done::before { background: var(--forest); }
.journey__dot {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  border: 2px solid var(--line); border-radius: 50%; background: var(--white); color: var(--white); font-weight: 700;
}
.is-done .journey__dot { border-color: var(--forest); background: var(--forest); }
.is-now .journey__dot { border-color: var(--forest); box-shadow: inset 0 0 0 6px var(--white); background: var(--lime); }
.journey__body { flex: 1; min-width: 0; padding-top: 3px; }
.journey__body p { margin: 0; color: var(--muted); }
.journey__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 4px; font-size: 1.125rem; color: var(--forest); }
.is-next .journey__title { color: var(--muted); }
.journey__tag { padding: 0 9px; border-radius: var(--radius-pill); background: var(--lime); color: var(--forest); font-size: 1rem; font-weight: 700; }
.is-next .journey__tag { background: var(--soft); color: var(--muted); }
.journey__when { font-size: 1rem; font-weight: 500; color: var(--muted); }
.muted-line { color: var(--muted); }

/* ---------- 19. Three layers: rows that open, the science ---------- */
.med__go { color: var(--forest); font-weight: 700; }
@media (max-width: 480px) { .med__go { display: none; } }
.trait__tip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.trait__more { min-height: 32px; font-size: 1rem; }
.sheet .trait__track { margin-bottom: 4px; }
.science summary { min-height: 32px; }
.sci { margin-top: 14px; }
.sci__title { margin: 0; font-size: 1rem; color: var(--navy); }
.sci p { margin-top: 4px; }
.genes { font-weight: 700; color: var(--forest) !important; }
.pct { position: relative; display: block; height: 8px; margin: 10px 0 4px; border-radius: 8px; background: var(--soft); }
.pct__fill { display: block; height: 100%; border-radius: 8px; background: var(--sage-mid); }
.pct__mark { position: absolute; top: 50%; inset-inline-start: var(--at); width: 14px; height: 14px; border: 3px solid var(--white); border-radius: 50%; background: var(--forest); translate: -50% -50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
[dir="rtl"] .pct__mark { translate: 50% -50%; }
.details--small { font-size: 1rem; }
.ancestry-text { margin-top: 16px; }
.doctor-cta .btn { margin-top: 4px; }
.lang-choice { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 20. Doctor report (screen + print) ---------- */
.report-bar { display: grid; gap: 12px 24px; margin-bottom: 20px; }
.report-bar__actions { display: grid; align-content: start; gap: 10px; }
.field--inline { margin: 0; }
.field select {
  width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid #8A968F; border-radius: 12px;
  background: var(--white); font: inherit; color: var(--navy);
}
@media (min-width: 860px) { .report-bar { grid-template-columns: 1fr 300px; align-items: end; } }

.report-wrap { overflow-x: auto; }
.report { max-width: 820px; padding: 28px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); font-size: 1rem; line-height: 1.45; }
.report__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 2px solid var(--forest); }
.report__kicker { margin: 0; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; text-align: end; }
:lang(ar) .report__kicker { letter-spacing: 0; }
.report__title { margin: 0; font-size: 1.5rem; color: var(--forest); text-align: end; }
.report__who { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 20px; margin: 18px 0 8px; }
.report__who dt { font-size: .875rem; color: var(--muted); }
.report__who dd { margin: 0; font-weight: 700; }
.rsec { margin-top: 22px; break-inside: avoid-page; }
.rsec h2 { margin: 0 0 8px; font-size: 1.125rem; color: var(--forest); }
.rsec--att { padding: 12px 16px; border-radius: 12px; background: var(--alert-bg); }
.rsec--att h2 { color: var(--alert); }
.rsec--att ul { margin: 0; padding-inline-start: 20px; }
.rtable { width: 100%; border-collapse: collapse; }
.rtable th, .rtable td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.rtable th { font-size: .875rem; color: var(--muted); }
.rtable tr { break-inside: avoid; }
.rtable tr.is-up td { background: #FDF5F3; }
.rtable tr.is-up b { color: var(--alert); }
.rnote { margin: 6px 0 0; font-size: .875rem; color: var(--muted); }
.report__foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .875rem; color: var(--muted); }
.report__foot p { margin: 0 0 6px; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .side, .side-scrim, .topbar, .foot, .skip-link, .no-print, .sheet { display: none !important; }
  .main { margin: 0 !important; }
  .page { max-width: none; padding: 0; }
  .report { max-width: none; padding: 0; border: 0; border-radius: 0; }
  .rtable tr.is-up td, .rsec--att { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- 21. Arabic (right to left) fixes ---------- */
@media (min-width: 1000px) { [dir="rtl"] .side { translate: none; } }
[dir="rtl"] .att__go, [dir="rtl"] .med__go { display: inline-block; transform: scaleX(-1); }

/* ---------- 22. Test copy (PORTAL_DEMO=1) ---------- */
.demo-banner {
  position: fixed; bottom: 12px; inset-inline-end: 12px; z-index: 60; max-width: min(360px, calc(100vw - 24px));
  margin: 0; padding: 8px 14px; border: 1px solid var(--forest); border-radius: 12px;
  background: var(--lime); color: var(--forest); font-size: .9375rem; font-weight: 700; line-height: 1.35;
  box-shadow: 0 6px 18px rgba(11, 11, 59, .18); pointer-events: none;
}
@media print { .demo-banner { position: static; display: block; max-width: none; margin-bottom: 8px; box-shadow: none; } }
.form-note--demo { margin-top: 0; }
