/* Petal: mobile-first, light/dark via tokens. */
:root {
  --bg: #fff7f9;
  --surface: #ffffff;
  --surface-2: #fdeef2;
  --text: #2b1d23;
  --muted: #8a7179;
  --line: #f1dde3;
  --primary: #e45a84;
  --primary-ink: #ffffff;
  --period: #e45a84;
  --predicted: #f6b8cb;
  --fertile: #7fd3c4;
  --ovulation: #2fa894;
  --plain: #f3e6ea;
  --danger: #c0392b;
  --warn: #b7791f;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(80 20 40 / 0.05), 0 6px 24px rgb(80 20 40 / 0.06);
  --brand-deep: #7a2e52;
  --brand-glow: radial-gradient(120% 80% at 50% 0%, #ffd9e5 0%, transparent 70%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Noto Sans Arabic", "Segoe UI", "Geeza Pro", "SF Arabic", Tahoma, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161013;
    --surface: #211a1d;
    --surface-2: #2b2125;
    --text: #f6e9ee;
    --muted: #b39aa3;
    --line: #3a2d32;
    --primary: #f07399;
    --predicted: #7a3a50;
    --fertile: #2f7d70;
    --ovulation: #49c2ad;
    --plain: #34282d;
    --shadow: none;
    --brand-deep: #ffb3cb;
    --brand-glow: radial-gradient(120% 80% at 50% 0%, #3a1a2a 0%, transparent 70%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.15rem; }
p { margin: .4rem 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}
.boot { display: grid; place-items: center; min-height: 100vh; }

/* Cards & layout */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.card.empty { text-align: center; padding: 32px 20px; }
.skeleton { min-height: 280px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.row.two > * { flex: 1; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.big-emoji { font-size: 2.5rem; }
.note { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }

/* Buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .08s ease, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.big-btn { font-size: 1.1rem; padding: 14px 24px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: transparent; cursor: pointer; font-size: 1.2rem; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); }
.input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
.input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.form label { display: block; margin: 10px 0; font-weight: 600; font-size: .9rem; }
.form label .input { margin-top: 6px; font-weight: 400; }
.form .input + .input { margin-top: 8px; }
.error { color: var(--danger); min-height: 1.2em; font-size: .9rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .9rem;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chip:disabled { cursor: default; opacity: .7; }
.chip.mood { font-size: 1.3rem; padding: 4px 10px; }

/* Auth */
.auth { padding-top: 6vh; }
.brand { text-align: center; margin-bottom: 18px; }
.brand h1 { margin-top: 8px; font-size: 1.8rem; }

/* Today */
.member-picker { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.member-picker .chip { white-space: nowrap; }
.hero { text-align: center; }
.ring-wrap { position: relative; width: min(280px, 78vw); margin: 4px auto 6px; }
.ring { width: 100%; display: block; }
.seg { fill: none; stroke-width: 14; stroke: var(--plain); }
.seg.period { stroke: var(--period); }
.seg.predicted { stroke: var(--predicted); }
.seg.fertile { stroke: var(--fertile); }
.seg.ovulation { stroke: var(--ovulation); }
.marker { fill: var(--surface); stroke: var(--text); stroke-width: 3; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; }
.ring-center .big { font-size: 3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.ring-center .small { color: var(--muted); margin-top: 4px; }
.phase { font-weight: 700; margin-top: 4px; }
.phase-period, .phase-late { color: var(--period); }
.phase-fertile, .phase-ovulation { color: var(--ovulation); }
.actions { display: grid; gap: 8px; justify-items: center; margin: 14px 0 6px; }
.tip { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: .9rem; text-align: start; margin-top: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats > div { background: var(--surface-2); border-radius: 12px; padding: 10px 4px; }
.stats b { display: block; font-size: 1.1rem; }
.stats span { color: var(--muted); font-size: .78rem; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 64px 1fr 40px; gap: 10px; align-items: center; padding: 4px 0; font-size: .9rem; }
.history .bar { height: 8px; background: var(--plain); border-radius: 99px; overflow: hidden; }
.history .bar i { display: block; height: 100%; background: var(--predicted); border-radius: 99px; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays span { text-align: center; color: var(--muted); font-size: .75rem; padding: 4px 0; }
.cell {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; font-size: .95rem; display: grid; place-items: center;
}
.cell.blank { cursor: default; }
.cell.future { color: var(--muted); }
.cell.fertile { background: color-mix(in srgb, var(--fertile) 35%, transparent); }
.cell.ovulation { background: var(--ovulation); color: #fff; }
.cell.predicted { box-shadow: inset 0 0 0 2px var(--predicted); background: color-mix(in srgb, var(--predicted) 25%, transparent); }
.cell.spotting::after { content: ''; position: absolute; bottom: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--period); opacity: .6; }
.cell.period { background: var(--period); color: #fff; font-weight: 700; }
.cell.today { outline: 2px solid var(--text); outline-offset: -2px; font-weight: 800; }
.cell .dot { position: absolute; top: 5px; inset-inline-end: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.sw.period { background: var(--period); }
.sw.predicted { box-shadow: inset 0 0 0 2px var(--predicted); }
.sw.fertile { background: var(--fertile); }
.sw.ovulation { background: var(--ovulation); }
.sw.dotted { width: 6px; height: 6px; background: var(--muted); }

/* Family */
.members { list-style: none; padding: 0; margin: 0; }
.members li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.members li:last-child { border-bottom: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.invite-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.invite-form, .invite-link { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.invite-link .row { margin-top: 8px; }

/* Settings */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle input {
  appearance: none; flex: none; width: 50px; height: 30px; border-radius: 99px;
  background: var(--plain); position: relative; cursor: pointer; transition: background .2s;
}
.toggle input::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .2s;
}
.toggle input:checked { background: var(--primary); }
.toggle input:checked::after { transform: translateX(20px); }
details { margin: 10px 0; }
summary { cursor: pointer; font-weight: 600; padding: 6px 0; }

/* Install */
.install { border-color: var(--predicted); }
.install .card { box-shadow: none; }
.code { font: 700 1.6rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-align: center; background: var(--surface-2); border-radius: 12px; padding: 10px; margin: 6px 0; user-select: all; }
.code-input { text-transform: uppercase; letter-spacing: .1em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Right-to-left (Arabic) */
:lang(ar) body, html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.7; }
[dir="rtl"] .toggle input:checked::after { transform: translateX(-20px); }
[dir="rtl"] .flip { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .ring { transform: scaleX(-1); } /* the cycle runs clockwise from the reader's start */

/* Brand */
.wordmark { font-weight: 800; letter-spacing: -.02em; color: var(--brand-deep); margin: 6px 0 0; }
:lang(ar) .wordmark { letter-spacing: 0; }
.welcome { padding-top: 4px; }
.welcome-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.back-link { text-decoration: none; font-weight: 600; color: var(--muted); }
.hero-brand { text-align: center; padding: 28px 12px 8px; background: var(--brand-glow); border-radius: 28px; }
.hero-brand .logo { filter: drop-shadow(0 8px 18px rgb(228 90 132 / .35)); }
.hero-brand .wordmark { font-size: 2.6rem; }
.tagline { color: var(--muted); font-size: 1.05rem; margin-top: 4px; }
.pitch { text-align: center; padding: 18px 4px 6px; }
.pitch h2 { font-size: 1.5rem; line-height: 1.3; }
.cta { display: grid; gap: 10px; margin: 18px auto 10px; max-width: 360px; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.feature { margin: 0; padding: 16px; }
.feature h3 { font-size: 1rem; margin: 6px 0 4px; }
.feature-icon { font-size: 1.6rem; }
.lang-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-switch .chip { min-height: 34px; padding: 4px 12px; }
@media (max-width: 360px) { .features { grid-template-columns: 1fr; } }

/* Tab bar */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.tab span { font-size: 1.3rem; filter: grayscale(1); opacity: .7; }
.tab.on { color: var(--primary); }
.tab.on span { filter: none; opacity: 1; }

/* Sheet */
.sheet-host { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .35); opacity: 0; transition: opacity .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 8px 18px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .22s ease;
}
.sheet-host.open .sheet-backdrop { opacity: 1; }
.sheet-host.open .sheet { transform: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--surface); padding: 8px 0; }
.sheet-head h2 { margin: 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-size: .9rem; max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Admin console */
body.admin #admin { max-width: 1400px; margin: 0 auto; }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-nav { position: sticky; top: 0; height: 100vh; padding: 18px 12px; border-inline-end: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 14px; }
.admin-brand { display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.admin-brand .wordmark { margin: 0; font-size: 1.2rem; }
.admin-nav nav { display: grid; gap: 2px; flex: 1; align-content: start; }
.nav-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.on { background: var(--primary); color: var(--primary-ink); }
.admin-main { padding: 20px 24px 60px; min-width: 0; }
.admin-title { font-size: 1.4rem; margin: 0 0 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { margin: 0; text-decoration: none; color: var(--text); display: block; }
a.tile:hover { border-color: var(--primary); }
.tile-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.tile-label { font-weight: 600; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.chart figcaption { margin-bottom: 8px; }
.chart-box { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: #e45a84; }
.chart .bar-hit.hover .bar { fill: var(--brand-deep); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart-tip { position: absolute; top: -6px; background: var(--text); color: var(--bg); font-size: .8rem; padding: 4px 8px; border-radius: 8px; pointer-events: none; white-space: nowrap; }
.detail-row td { background: var(--surface-2); }
.detail h3 { font-size: .95rem; margin: 8px 0; }
.admin-table.inner { background: var(--surface); border-radius: 10px; }
.admin-table tr.selected td { background: var(--surface-2); }
.admin-table.kv th { width: 260px; text-transform: none; letter-spacing: 0; font-size: .85rem; }
.break { word-break: break-all; }
.nowrap { white-space: nowrap; }
.danger-zone { margin-top: 14px; padding: 12px; border: 1px dashed var(--danger); border-radius: 12px; }
.temp-pass { border-color: var(--primary); }
.cli { background: var(--surface-2); padding: 12px; border-radius: 10px; overflow-x: auto; font-size: .85rem; }
@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .admin-nav nav { display: flex; flex-wrap: wrap; flex: 1 1 100%; }
  .admin-main { padding: 16px; }
}
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.filters label { display: grid; gap: 4px; font-size: .78rem; color: var(--muted); font-weight: 600; min-width: 130px; }
.filters .input { min-height: 38px; padding: 6px 10px; }
.groups { margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th { text-align: start; color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin: 2px; }
.ua { display: inline-block; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--surface-2); }
.st-allowed { background: color-mix(in srgb, var(--fertile) 40%, transparent); }
.st-pending { background: color-mix(in srgb, #f2c94c 45%, transparent); }
.st-blocked { background: color-mix(in srgb, var(--danger) 30%, transparent); }
.warn-text { color: var(--danger); }

/* Top bar + inbox */
.topbar { position: sticky; top: 0; z-index: 9; display: flex; justify-content: space-between; align-items: center; max-width: 560px; margin: 0 auto; padding: calc(8px + env(safe-area-inset-top)) 16px 4px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.topbar-brand .wordmark { margin: 0; font-size: 1.15rem; }
.bell { position: relative; font-size: 1.3rem; text-decoration: none; padding: 6px; }
.badge-count { position: absolute; top: 0; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
#view { padding-top: 8px; }
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox li a { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.inbox li.unread b::before { content: '● '; color: var(--primary); }
.settings-group h3 { margin-bottom: 4px; }
.setting-row.changed { background: color-mix(in srgb, var(--predicted) 18%, transparent); border-radius: 10px; padding-inline: 8px; }
.input.num { width: 90px; }

/* Sharing levels, app lock, privacy */
.levels { border: 0; padding: 12px 0; margin: 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.levels legend { padding: 0; margin-bottom: 6px; }
.level { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.level.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); font-weight: 600; }
.level input { accent-color: var(--primary); }
.lock-screen { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; }
.pin-dots { display: flex; gap: 12px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary); }
.pin-dots i.on { background: var(--primary); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; }
.pin-key { height: 72px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 1.5rem; font-weight: 600; cursor: pointer; }
.pin-key:active { background: var(--surface-2); }
.privacy h1 { margin-top: 8px; }
details.danger-zone { margin-top: 12px; }

/* Getting ready + Learn */
.ready h2 { margin-top: 4px; }
.checklist, .signs { list-style: none; padding: 0; margin: 0; }
.checklist li label { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.checklist li label.done { color: var(--muted); text-decoration: line-through; }
.checklist input { width: 20px; height: 20px; accent-color: var(--primary); }
.signs li { padding: 6px 0; }
.signs li::before { content: '• '; color: var(--primary); }
.articles { display: grid; gap: 10px; }
.article-card { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: var(--text); margin: 0; }
.article-icon { font-size: 1.8rem; }
.article-icon.big { font-size: 2.6rem; }
.article h1 { font-size: 1.5rem; margin: 8px 0; }
.article h3 { margin-top: 18px; }
.article ul { padding-inline-start: 20px; }
.warn-note { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.tab { font-size: .68rem; }

/* Hijri + Islamic mode */
.date-line { margin: 0 0 4px; }
.hijri { font-weight: 600; color: var(--brand-deep); }
.cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1.05; }
.hijri-day { font-size: .6rem; color: var(--muted); font-weight: 500; }
.cell.period .hijri-day, .cell.ovulation .hijri-day { color: rgb(255 255 255 / .85); }
.cell.istihada { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--period) 35%, transparent) 0 4px, transparent 4px 8px); }
.sw.istihada { background: repeating-linear-gradient(45deg, var(--period) 0 2px, transparent 2px 4px); }
.islamic .status { font-size: 1.05rem; margin: 6px 0; }
.status-hayd b { color: var(--period); }
.status-tuhr b { color: var(--ovulation); }
.rulings, .ramadan { list-style: none; padding: 0; margin: 0; }
.rulings li { padding: 4px 0; }
.ramadan li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.note.ghusl { background: color-mix(in srgb, var(--fertile) 25%, var(--surface)); }

/* Doctor report */
.report h1 { font-size: 1.3rem; margin: 0; }
.report h2 { font-size: 1rem; margin: 18px 0 8px; }
.report-head { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.report-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.report-table th, .report-table td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.report-table.kv th { width: 55%; font-weight: 600; color: var(--muted); }
.report-note { margin-top: 18px; }
@media print {
  .topbar, .tabbar, .no-print, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  #view { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
}
