/* Hamil (حامل) v1.0.0 — the look of Ameen and Raqib: the light navy design, its bars, its circles, its tables.
   No dark theme and no day/night switch: the navy design alone. Text is Noto Naskh Arabic everywhere. */
:root{--bg:#f3f4f8;--ink:#14213d;--mute:#5b6478;--line:#d9deea;--surface:#ffffff;--navy:#13305f;--navy2:#1c4b8c;--soft:#e8ecf5;--ok:#1e7a46;--bad:#c0392b;--warn:#b7770d;color-scheme:light}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:'Noto Naskh Arabic',serif;line-height:1.8;padding-bottom:120px}
[hidden]{display:none!important}
a{color:var(--navy2)}

/* the top bar: a navy capsule on a band of the page's colour, so what scrolls under it hides behind it */
.top{position:sticky;top:8px;z-index:5;margin:8px max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));color:#fff;border-radius:34px;padding:10px 12px;display:flex;align-items:center;gap:12px;background:transparent}
.top::before{content:"";position:absolute;z-index:-2;top:-80px;bottom:0;left:calc(-1 * max(12px,env(safe-area-inset-left)));right:calc(-1 * max(12px,env(safe-area-inset-right)));background:var(--bg)}
.top::after{content:"";position:absolute;z-index:-1;inset:0;border-radius:inherit;background:var(--navy);box-shadow:0 6px 18px rgba(19,48,95,.25);pointer-events:none}
.top .logo{width:56px;height:56px;border-radius:18px;background:#fff;color:var(--navy);display:grid;place-items:center;flex:none}
.top .t{flex:1;min-width:0;line-height:1.3}.top .t b{font-size:1.35rem;display:block}.top .t small{opacity:.85}
.top .wk{flex:none;background:rgba(255,255,255,.14);border:1.5px solid rgba(255,255,255,.55);border-radius:999px;padding:2px 12px;font-weight:700;font-size:.95rem;white-space:nowrap}
.rbtn{width:52px;height:52px;border-radius:50%;border:2px solid #fff;background:transparent;color:#fff;display:grid;place-items:center;cursor:pointer;padding:0;min-height:0;flex:none}

main{max-width:min(94vw,120rem);margin:0 auto;padding:16px max(12px,env(safe-area-inset-right)) 16px max(12px,env(safe-area-inset-left))}

/* the home: the pregnancy console, then the circles */
.console{border-radius:26px;padding:16px 18px;margin:0 0 18px;color:#fff;background:linear-gradient(135deg,#13305f,#1c4b8c);box-shadow:0 8px 22px rgba(19,48,95,.22);position:relative;overflow:hidden}
.console::after{content:"";position:absolute;inset:auto -40px -60px auto;width:180px;height:180px;border-radius:50%;background:rgba(255,255,255,.07);pointer-events:none}
.console .k{font-size:.95rem;opacity:.85}
.console .big{font-size:2rem;font-weight:700;line-height:1.35;margin:2px 0}
.console .sub{opacity:.9;color:#fff;display:block;font-size:inherit}
.console .prog{height:10px;border-radius:999px;background:rgba(255,255,255,.18);margin:12px 0 10px;overflow:hidden}
.console .prog i{display:block;height:100%;border-radius:inherit;background:#fff}
.console .cells{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.console .cell{background:rgba(255,255,255,.1);border-radius:16px;padding:8px 10px;min-width:0}
.console .cell b{display:block;font-size:1rem;overflow-wrap:anywhere}.console .cell span{font-size:.82rem;opacity:.85}
.console .empty{display:flex;flex-direction:column;align-items:flex-start;gap:10px}
.console button{background:#fff;color:var(--navy)}
.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px 8px;margin:8px 0 22px}
.app{display:flex;flex-direction:column;align-items:center;gap:6px;background:none;border:0;color:var(--ink);font:inherit;cursor:pointer;padding:0;position:relative;min-height:0}
.app .c{width:68px;height:68px;border-radius:50%;display:grid;place-items:center;color:#fff}
.app span{font-size:.95rem;text-align:center;line-height:1.4}
.app .n{position:absolute;top:-4px;inset-inline-start:calc(50% - 40px);background:#0b2b1d;color:#fff;border:2px solid #fff;border-radius:999px;min-width:26px;height:26px;font-size:.8rem;display:grid;place-items:center;padding:0 6px}

/* a page: its coloured head, then its body */
.sec{border-radius:26px;overflow:hidden;margin:0 0 18px;border:2px solid var(--c);background:var(--surface)}
.sec>.h{background:var(--c);color:#fff;padding:12px 18px;display:flex;align-items:center;gap:10px;font-weight:700;font-size:1.1rem}
.sec>.h small{margin-inline-start:auto;font-weight:400;opacity:.85;font-size:.9rem}
.sec>.b{padding:16px 18px}
.card{background:var(--surface);border-radius:26px;padding:18px;margin:0 0 16px;border:1px solid var(--line)}
.card h3{margin:0 0 8px;font-size:1.1rem}
.center{max-width:520px;margin:30px auto}
.sec .card{background:var(--surface)}

button{font:inherit;border:0;border-radius:18px;padding:10px 20px;background:var(--navy);color:#fff;cursor:pointer;min-height:44px;font-weight:700}
button.alt{background:var(--soft);color:var(--ink)} button.warn{background:var(--bad);color:#fff}
button.warn-o{background:transparent;color:var(--bad);border:2px solid var(--bad)}
button:disabled{opacity:.5;cursor:default}
input,select,textarea{font:inherit;width:100%;padding:12px;border:1px solid var(--line);border-radius:16px;background:#f7f8fc;color:var(--ink)}
input[type=checkbox],input[type=radio]{width:auto}
/* no text box is ever resized by a grip in its corner */
textarea{resize:none}
label{display:block;margin:10px 0 4px;font-weight:600}
label.ck{display:flex;gap:10px;align-items:center;font-weight:600}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:end}.row>*{flex:1 1 200px;min-width:0}
.row.r3>*{flex-basis:150px}
.acts-line{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 0}

/* every list of records is a real table: the navy head row, then one row per record in alternating shades */
table{width:100%;table-layout:fixed;border-collapse:collapse;word-break:break-word;direction:rtl;font-size:var(--fs-t,9pt);line-height:1.5}
th{background:#0f3460;color:#fff;text-align:right;padding:.5em .45em;font-weight:700;vertical-align:middle;line-height:1.35}
td{padding:.5em .45em;border-bottom:1px solid var(--line);vertical-align:top;overflow-wrap:anywhere}
tbody tr:nth-child(odd){background:#ffffff}tbody tr:nth-child(even){background:#f0f4f8}
tr.go{cursor:pointer}tr.go:focus-visible{outline:2px solid var(--navy2);outline-offset:-2px}
td.num{text-align:center;color:var(--mute);font-variant-numeric:tabular-nums;white-space:nowrap}
.tw{overflow-x:auto}
.card.tw{padding:12px 10px}
.uidc{display:block;font-size:.8em;line-height:1.35;color:var(--mute);direction:ltr;text-align:right;unicode-bidi:plaintext;cursor:copy;overflow-wrap:anywhere}
.nm{font-weight:700}
.sub{display:block;color:var(--mute);font-size:.9em;font-weight:400}
.ltr{direction:ltr;unicode-bidi:plaintext;text-align:right}
.empty-row td{text-align:center;color:var(--mute);padding:1.2em}
.loading{text-align:center;padding:40px 0}

/* chips of state */
.q{display:inline-flex;border-radius:999px;padding:1px 10px;font-size:.82rem;font-weight:700;color:#fff;white-space:nowrap;margin:2px}
.q.g{background:#1e7a46}.q.y{background:#b7770d}.q.r{background:#c0392b}.q.n{background:#4a5568}.q.b{background:#1c4b8c}.q.p{background:#6c3483}
.flag{color:var(--bad);font-weight:700}
.msg{padding:10px 14px;border-radius:16px;margin:10px 0}.msg.ok{background:#e3f4ea}.msg.err{background:#fbe9e7}.msg.info{background:#e8ecf5}
.note{color:var(--mute);font-size:.95rem}.note:empty{display:none}
.kv{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;font-size:.95rem}.kv b{white-space:nowrap}.kv span{min-width:0;overflow-wrap:anywhere}
.chips{display:flex;flex-wrap:wrap;gap:8px;padding:2px 0 12px}.chips button{flex:0 0 auto;min-height:40px;padding:6px 14px;font-size:.92rem;white-space:nowrap}
.chips button[aria-pressed=true]{background:var(--navy);color:#fff}
.chips button[aria-pressed=false]{background:var(--soft);color:var(--ink)}
.picks{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 0}.picks button{min-height:32px;padding:2px 10px;font-size:.85rem;background:var(--soft);color:var(--ink);font-weight:600;border-radius:12px}

/* the bottom bar: floating, each tab its own navy panel in a white frame, the current one light */
.bar{position:fixed;bottom:10px;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));z-index:6;background:var(--navy);border-radius:32px;padding:8px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;max-width:1100px;margin:0 auto;box-shadow:0 6px 18px rgba(19,48,95,.3)}
.bar button{background:transparent;border:2px solid rgba(255,255,255,.85);border-radius:22px;color:#fff;display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 2px;font-size:.85rem;font-weight:600;min-height:64px}
.bar button[aria-pressed=true]{background:#fff;color:var(--navy);border-color:#fff}
.fab{position:fixed;bottom:96px;inset-inline-end:max(16px,env(safe-area-inset-right));z-index:6;border-radius:999px;padding:12px 22px;display:flex;align-items:center;gap:10px;box-shadow:0 6px 18px rgba(19,48,95,.3);border:3px solid #fff}
body:has(#fab:not([hidden])){padding-bottom:180px}

/* a sheet over the page: a record to read, add or change */
.sheet{position:fixed;inset:0;background:rgba(10,20,40,.45);z-index:20;display:grid;place-items:end center;padding:12px}
.sheet>.card{width:min(680px,100%);max-height:88vh;overflow:auto;margin:0}
.sheet h3{margin-top:0}
#flash{position:fixed;top:86px;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));z-index:30;max-width:720px;margin:0 auto;pointer-events:none}
#flash .msg{box-shadow:0 6px 18px rgba(19,48,95,.25);pointer-events:auto}

/* the rights: two centred lines inside the interface, above the bottom bar */
.foot{text-align:center;color:var(--mute);font-size:.85rem;line-height:1.9;padding:18px 16px 24px}
.foot b{color:var(--ink);font-weight:700}

/* sign-in */
.signin{text-align:center}
.signin .lg{width:84px;height:84px;border-radius:26px;background:var(--navy);color:#fff;display:grid;place-items:center;margin:4px auto 10px}
.gbtn{display:inline-flex;align-items:center;justify-content:center;gap:10px;background:#fff;color:#1f1f1f;border:1px solid #c9cfdc;border-radius:999px;padding:10px 22px;min-height:48px;font-weight:700}
.gbtn svg{width:22px;height:22px}

/* information pages */
.signs{margin:0;padding:0;list-style:none;display:grid;gap:8px}
.signs li{display:flex;gap:10px;align-items:flex-start;background:#fbe9e7;border-radius:16px;padding:10px 12px;font-weight:600}
.signs li::before{content:"";flex:none;width:10px;height:10px;border-radius:50%;background:var(--bad);margin-top:.65em}
.nums{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px}
.nums a{display:flex;flex-direction:column;gap:2px;text-decoration:none;background:var(--soft);color:var(--ink);border-radius:18px;padding:10px 14px}
.nums a b{font-size:1.5rem;color:var(--bad);direction:ltr;text-align:right}
.src{margin:8px 0 0;padding:0 18px 0 0;font-size:.88rem;color:var(--mute)}
.src a{overflow-wrap:anywhere}
.wkbox{display:grid;gap:10px}
.wkbox .wk-h{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.wkbox .wk-h b{font-size:1.4rem}
.wkbox .part{border-radius:18px;padding:10px 14px;background:var(--soft)}
.wkbox .part b{display:block;margin-bottom:2px}
.weeks{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 12px}
.weeks button{min-width:44px;min-height:36px;padding:2px 8px;border-radius:12px;background:var(--soft);color:var(--ink);font-weight:700}
.weeks button[aria-pressed=true]{background:var(--navy);color:#fff}
.weeks button.now{box-shadow:inset 0 0 0 2px var(--bad)}
.chart{width:100%;height:auto;display:block;margin:8px 0}
.chart text{font-family:'Noto Naskh Arabic',serif}

/* phone mode: compact like Raqib and Resalah; the top bar, the bottom bar and the circles keep their own sizes */
html.m-phone{font-size:8pt}html.m-phone body{line-height:1.55;padding-bottom:calc(var(--bar-h,72px) + 24px)}
html.m-phone .top{padding:6px 10px;border-radius:22px;gap:10px}html.m-phone .top .logo{width:38px;height:38px;border-radius:11px}html.m-phone .top .logo svg{width:22px;height:22px}
html.m-phone .rbtn{width:38px;height:38px;border-width:1.5px}html.m-phone .rbtn svg{width:20px;height:20px}html.m-phone .top .t b{font-size:1.05rem}html.m-phone .top .t small{font-size:.74rem}
html.m-phone .top .wk{font-size:12px;padding:1px 9px}
html.m-phone main{padding:10px max(10px,env(safe-area-inset-right)) 10px max(10px,env(safe-area-inset-left))}
html.m-phone .grid{gap:16px 4px}html.m-phone .app .c{width:56px;height:56px}html.m-phone .app .c svg{width:24px;height:24px}html.m-phone .app span{font-size:12px;line-height:1.3}
html.m-phone .console{padding:12px 14px;border-radius:20px;margin-bottom:12px}html.m-phone .console .big{font-size:22px}html.m-phone .console .k,html.m-phone .console .sub{font-size:12px}
html.m-phone .console .cell b{font-size:12px}html.m-phone .console .cell span{font-size:11px}html.m-phone .console .cell{padding:6px 8px;border-radius:12px}
html.m-phone .console .prog{height:8px;margin:8px 0}
html.m-phone .sec{border-radius:1.375rem;margin-bottom:.75rem}html.m-phone .sec>.h{padding:.625rem .875rem;font-size:1.15rem}html.m-phone .sec>.b{padding:.625rem}
html.m-phone .card{padding:.75rem;border-radius:1.25rem;margin-bottom:.625rem}html.m-phone .card h3{margin:0 0 .45rem;font-size:1.1rem}
html.m-phone .card.tw{padding:.625rem .5rem}
html.m-phone input,html.m-phone select,html.m-phone textarea{padding:.55rem .7rem;border-radius:.8rem}
html.m-phone label{margin:.375rem 0 .125rem}
html.m-phone main button:not(.app),html.m-phone .sheet button{padding:.5rem 1rem;min-height:max(30px,2.5rem);border-radius:.95rem}
html.m-phone .chips button{min-height:max(26px,2.125rem);padding:.25rem .75rem}
html.m-phone .bar{left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:calc(8px + var(--sab,0px));border-radius:24px;padding:6px;gap:6px}
html.m-phone .bar button{min-height:52px;padding:4px 2px;font-size:max(12px,.74rem);border-radius:16px}
html.m-phone .bar button svg{width:22px;height:22px}
html.m-phone .fab{bottom:calc(var(--bar-h,72px) + 12px);padding:8px 14px}
html.m-phone body:has(#fab:not([hidden])){padding-bottom:calc(var(--bar-h,72px) + 84px)}
html.m-phone .msg{padding:.625rem .875rem;border-radius:1rem}
html.m-phone .sheet{padding:.75rem}
html.m-phone #flash{top:64px}
html.m-phone .foot{font-size:11px;padding:12px 10px 14px}
:root{--sab:env(safe-area-inset-bottom,0px)}html.in-app{--sab:0px}
/* desktop mode: uses the width of large screens */
html.m-desk{font-size:16px}html.m-desk .grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}html.m-desk .app .c{width:76px;height:76px}
html.m-desk main{max-width:min(96vw,120rem)}html.m-desk .bar{max-width:900px}
@media (min-width:1400px){html.m-desk{font-size:17px}}
@media (min-width:2200px){html.m-desk{font-size:20px}html.m-desk .app .c{width:92px;height:92px}}
@media (min-width:3200px){html.m-desk{font-size:28px}html.m-desk .app .c{width:120px;height:120px}html.m-desk .top .logo{width:76px;height:76px}html.m-desk .rbtn{width:68px;height:68px}}

/* the phone home is one screen: the two bars stand where they stand on every page, and the console, the circles and
   the rights share the space between them with equal gaps (fitHome() measures and sets --hg and --hz) */
html.home-fit,html.home-fit body{overflow:hidden}html.home-fit body{height:var(--hvh,100dvh);padding-bottom:0!important}
html.home-fit main{padding-top:0;padding-bottom:0}
html.home-fit #home .console{margin:calc(var(--hg,8px) / var(--hz,1)) 0 0;zoom:var(--hz,1)}
html.home-fit #home .grid{margin:calc(var(--hg,8px) / var(--hz,1)) 0 0;zoom:var(--hz,1)}
html.home-fit #home .foot{margin:calc(var(--hg,8px) / var(--hz,1)) 0 0;padding:0;zoom:var(--hz,1)}

/* the pregnancy file for printing */
.report h2{margin:.2em 0}.report h3{margin:1em 0 .4em;color:var(--navy)}
.report .meta{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:6px 14px}
@media print{
  body{background:#fff;padding:0}
  .top,.bar,.fab,#flash,.noprint{display:none!important}
  main{max-width:none;padding:0}
  .sec{border:0}.sec>.h{background:#fff;color:var(--ink);padding:0 0 6px;border-bottom:2px solid var(--navy)}
  table{font-size:9pt}th{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  tbody tr:nth-child(even){-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* v1.0.0 refinements: tables never split a word, dates stay whole, wide tables scroll on a narrow screen */
th{word-break:normal;overflow-wrap:normal}
.dt{white-space:nowrap}
html.m-phone table.wide{min-width:600px}
.signs-t td.nm{font-weight:700}
.signs-t tbody tr td.num{color:var(--bad);font-weight:700}
a.tel{font-weight:700;font-size:1.25em;color:var(--bad);text-decoration:none;direction:ltr;unicode-bidi:isolate}
.src{list-style-type:arabic-indic}
.bp{display:flex;align-items:center;gap:6px}.bp input{flex:1;min-width:0;text-align:center}.bp span{flex:none;font-weight:700;color:var(--mute)}
.row.r3>*{flex:1 1 0;min-width:0}
html.m-phone .row.r3 label{font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* the font-size card keeps a size that can always be read and tapped, so a very small choice can be undone */
#fs-card{font-size:15px}#fs-card h3{font-size:17px}#fs-card .chips button{min-width:44px;font-size:15px}
html.m-phone #fs-card{font-size:max(12px,1rem)}html.m-phone #fs-card h3{font-size:max(13px,1.1rem)}html.m-phone #fs-card .chips button{min-width:max(34px,2.6rem);min-height:max(28px,2.4rem);padding:.2rem .6rem;font-size:max(12px,1rem)}
/* the laptop: the twelve circles in one row on a wide screen, two rows of six on a medium one; tables read at the page's size */
@media (min-width:1200px){html.m-desk .grid{grid-template-columns:repeat(12,minmax(0,1fr))}}
@media (min-width:760px) and (max-width:1199px){html.m-desk .grid{grid-template-columns:repeat(6,minmax(0,1fr))}}
html.m-desk table{font-size:var(--fs-t,.95rem)}
html.m-desk main{padding-top:22px}
