/* ClyDoc "My care" pages (js/care.js): My Medicines, Reminders, Food log, Emergency card, Family, Share with my doctor,
   the shared health summary, Account security and the first-launch notice. Colours come from the theme tokens, so the
   light and dark themes, the website and the apps all work. */
.cr-head { padding-bottom: 20px; }
.cr-head .btn svg, .cr-card .btn svg, .cr-empty .btn svg, .cr-file svg, [data-page="share"] .btn svg, [data-page="consult"] .btn svg, .cr-link .btn svg, .cr-banner .btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-right: 6px; flex: none; }
[id$="Root"] .icon-btn svg { width: 18px; height: 18px; }
.cr-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
[data-page="meds"] .panel, [data-page="reminders"] .panel, [data-page="food"] .panel, [data-page="family"] .panel, [data-page="share"] .panel { padding: 20px; margin-bottom: 16px; }
.cr-grid > .panel { margin-bottom: 0 !important; }
.cr-note { color: var(--dim); font-size: .84rem; margin: 6px 0 40px; max-width: 80ch; }
.cr-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 26px 12px; color: var(--muted); }
.cr-empty > svg { width: 44px; height: 44px; fill: none; stroke: var(--glow); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.cr-empty p { max-width: 46ch; margin: 0; }
.cr-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cr-big { display: block; font: 600 2.6rem var(--display); color: var(--text); line-height: 1.1; margin-top: 6px; }
.cr-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); margin-bottom: 16px; }
.cr-banner svg { width: 22px; height: 22px; fill: none; stroke: var(--warn); stroke-width: 1.7; flex: none; }
.cr-banner p { margin: 0; flex: 1; font-size: .9rem; }

/* Switch */
.cr-switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: none; cursor: pointer; }
.cr-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cr-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .15s; pointer-events: none; }
.cr-switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.cr-switch input:checked + span { background: var(--brand); }
.cr-switch input:checked + span::after { transform: translateX(17px); }
.cr-switch input:focus-visible + span { outline: 2px solid var(--glow); outline-offset: 2px; }

/* Dialog form bits */
.cr-card { width: min(620px, 100%); }
.cr-card .drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cr-card .drawer-head h3 { margin: 0; }
.cr-card .modal-body .full, .cr-card .wb-field.full { grid-column: 1 / -1; }
.cr-times { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cr-time { display: inline-flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.cr-time input { background: transparent; border: 0; color: var(--text); padding: 8px 6px 8px 10px; font: inherit; color-scheme: inherit; }
.cr-time button { background: none; border: 0; color: var(--dim); font-size: 18px; padding: 0 10px; cursor: pointer; }
.cr-time button:hover { color: var(--risk); }
.cr-days { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-day { position: relative; cursor: pointer; }
.cr-day input { position: absolute; opacity: 0; }
.cr-day span { display: inline-grid; place-items: center; min-width: 46px; height: 34px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); font-size: .85rem; }
.cr-day input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.cr-day input:focus-visible + span { outline: 2px solid var(--glow); outline-offset: 2px; }
.cr-check { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--text); cursor: pointer; }
.cr-check input { width: 17px; height: 17px; accent-color: var(--brand); }
.cr-checks { display: grid; gap: 9px; margin: 12px 0 16px; }
.cr-notice { text-align: left; }
.cr-notice img { width: 56px; height: 56px; border-radius: 14px; display: block; margin-bottom: 12px; }
.cr-notice p { margin: 0 0 10px; color: var(--text); }
.cr-notice p.muted { color: var(--muted); }

/* My Medicines */
.cr-doses { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cr-doses li { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); }
.cr-doses li.done { opacity: .72; }
.cr-doses time { font: 600 .92rem var(--display); color: var(--glow); }
.cr-doses span b { display: block; }
.cr-doses span small { color: var(--muted); }
.cr-take { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 600 .85rem var(--body); cursor: pointer; }
.cr-take svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.cr-take:hover { border-color: var(--brand); }
.cr-take.on { background: color-mix(in srgb, var(--t-ok, #34d399) 18%, transparent); border-color: var(--t-ok, #34d399); color: var(--t-ok, #34d399); }
.cr-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 90px; margin-top: 14px; align-items: end; }
.cr-week.tall { height: 150px; margin-bottom: 10px; }
.cr-week span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.cr-week i { width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--glow), var(--brand)); display: block; }
.cr-week i.over { background: linear-gradient(180deg, var(--warn), var(--risk)); }
.cr-week small { color: var(--dim); font-size: .72rem; }
.cr-meds { display: grid; gap: 10px; }
.cr-med { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-2); }
.cr-med-ic, .cr-rem-ic, .cr-meal-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--sky); }
.cr-med-ic svg, .cr-rem-ic svg, .cr-meal-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cr-med-b { flex: 1; min-width: 0; }
.cr-med-b b { display: block; font-size: 1.02rem; }
.cr-med-b > span { color: var(--muted); font-size: .88rem; }
.cr-med-b p { margin: 6px 0 2px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cr-med-b em { font-style: normal; font-size: .8rem; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--glow) 14%, transparent); color: var(--glow); }
.cr-med-b p small { color: var(--dim); }
.cr-med-a { display: flex; align-items: center; gap: 6px; }
.ri-addmeds { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 4px 0 14px; }

/* Reminders */
.cr-rems { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cr-rems li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); }
.cr-rems li.off { opacity: .55; }
.cr-rems li > div { flex: 1; min-width: 0; }
.cr-rems li b { display: block; }
.cr-rems li span:not(.cr-rem-ic) { color: var(--muted); font-size: .86rem; }

/* Food log */
.cr-file { cursor: pointer; }
.cr-daybar { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.cr-daybar b { min-width: 130px; text-align: center; font: 600 1.05rem var(--display); }
.cr-daybar .icon-btn { font-size: 22px; line-height: 1; }
.cr-daybar .icon-btn:disabled { opacity: .35; cursor: default; }
.cr-cal { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 10px; margin-bottom: 14px; }
.cr-cal b { font: 600 2.4rem var(--display); }
.cr-cal span { color: var(--muted); }
.cr-cal .cr-bar { grid-column: 1 / -1; }
.cr-bar { display: block; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.cr-bar.sm { height: 6px; }
.cr-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--glow)); transition: width .4s; }
.cr-bar i.over, .cr-nut-list li.over .cr-bar i { background: linear-gradient(90deg, var(--warn), var(--risk)); }
.cr-nut-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.cr-nut-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-size: .9rem; }
.cr-nut-list li > span:first-child { color: var(--muted); }
.cr-nut-list li small { color: var(--dim); font-weight: 400; }
.cr-nut-list li.over b { color: var(--risk); }
.cr-nut-list .cr-bar { grid-column: 1 / -1; }
.cr-meals { display: grid; gap: 10px; }
.cr-meal { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-2); }
.cr-meal img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; flex: none; }
.cr-meal > div { flex: 1; min-width: 0; }
.cr-meal b { display: block; }
.cr-meal small { color: var(--dim); }
.cr-meal p { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
.cr-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-flags em { font-style: normal; font-size: .76rem; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.cr-score { font: 600 1.4rem var(--display); color: var(--glow); white-space: nowrap; }
.cr-score small { font-size: .75rem; color: var(--dim); }
.cr-pend { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; padding: 18px; border-color: var(--brand) !important; }
.cr-pend.busy { align-items: center; color: var(--muted); }
.cr-pend img { width: 110px; height: 110px; object-fit: cover; border-radius: 14px; flex: none; }
.cr-pend.busy img { width: 56px; height: 56px; }
.cr-pend-b { flex: 1; min-width: 0; }
.cr-pend-b h3 { margin: 0 0 8px; }
.cr-pend-b ul { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }
.cr-pend-b li { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; }
.cr-pend-b li small { color: var(--dim); }
.cr-pend-b > p { margin: 6px 0; font-size: .9rem; }
.cr-pend-a { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.cr-pend-a .wb-field { min-width: 150px; }

/* Emergency card */
.cr-sos { border-radius: var(--r-lg); overflow: hidden; border: 1px solid color-mix(in srgb, var(--risk) 40%, var(--line)); background: var(--card); margin-bottom: 16px; }
.cr-sos > header { display: flex; align-items: center; gap: 16px; padding: 20px 22px; background: linear-gradient(120deg, #b91c1c, #ef4444); color: #fff; }
.cr-sos-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.18); flex: none; }
.cr-sos-ic svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cr-sos > header > div:nth-child(2) { flex: 1; min-width: 0; }
.cr-sos > header small { letter-spacing: .12em; font-size: .72rem; opacity: .85; }
.cr-sos > header h2 { margin: 2px 0; color: #fff; font-size: 1.6rem; }
.cr-sos > header p { margin: 0; opacity: .9; }
.cr-blood { text-align: center; background: rgba(255,255,255,.16); border-radius: 14px; padding: 8px 16px; }
.cr-blood small { display: block; font-size: .7rem; letter-spacing: .06em; opacity: .85; }
.cr-blood b { font: 700 1.8rem var(--display); color: #fff; }
.cr-sos-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.cr-sos-grid section, .cr-sos-contacts, .cr-sos footer { background: var(--card); padding: 16px 22px; }
.cr-sos h4 { margin: 0 0 8px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cr-sos p { margin: 0; }
.cr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-chips em { font-style: normal; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: .88rem; }
.cr-chips.red em { background: color-mix(in srgb, var(--risk) 14%, transparent); border-color: color-mix(in srgb, var(--risk) 45%, transparent); color: var(--risk); font-weight: 600; }
.cr-call { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--glow); font-weight: 600; text-decoration: none; }
.cr-call svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cr-call.cr-call-big { margin: 0; padding: 8px 16px; border-radius: 999px; background: #16a34a; color: #fff; }
.cr-sos-contacts { border-top: 1px solid var(--line); }
.cr-sos-contacts > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.cr-sos-contacts > div:last-child { border-bottom: 0; }
.cr-sos-contacts span b { display: block; }
.cr-sos-contacts span small { color: var(--muted); }
.cr-sos footer { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cr-sos footer em { font-style: normal; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--t-ok, #34d399) 16%, transparent); color: var(--t-ok, #34d399); font-weight: 600; font-size: .85rem; }
.cr-sos footer p { flex: 1; }
.cr-sos footer small { color: var(--dim); margin-left: auto; }

/* Family */
.cr-fams { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cr-fam { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-2); }
.cr-fam.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.cr-fam > div { flex: 1; min-width: 0; }
.cr-fam b { display: block; }
.cr-fam small { color: var(--muted); }
.cr-av { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; font: 600 1rem var(--display); flex: none; }
.cr-fam .dk-chip { --tone: var(--t-ok, #34d399); }
.cr-fambar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 14px; background: linear-gradient(90deg, #6d28d9, #7c5cf6); color: #fff; font-size: .9rem; }
.cr-fambar svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.7; }
.cr-fambar button { background: rgba(255,255,255,.2); color: #fff; border: 0; border-radius: 999px; padding: 4px 12px; font: 600 .82rem var(--body); cursor: pointer; }
.cr-fambar button:hover { background: rgba(255,255,255,.32); }
.app-desktop .cr-fambar { position: fixed; top: auto; bottom: 16px; left: 50%; transform: translateX(-50%); border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.35); z-index: 90; }

/* Share with my doctor */
.cr-fresh { padding: 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--brand) 10%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent); margin-bottom: 14px; }
.cr-fresh p { margin: 0 0 10px; }
.cr-qr { width: 170px; height: 170px; margin: 0 auto 12px; background: #fff; border-radius: 12px; padding: 6px; }
.cr-qr svg { width: 100%; height: 100%; display: block; }
.cr-link { display: flex; gap: 8px; flex-wrap: wrap; }
.cr-link input { flex: 1; min-width: 160px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); padding: 8px 10px; font: .86rem var(--body); }
.cr-shares { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cr-shares li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); }
.cr-shares li > div { flex: 1; min-width: 0; }
.cr-shares b { display: block; }
.cr-shares small { color: var(--muted); }

/* The shared health summary (for the doctor) */
.cr-report { max-width: 900px; margin: 32px auto 60px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.cr-report > header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.cr-report > header img { width: 52px; height: 52px; border-radius: 14px; }
.cr-report > header > div { flex: 1; min-width: 200px; }
.cr-report > header small { letter-spacing: .12em; font-size: .72rem; color: var(--muted); }
.cr-report > header h1 { margin: 2px 0; font-size: 1.8rem; }
.cr-report > header p { margin: 0; color: var(--muted); }
.cr-exp { font-size: .82rem; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.cr-report section { margin-bottom: 22px; }
.cr-report h2 { font-size: 1.1rem; margin: 0 0 10px; }
.cr-r-top { display: flex; gap: 14px; }
.cr-r-top > div { flex: 1; padding: 14px 18px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); }
.cr-r-top small { color: var(--muted); }
.cr-r-top b { display: block; font: 600 2rem var(--display); }
.cr-r-top b span { font-size: .95rem; color: var(--dim); }
.cr-r-dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.cr-r-dl div { padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-2); }
.cr-r-dl dt { font-size: .78rem; color: var(--muted); }
.cr-r-dl dd { margin: 2px 0 0; font-weight: 600; }
.cr-r-sys { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.cr-r-sys div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 2px 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-2); }
.cr-r-sys span { width: 10px; height: 10px; border-radius: 50%; grid-row: span 2; }
.cr-r-sys em { font-style: normal; font: 600 1.05rem var(--display); grid-row: span 2; }
.cr-r-sys small { color: var(--muted); }
.cr-r-tab { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cr-r-tab th, .cr-r-tab td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cr-r-tab th { color: var(--muted); font-weight: 500; font-size: .8rem; }
.cr-r-tab tr.warn td:nth-child(2) { color: var(--warn); }
.cr-r-tab tr.risk td:nth-child(2) { color: var(--risk); }
.cr-r-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.cr-r-list li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.cr-r-list li b { flex: 1; }
.cr-r-list li span { color: var(--muted); min-width: 90px; }
.cr-r-list li em { font-style: normal; color: var(--glow); }
.cr-report footer { color: var(--dim); font-size: .84rem; border-top: 1px solid var(--line); padding-top: 14px; }
.cr-r-print { text-align: right; margin: 12px 0 0; }
@media print {
  body > *:not(main), .site-header, .site-footer, .cr-r-print, .announce-bar, .dk-side, .dk-top, .mb-nav, .mb-fab { display: none !important; }
  .cr-report { border: 0; margin: 0; padding: 0; max-width: none; background: #fff; color: #111; }
  .cr-report * { color: #111 !important; background: transparent !important; }
}

/* Account security (Profile) */
.cr-security { margin-bottom: 20px; }
.cr-sec { list-style: none; padding: 0; margin: 0; }
.cr-sec > li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.cr-sec > li.col { flex-direction: column; align-items: stretch; }
.cr-sec > li > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.cr-sec .muted { font-size: .86rem; }
.cr-devices { display: grid; gap: 8px; }
.cr-dev { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--line); }
.cr-dev b { display: block; font-size: .92rem; }
.cr-dev small { color: var(--muted); }
.cr-devices > .btn { justify-self: start; }

@media (max-width: 900px) {
  .cr-grid { grid-template-columns: 1fr; }
  .cr-sos-grid { grid-template-columns: 1fr; }
  .cr-r-dl { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cr-nut-list { grid-template-columns: 1fr; }
  .cr-pend { flex-direction: column; }
  .cr-pend img { width: 100%; height: 180px; }
  .cr-sos > header { flex-wrap: wrap; }
  .cr-card .modal-body { grid-template-columns: 1fr; }
  .cr-med { flex-wrap: wrap; }
  .cr-med-a { width: 100%; justify-content: flex-end; }
  .cr-report { padding: 18px; margin-top: 12px; }
  .cr-r-top { flex-direction: column; }
}
/* Phones in the Android app: dialogs become bottom sheets */
.app-mobile .cr-modal { place-items: end center; padding: 0; }
.app-mobile .cr-modal .cr-card { border-radius: 22px 22px 0 0; max-height: 88vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.app-mobile .cr-head { padding-top: 6px; }
.app-mobile .cr-head h1 { display: none; }
.app-mobile .cr-head .head-actions { width: 100%; }
.app-mobile .cr-head .head-actions .btn { flex: 1 1 auto; }
.app-mobile .cr-fambar { position: sticky; top: env(safe-area-inset-top); left: auto; transform: none; bottom: auto; border-radius: 0; }

/* Offline bar (js/offline.js) */
.offline-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 120; max-width: min(640px, calc(100vw - 32px)); padding: 10px 18px; border-radius: 14px; background: #1f2937; color: #f3f4f6; font-size: .88rem; box-shadow: 0 10px 30px rgba(0,0,0,.35); text-align: center; }
.offline-bar.back { background: #15803d; }
.app-mobile .offline-bar { bottom: calc(86px + env(safe-area-inset-bottom)); }

/* Languages (js/i18n.js) */
.dk-lang { width: auto; min-width: 44px; padding: 0 12px; border-radius: 999px; gap: 6px; display: inline-flex; align-items: center; }
.dk-lang b { font: 600 12px var(--body); color: var(--text); }
.i18n-pick.pop { position: fixed; z-index: 130; }
.i18n-pick.sheet { position: fixed; inset: 0; z-index: 130; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.5); }
.i18n-card { min-width: 220px; padding: 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line-2); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.i18n-pick.sheet .i18n-card { width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 14px 12px calc(16px + env(safe-area-inset-bottom)); }
.i18n-t { margin: 4px 10px 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.i18n-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: 15px var(--body); cursor: pointer; text-align: left; }
.i18n-opt:hover, .i18n-opt:focus-visible { background: var(--bg-2); outline: none; }
.i18n-opt b { font-weight: 600; }
.i18n-opt small { color: var(--muted); }
.i18n-opt i { margin-left: auto; font-style: normal; color: var(--glow); font-weight: 700; }
.i18n-opt.on { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.mb-row-v { margin-left: auto; font-style: normal; color: var(--muted); font-size: 14px; }
/* Urdu: right-to-left text inside the usual layout */
html.lang-rtl body { font-family: 'Segoe UI', 'Noto Naskh Arabic', 'Noto Sans Arabic', Tahoma, sans-serif; }
html.lang-rtl :is(p, h1, h2, h3, h4, h5, h6, li, td, th, dt, dd, label, figcaption, blockquote, .muted) { unicode-bidi: plaintext; }
html[lang="hi"] body { font-family: 'Nirmala UI', 'Noto Sans Devanagari', var(--body); }
html[lang="zh-CN"] body { font-family: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', var(--body); }

/* The Android app keeps Languages in the profile sheet (below Dark mode), not in the header */
.app-mobile #dkLang { display: none; }

/* Dashboard "Today" card (js/desktop.js) */
.dk-care { margin-bottom: 18px; }
.dk-care header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dk-care-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dk-care-t { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color .15s; }
.dk-care-t:hover { border-color: var(--dk-purple, var(--brand)); }
.dk-care-t b { font: 600 1.35rem var(--display); }
.dk-care-t small { color: var(--muted); font-size: .82rem; }
.app-mobile .dk-care-row { grid-template-columns: 1fr; }
.i18n-note { margin: 8px 10px 4px; max-width: 260px; font-size: .74rem; line-height: 1.45; color: var(--muted); }
.i18n-pick.sheet .i18n-note { max-width: none; }
/* "Translating…" while the text on screen is still being translated */
.i18n-busy { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 125; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5); color: var(--text); font: 600 .8rem var(--body); opacity: 0; transform: translate(-50%, 10px); transition: opacity .25s, transform .25s; pointer-events: none; }
.i18n-busy.on { opacity: 1; transform: translate(-50%, 0); }
.i18n-busy i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--glow); animation: i18n-spin .8s linear infinite; }
@keyframes i18n-spin { to { transform: rotate(360deg); } }
.app-mobile .i18n-busy { bottom: calc(86px + env(safe-area-inset-bottom)); }

/* Family member cards: photo, name and relation, a tidy details grid, actions on their own row (2026-10-24) */
.cr-fams { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cr-fam { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
.cr-fam-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cr-fam-head > div { flex: 1; min-width: 0; display: grid; gap: 4px; }
.cr-fam-head b { font: 600 1.02rem var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-fam-rel { justify-self: start; padding: 2px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; color: var(--glow); background: color-mix(in srgb, var(--brand) 16%, transparent); }
.cr-av { width: 52px; height: 52px; font-size: 1.1rem; }
.cr-av-img { object-fit: cover; border: 2px solid var(--line-2); padding: 0; }
.cr-fam-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.cr-fam-facts div { padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.cr-fam-facts dt { font-size: 0.7rem; color: var(--muted); }
.cr-fam-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 0.88rem; overflow-wrap: anywhere; }
.cr-fam-note { margin: 0; font-size: 0.84rem; color: var(--muted); }
.cr-fam-note b { display: inline; margin-right: 6px; color: var(--text); font-size: 0.8rem; }
.cr-fam-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.cr-fam-tools { display: inline-flex; gap: 4px; }
.cr-fam-photo { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding: 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.cr-fam-photo > div { display: grid; gap: 2px; }
.cr-fam-photo small { color: var(--muted); }
.cr-fam-pic { flex: none; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line-2); }
.cr-fam-pic img { width: 100%; height: 100%; object-fit: cover; }
.cr-fam-pic svg { width: 28px; height: 28px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.cr-fam-pic-btns { display: flex; gap: 6px; margin-top: 6px; }
.cr-fam-pic-btns label { cursor: pointer; }
@media (max-width: 520px) { .cr-fams { grid-template-columns: minmax(0, 1fr); } .cr-fam-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Emergency card: a wallet card like the blood donor card, PDF and printed-card orders (2026-10-24) ---------- */
.cr-ecard-row { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.cr-ecard { position: relative; overflow: hidden; aspect-ratio: 85.6 / 54; padding: 20px 22px; border-radius: 22px; color: #fff; display: grid; grid-template-rows: auto 1fr auto; gap: 8px;
  background: radial-gradient(120% 90% at 100% 0%, #e2404f 0%, transparent 55%), linear-gradient(150deg, #a3122a 0%, #7a0b1f 60%, #5c0718 100%); box-shadow: 0 24px 50px -24px rgba(163, 18, 42, .8), inset 0 0 0 1px rgba(255, 255, 255, .12); }
.cr-ecard::after { content: ''; position: absolute; left: -40px; bottom: -70px; width: 200px; height: 200px; border-radius: 50%; background: rgba(0, 0, 0, .14); pointer-events: none; }
.cr-ecard small { display: block; color: rgba(255, 214, 219, .85); font: 600 .6rem var(--display); letter-spacing: .12em; text-transform: uppercase; }
.cr-ec-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.cr-ec-top img { width: 36px; height: 36px; }
.cr-ec-top > div { flex: 1; min-width: 0; }
.cr-ec-top > div b { font: 700 1.1rem var(--display); }
.cr-ec-blood { text-align: right; }
.cr-ec-blood b { font: 700 2rem/1 var(--display); }
.cr-ec-mid { display: grid; gap: 6px; align-content: center; position: relative; z-index: 1; min-width: 0; }
.cr-ec-mid b { display: block; font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-ec-mid em { font-style: normal; font-size: .76rem; color: rgba(255, 225, 228, .9); }
.cr-ec-foot { display: flex; justify-content: space-between; align-items: end; gap: 12px; position: relative; z-index: 1; }
.cr-ec-foot b { font-weight: 600; font-size: .86rem; }
.cr-ec-no { text-align: right; }
.cr-ec-donor { position: absolute; right: 22px; top: 50%; padding: 3px 10px; border-radius: 999px; background: #fff; color: #a3122a; font: 700 .66rem var(--display); letter-spacing: .06em; z-index: 1; }
.cr-ec-side h3 { margin: 0 0 6px; }
.cr-ec-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.cr-ec-order { background: #d92d3f; border-color: #d92d3f; color: #fff; }
.cr-ec-order:hover { background: #c0233a; border-color: #c0233a; }
.cr-ec-oh { margin: 18px 0 8px; font-size: .9rem; }
.cr-ec-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cr-ec-orders li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.cr-ec-orders li span { display: grid; min-width: 0; }
.cr-ec-orders small { color: var(--muted); }
.cr-ec-st { font-style: normal; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.cr-ec-st.t-warn { background: rgba(242, 181, 68, .15); color: var(--warn); }
.cr-ec-st.t-ok { background: rgba(52, 211, 153, .14); color: #34d399; }
.cr-ec-st.t-mute { background: var(--card); color: var(--muted); }
/* Order page */
.cr-ord { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; align-items: start; }
.cr-ord-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.cr-ord-item > div { flex: 1; min-width: 0; display: grid; }
.cr-ord-item small { color: var(--muted); }
.cr-ord-item strong { font: 700 1.2rem var(--display); }
.cr-ord-mini { width: 64px; aspect-ratio: 85.6 / 54; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px; background: linear-gradient(150deg, #a3122a, #5c0718); color: #fff; flex: none; }
.cr-ord-mini img { width: 16px; height: 16px; }
.cr-ord-mini b { font: 700 .8rem var(--display); }
.cr-ord-total { margin: 14px 0; display: grid; gap: 6px; }
.cr-ord-total div { display: flex; justify-content: space-between; }
.cr-ord-total dt { color: var(--muted); }
.cr-ord-total dd { margin: 0; }
.cr-ord-total .tot { padding-top: 8px; border-top: 1px solid var(--line); font-weight: 700; font-size: 1.05rem; }
.cr-ord-total .tot dt { color: var(--text); }
.cr-ord-form h3 { margin: 4px 0 10px; }
.cr-ord-form .pr-paybox { margin-bottom: 12px; }
.cr-ord-shot { display: flex; margin: 6px 0 4px; cursor: pointer; }
.cr-ord-shot span { flex: 1; display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; border: 1.5px dashed var(--line-2); color: var(--muted); font-weight: 600; }
.cr-ord-shot span:hover { border-color: var(--glow); color: var(--text); }
.cr-ord-shot svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.cr-ord-shot img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; }
.cr-ord-form > .btn { width: 100%; margin-top: 8px; height: 48px; font-size: 1rem; }
.cr-ord-fine { font-size: .8rem; margin: 10px 0 0; }
@media (max-width: 900px) { .cr-ecard-row, .cr-ord { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .cr-ecard { padding: 16px 16px; border-radius: 18px; } .cr-ec-blood b { font-size: 1.6rem; } .cr-ec-mid b { font-size: .86rem; } .cr-ec-donor { right: 16px; } }
