/* ================================================================
   Wareed Health Calculator — visual design ported from
   competition.wareed.com.sa: deep wine purple + gold accent + Zain.
   ================================================================ */

@font-face {
  font-family: 'Zain';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/zain-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Zain';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/zain-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Zain';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/zain-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Zain';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/zain-900.woff2') format('woff2');
}

:root {
  /* Brand — wine purple from competition.wareed.com.sa */
  --brand:        #62146A;   /* primary */
  --brand-dark:   #4A0F50;
  --brand-deep:   #1A0A1E;   /* near-black with wine tint */
  --brand-50:     #f6eef7;   /* tint for soft fills */
  --brand-100:    #ecdcef;
  --brand-200:    #d6b1dc;

  /* Gold accent — from same site */
  --gold:         #C9A84C;
  --gold-dark:    #A88A33;
  --gold-light:   #E2CD86;
  --gold-50:      #fbf6e6;

  /* Neutrals */
  --bg:           #f7f5f9;
  --surface:      #ffffff;
  --surface-2:    #fafaf9;
  --border:       #ebe7ef;
  --border-strong:#dcd5e1;

  --text:         #1c1820;
  --text-muted:   #5b5566;
  --text-subtle:  #8b8395;

  /* Status — refined, less saturated */
  --green:      #1f8a4c;
  --green-50:   #e8f5ee;
  --yellow:     #b78600;
  --yellow-50:  #fbf3dc;
  --orange:     #c2611c;
  --orange-50:  #fbeadb;
  --red:        #b32424;
  --red-50:     #f8e2e2;
  --red-dark:   #8a1818;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(26, 10, 30, 0.04);
  --shadow-sm: 0 2px 6px rgba(26, 10, 30, 0.06);
  --shadow-md: 0 6px 18px rgba(26, 10, 30, 0.08);
  --shadow-lg: 0 18px 40px rgba(26, 10, 30, 0.10);
  --shadow-focus: 0 0 0 3px rgba(98, 20, 106, 0.20);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Type scale */
  --fs-xs:  12px;
  --fs-sm:  14px;
  --fs-base:16px;
  --fs-md:  18px;
  --fs-lg:  22px;
  --fs-xl:  28px;
  --fs-xxl: 36px;
  --fs-display: 44px;

  /* Spacing — 4-pt scale */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 56px;

  --font-stack: 'Zain', 'SF Arabic', 'Noto Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;

  --easing: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-stack);
  font-size: var(--fs-base);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(98, 20, 106, 0.18); color: var(--brand-deep); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
*::-webkit-scrollbar-thumb:hover { background: var(--brand-200); }

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

/* ============ Top navbar ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand-deep);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: saturate(140%);
  direction: rtl;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px var(--s-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.18s var(--easing);
  padding: 4px 6px;
  border-radius: 6px;
}
.topbar-brand:hover { opacity: 0.85; }
.topbar-brand:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.35);
}
.topbar-logo {
  display: block;
  height: 32px;
  width: auto;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.15));
}

.topbar-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: var(--fs-xs);
  font-weight: 700;
  transition: background 0.2s var(--easing), border-color 0.2s, transform 0.18s;
}
.topbar-home:hover {
  background: rgba(201, 168, 76, 0.16);
  border-color: var(--gold);
}
.topbar-home:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.35);
}
.topbar-home:active { transform: scale(0.97); }
.topbar-home svg { width: 14px; height: 14px; }

@media (max-width: 480px) {
  .topbar-inner { padding: 8px var(--s-4); }
  .topbar-logo { height: 28px; }
  .topbar-home span { display: none; }
  .topbar-home { padding: 6px 10px; }
  .topbar-home svg { width: 16px; height: 16px; }
}

/* ============ Header ============ */
.app-header {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--s-10) var(--s-6) var(--s-8);
  text-align: center;
  overflow: hidden;
}
.app-header::before {
  /* subtle wine wash on top, fades down */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 60%;
  background: radial-gradient(ellipse 80% 100% at 50% 0%,
    rgba(98, 20, 106, 0.05) 0%,
    rgba(98, 20, 106, 0.02) 40%,
    transparent 70%);
  pointer-events: none;
}
.app-header::after {
  /* gold thin line */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: translateX(-50%);
}
.app-header-inner { position: relative; max-width: 920px; margin: 0 auto; }

.app-header-logo {
  display: block;
  margin: 0 auto var(--s-5);
  width: 150px;
  max-width: 70%;
  height: auto;
  margin-bottom: 2rem;
}

.app-header h1 {
  margin: 0 0 var(--s-3);
  color: var(--brand-deep);
  font-size: var(--fs-xxl);
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.app-subtitle {
  margin: 0 auto;
  max-width: 620px;
  color: var(--text-muted);
  font-size: var(--fs-md);
  line-height: 1.7;
}
.app-subtitle strong { color: var(--brand); font-weight: 700; }

/* ============ App shell ============ */
.app {
  max-width: 920px;
  margin: 0 auto;
  padding: var(--s-8) var(--s-6);
  direction: rtl;
  text-align: right;
}

.view { animation: fadeUp 0.36s var(--easing) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.section-heading {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--brand-deep);
  margin: 0 0 var(--s-2);
  letter-spacing: -0.01em;
}
.section-sub {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin: 0 0 var(--s-6);
}

/* ============ Calculator grid ============ */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-4);
}

.calc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-5);
  min-height: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-align: right;
  box-shadow: var(--shadow-xs);
  transition:
    transform 0.25s var(--easing),
    box-shadow 0.25s var(--easing),
    border-color 0.2s var(--easing);
  overflow: hidden;
}
.calc-card::before {
  /* gold ribbon top — appears on hover */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  opacity: 0;
  transition: opacity 0.25s var(--easing);
}
.calc-card::after {
  /* arrow that slides in on hover */
  content: "←";
  position: absolute;
  bottom: var(--s-4);
  left: var(--s-4);
  font-size: 18px;
  color: var(--brand);
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.25s var(--easing), transform 0.25s var(--easing);
}
.calc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-200);
}
.calc-card:hover::before { opacity: 1; }
.calc-card:hover::after  { opacity: 1; transform: translateX(0); }
.calc-card:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--shadow-focus), var(--shadow-sm);
}
.calc-card:active { transform: translateY(-1px); }

.calc-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand);
  transition: background 0.25s var(--easing), color 0.25s var(--easing);
}
.calc-card:hover .calc-card-icon {
  background: var(--brand);
  color: var(--gold-light);
}
.calc-card-icon svg { width: 26px; height: 26px; }
.calc-card-title {
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.35;
  color: var(--brand-deep);
}

/* ============ Back button ============ */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--brand);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  margin-bottom: var(--s-5);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.back-btn:hover { background: var(--brand-50); border-color: var(--brand-200); }
.back-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.back-btn:active { transform: scale(0.97); }
.back-btn svg { width: 14px; height: 14px; }

/* ============ Calculator card ============ */
.calc-box {
  background: var(--surface);
  padding: var(--s-8);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.36s var(--easing) both;
}
.calc-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--gold), var(--brand));
}
.calc-box h2 {
  color: var(--brand-deep);
  font-size: var(--fs-xl);
  margin: 0 0 var(--s-2);
  text-align: center;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.calc-desc {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
  margin: 0 0 var(--s-5);
  line-height: 1.7;
}

/* ============ Form fields ============ */
form { display: block; }
label {
  display: block;
  margin: var(--s-4) 0 var(--s-2);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text);
}
label small { font-weight: 400; color: var(--text-subtle); }

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-4);
}
.field label { margin-top: 0; }

input[type="number"],
input[type="date"],
input[type="text"],
select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder { color: var(--text-subtle); }
select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brand) 50%),
    linear-gradient(-45deg, transparent 50%, var(--brand) 50%);
  background-position:
    calc(0% + 18px) calc(50% - 2px),
    calc(0% + 24px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-inline-start: 38px;
  cursor: pointer;
}
input:hover, select:hover { border-color: var(--brand-200); }
input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
}

/* ============ Buttons ============ */
.btn-primary, button[type="submit"] {
  width: 100%;
  padding: 14px 18px;
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-md);
  font-weight: 700;
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  cursor: pointer;
  margin-top: var(--s-5);
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(98, 20, 106, 0.18);
  position: relative;
  overflow: hidden;
}
.btn-primary::after, button[type="submit"]::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--gold);
  transform: translateY(2px);
  transition: transform 0.25s var(--easing);
}
.btn-primary:hover, button[type="submit"]:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: 0 6px 18px rgba(98, 20, 106, 0.25);
}
.btn-primary:hover::after, button[type="submit"]:hover::after { transform: translateY(0); }
.btn-primary:active, button[type="submit"]:active { transform: translateY(1px); }
.btn-primary:focus-visible, button[type="submit"]:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.btn-primary:disabled, button[type="submit"]:disabled {
  opacity: 0.6; cursor: not-allowed;
}

/* ============ Result box ============ */
.result-box {
  margin-top: var(--s-6);
  padding: var(--s-5) var(--s-6);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  line-height: 1.8;
  font-size: var(--fs-md);
  position: relative;
  animation: fadeUp 0.4s var(--easing) both;
}
.result-box::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  inset-inline-start: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--gold));
  border-start-start-radius: var(--r);
  border-end-start-radius: var(--r);
}
.result-box h3 {
  margin: 0 0 var(--s-3);
  color: var(--brand-deep);
  font-size: var(--fs-lg);
  font-weight: 800;
}
.result-box p { margin: var(--s-2) 0; }
.result-box ul { padding-inline-start: 22px; margin: var(--s-2) 0; }
.result-box strong { color: var(--brand-dark); }

/* ============ Status note ============ */
.note {
  display: block;
  margin-top: var(--s-3);
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.7;
  border-inline-start: 4px solid transparent;
  background: var(--surface);
}
.note.green  { background: var(--green-50);  color: #14532d; border-inline-start-color: var(--green); }
.note.yellow { background: var(--yellow-50); color: #5b3c00; border-inline-start-color: var(--yellow); }
.note.orange { background: var(--orange-50); color: #6e2f00; border-inline-start-color: var(--orange); }
.note.red    { background: var(--red-50);    color: #6b1414; border-inline-start-color: var(--red); }
.note.brand  { background: var(--brand-50);  color: var(--brand-deep); border-inline-start-color: var(--brand); }

.pill-status {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--fs-sm);
  border: 1px solid transparent;
}
.pill-status.green  { background: var(--green-50);  color: #14532d; border-color: rgba(31,138,76,0.25); }
.pill-status.yellow { background: var(--yellow-50); color: #5b3c00; border-color: rgba(183,134,0,0.25); }
.pill-status.orange { background: var(--orange-50); color: #6e2f00; border-color: rgba(194,97,28,0.25); }
.pill-status.red    { background: var(--red-50);    color: #6b1414; border-color: rgba(179,36,36,0.25); }
.pill-status.brand  { background: var(--brand-50);  color: var(--brand-deep); border-color: var(--brand-200); }

/* Big result card (depression / ovarian severity) */
.dep-result {
  padding: var(--s-6);
  border-radius: var(--r);
  color: #fff;
  font-size: var(--fs-md);
  line-height: 1.8;
  margin-top: var(--s-3);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.dep-result::after {
  /* gold corner accent */
  content: "";
  position: absolute;
  top: -30px;
  inset-inline-end: -30px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.18;
}
.dep-result strong { color: #fff; opacity: 0.9; }
.dep-green  { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.dep-yellow { background: linear-gradient(135deg, #d59f25, #a87a17); color: #1c1100; }
.dep-yellow strong { color: #1c1100; opacity: 0.85; }
.dep-orange { background: linear-gradient(135deg, #c97a32, #9c5414); }
.dep-red    { background: linear-gradient(135deg, #b13434, #871f1f); }
.dep-dark   { background: linear-gradient(135deg, #7a1a1a, var(--brand-deep)); }
.dep-note {
  font-size: var(--fs-xs);
  font-weight: 400;
  opacity: 0.92;
  margin: var(--s-3) 0 0;
}
.dep-yellow .dep-note { color: #1c1100; opacity: 0.75; }

/* ============ Questionnaire pills ============ */
.question {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: var(--s-4) var(--s-5);
  margin: 0 0 var(--s-3);
  transition: border-color 0.2s, background 0.2s;
}
.question legend,
.question > p {
  font-weight: 700;
  color: var(--text);
  padding: 0 4px;
  font-size: var(--fs-sm);
  margin-bottom: var(--s-3);
}
.question.answered {
  border-color: var(--brand-200);
  background: var(--brand-50);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  margin: 4px 6px 4px 0;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  transition: all 0.18s var(--easing);
  user-select: none;
  position: relative;
}
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill:hover { border-color: var(--brand-200); background: var(--brand-50); }
.pill:has(input:checked) {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(98, 20, 106, 0.30);
}
.pill input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============ Errors ============ */
.error {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red-dark);
  font-size: var(--fs-sm);
  font-weight: 700;
  margin: 0;
  padding: 11px 14px;
  background: var(--red-50);
  border-radius: var(--r-sm);
  border-inline-start: 4px solid var(--red);
}
.error::before { content: "⚠"; font-size: 1.1em; }

/* ============ Native progress bar (pregnancy) ============ */
progress.progress-bar {
  width: 100%;
  height: 12px;
  margin-top: var(--s-4);
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
  appearance: none;
  -webkit-appearance: none;
}
progress.progress-bar::-webkit-progress-bar { background: var(--border); border-radius: 999px; }
progress.progress-bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--brand), var(--gold));
  border-radius: 999px;
  transition: width 0.5s var(--easing);
}
progress.progress-bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--brand), var(--gold));
}

/* ============ Score bar (questionnaire) ============ */
.score-bar { margin: var(--s-4) 0 var(--s-3); }
.score-bar-track {
  position: relative;
  width: 100%;
  height: 10px;
  background: linear-gradient(90deg, var(--green) 0%, var(--yellow) 50%, var(--red) 100%);
  border-radius: 999px;
}
.score-bar-marker {
  position: absolute;
  top: -5px;
  width: 20px;
  height: 20px;
  margin-inline-start: -10px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand);
  box-shadow: 0 2px 6px rgba(26, 10, 30, 0.18);
  transition: inset-inline-start 0.5s var(--easing);
}
.score-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 8px;
}

/* Marker positions — preset 2% steps for CSP compliance */
.score-bar-marker.pos-0   { inset-inline-start: 0%; }
.score-bar-marker.pos-2   { inset-inline-start: 2%; }
.score-bar-marker.pos-4   { inset-inline-start: 4%; }
.score-bar-marker.pos-6   { inset-inline-start: 6%; }
.score-bar-marker.pos-8   { inset-inline-start: 8%; }
.score-bar-marker.pos-10  { inset-inline-start: 10%; }
.score-bar-marker.pos-12  { inset-inline-start: 12%; }
.score-bar-marker.pos-14  { inset-inline-start: 14%; }
.score-bar-marker.pos-16  { inset-inline-start: 16%; }
.score-bar-marker.pos-18  { inset-inline-start: 18%; }
.score-bar-marker.pos-20  { inset-inline-start: 20%; }
.score-bar-marker.pos-22  { inset-inline-start: 22%; }
.score-bar-marker.pos-24  { inset-inline-start: 24%; }
.score-bar-marker.pos-26  { inset-inline-start: 26%; }
.score-bar-marker.pos-28  { inset-inline-start: 28%; }
.score-bar-marker.pos-30  { inset-inline-start: 30%; }
.score-bar-marker.pos-32  { inset-inline-start: 32%; }
.score-bar-marker.pos-34  { inset-inline-start: 34%; }
.score-bar-marker.pos-36  { inset-inline-start: 36%; }
.score-bar-marker.pos-38  { inset-inline-start: 38%; }
.score-bar-marker.pos-40  { inset-inline-start: 40%; }
.score-bar-marker.pos-42  { inset-inline-start: 42%; }
.score-bar-marker.pos-44  { inset-inline-start: 44%; }
.score-bar-marker.pos-46  { inset-inline-start: 46%; }
.score-bar-marker.pos-48  { inset-inline-start: 48%; }
.score-bar-marker.pos-50  { inset-inline-start: 50%; }
.score-bar-marker.pos-52  { inset-inline-start: 52%; }
.score-bar-marker.pos-54  { inset-inline-start: 54%; }
.score-bar-marker.pos-56  { inset-inline-start: 56%; }
.score-bar-marker.pos-58  { inset-inline-start: 58%; }
.score-bar-marker.pos-60  { inset-inline-start: 60%; }
.score-bar-marker.pos-62  { inset-inline-start: 62%; }
.score-bar-marker.pos-64  { inset-inline-start: 64%; }
.score-bar-marker.pos-66  { inset-inline-start: 66%; }
.score-bar-marker.pos-68  { inset-inline-start: 68%; }
.score-bar-marker.pos-70  { inset-inline-start: 70%; }
.score-bar-marker.pos-72  { inset-inline-start: 72%; }
.score-bar-marker.pos-74  { inset-inline-start: 74%; }
.score-bar-marker.pos-76  { inset-inline-start: 76%; }
.score-bar-marker.pos-78  { inset-inline-start: 78%; }
.score-bar-marker.pos-80  { inset-inline-start: 80%; }
.score-bar-marker.pos-82  { inset-inline-start: 82%; }
.score-bar-marker.pos-84  { inset-inline-start: 84%; }
.score-bar-marker.pos-86  { inset-inline-start: 86%; }
.score-bar-marker.pos-88  { inset-inline-start: 88%; }
.score-bar-marker.pos-90  { inset-inline-start: 90%; }
.score-bar-marker.pos-92  { inset-inline-start: 92%; }
.score-bar-marker.pos-94  { inset-inline-start: 94%; }
.score-bar-marker.pos-96  { inset-inline-start: 96%; }
.score-bar-marker.pos-98  { inset-inline-start: 98%; }
.score-bar-marker.pos-100 { inset-inline-start: 100%; }

/* ============ Pregnancy table ============ */
.pregnancy-table-wrap {
  margin-top: var(--s-4);
  overflow: auto;
  border-radius: var(--r);
  border: 1px solid var(--border);
  max-height: 420px;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
table th, table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: center;
}
table th {
  background: var(--brand-50);
  color: var(--brand-deep);
  position: sticky;
  top: 0;
  font-weight: 700;
  border-bottom: 1px solid var(--border-strong);
}
.current-week {
  background: linear-gradient(90deg, rgba(98, 20, 106, 0.08), rgba(201, 168, 76, 0.10));
  font-weight: 800;
  color: var(--brand-deep);
}

/* ============ Footer ============ */
.app-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  margin-top: var(--s-12);
  padding: var(--s-8) var(--s-4) var(--s-6);
  border-top: 1px solid var(--border);
}
.app-footer-link {
  display: inline-block;
  text-decoration: none;
  margin-bottom: var(--s-3);
  border-radius: 6px;
  padding: 4px 6px;
  transition: opacity 0.18s var(--easing);
}
.app-footer-link:hover { opacity: 0.7; }
.app-footer-link:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.app-footer-logo {
  display: block;
  width: 140px;
  max-width: 60vw;
  height: auto;
}

/* ============ Mobile ============ */
@media (max-width: 700px) {
  .app { padding: var(--s-5) var(--s-4); }
  .app-header { padding: var(--s-6) var(--s-4) var(--s-5); }
  .app-header h1 { font-size: var(--fs-xl); }
  .app-subtitle { font-size: var(--fs-sm); }
  .calc-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .calc-card { min-height: 130px; padding: var(--s-4); }
  .calc-card-icon { width: 40px; height: 40px; }
  .calc-card-icon svg { width: 22px; height: 22px; }
  .calc-card-title { font-size: var(--fs-sm); }
  .calc-card::after { display: none; }
  .calc-box { padding: var(--s-5); }
  .calc-box h2 { font-size: var(--fs-lg); }
  .field-row { grid-template-columns: 1fr; }
  input, select { font-size: var(--fs-base); }
}

@media (max-width: 380px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-card { min-height: auto; flex-direction: row; align-items: center; padding: var(--s-4); }
  .calc-card-icon { margin-inline-end: var(--s-3); }
}

/* Print */
@media print {
  .app-header::before, .app-header::after,
  .calc-grid, .back-btn, button[type="submit"], .app-footer { display: none !important; }
  body { background: #fff; }
  .calc-box { box-shadow: none; border: 1px solid #ccc; }
}
