/* Design system — Tamreedak | تمريضك. Trust. Care. Comfort. Professionalism.
   Calm medical teal on cool slate. Every colour, radius and shadow is a token here; components only use tokens, so the
   whole look (and dark mode) is changed in one place. Kept on purpose: 52px+ touch targets and 17px base text for elderly
   readers. Contrast: white on --accent (#0F766E) = 5.5:1; --brand #0D9488 is for icons / borders / decoration only. */
:root {
  --font-display: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;

  --bg: #F8FAFC; --surface: #FFFFFF; --surface-2: #F1F5F9; --surface-3: #F8FAFC;
  --ink: #1E293B; --ink-soft: #64748B; --ink-soft-2: #475569; --line: #E2E8F0; --line-strong: #94A3B8;
  --brand: #0D9488; --accent: #0F766E; --accent-hover: #115E59; --accent-ink: #FFFFFF; --link: #0F766E; --info-soft: #E6F6F4;
  --teal: #0D9488; --teal-soft: #CCFBF1; --teal-ink: #0F766E;
  --good: #15803D; --good-soft: #DCFCE7; --warn: #92400E; --warn-soft: #FEF3C7;
  --bad: #B91C1C; --bad-soft: #FEE2E2; --danger-btn: #DC2626;
  --hero-bg: #0F766E; --hero-bg-2: #134E4A; --hero-ink: #FFFFFF; --hero-accent: #CCFBF1;
  --focus: #0D9488; --ring: rgba(13, 148, 136, .22); --toast-bg: #1E293B; --toast-ink: #FFFFFF; --star: #D97706;
  --bar-warn: #F59E0B; --bar-info: #0284C7; --bar-good: #16A34A; --bar-bad: #DC2626; --bar-plat: #0284C7;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .14);
  --shadow-primary: 0 6px 16px rgba(13, 148, 136, .25);
  --header-bg: rgba(255, 255, 255, .88); --backdrop: rgba(15, 23, 42, .5);
  --radius: 18px; --radius-md: 14px; --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F172A; --surface: #1E293B; --surface-2: #334155; --surface-3: #263449;
    --ink: #F1F5F9; --ink-soft: #94A3B8; --ink-soft-2: #CBD5E1; --line: #334155; --line-strong: #475569;
    --brand: #2DD4BF; --accent: #2DD4BF; --accent-hover: #5EEAD4; --accent-ink: #0F172A; --link: #5EEAD4; --info-soft: #134E4A;
    --teal: #2DD4BF; --teal-soft: #134E4A; --teal-ink: #99F6E4;
    --good: #4ADE80; --good-soft: #14532D; --warn: #FCD34D; --warn-soft: #422006;
    --bad: #FCA5A5; --bad-soft: #4C1D1D; --danger-btn: #DC2626;
    --hero-bg: #134E4A; --hero-bg-2: #0F172A; --hero-ink: #FFFFFF; --hero-accent: #5EEAD4;
    --focus: #5EEAD4; --ring: rgba(45, 212, 191, .28); --toast-bg: #F1F5F9; --toast-ink: #0F172A; --star: #FBBF24;
    --bar-warn: #FBBF24; --bar-info: #38BDF8; --bar-good: #4ADE80; --bar-bad: #F87171; --bar-plat: #38BDF8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
    --shadow-primary: none;
    --header-bg: rgba(30, 41, 59, .88); --backdrop: rgba(2, 6, 23, .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F172A; --surface: #1E293B; --surface-2: #334155; --surface-3: #263449;
  --ink: #F1F5F9; --ink-soft: #94A3B8; --ink-soft-2: #CBD5E1; --line: #334155; --line-strong: #475569;
  --brand: #2DD4BF; --accent: #2DD4BF; --accent-hover: #5EEAD4; --accent-ink: #0F172A; --link: #5EEAD4; --info-soft: #134E4A;
  --teal: #2DD4BF; --teal-soft: #134E4A; --teal-ink: #99F6E4;
  --good: #4ADE80; --good-soft: #14532D; --warn: #FCD34D; --warn-soft: #422006;
  --bad: #FCA5A5; --bad-soft: #4C1D1D; --danger-btn: #DC2626;
  --hero-bg: #134E4A; --hero-bg-2: #0F172A; --hero-ink: #FFFFFF; --hero-accent: #5EEAD4;
  --focus: #5EEAD4; --ring: rgba(45, 212, 191, .28); --toast-bg: #F1F5F9; --toast-ink: #0F172A; --star: #FBBF24;
  --bar-warn: #FBBF24; --bar-info: #38BDF8; --bar-good: #4ADE80; --bar-bad: #F87171; --bar-plat: #38BDF8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
  --shadow-primary: none;
  --header-bg: rgba(30, 41, 59, .88); --backdrop: rgba(2, 6, 23, .65);
  color-scheme: dark;
}
/* smooth switch only while toggling (not on every hover), and never for reduced-motion users */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, fill .3s ease !important;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.75 var(--font-body);
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--teal-soft); color: var(--ink); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--surface); z-index: 10; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.35; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 4.6vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
a { color: var(--link); }
.ic { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap {
  width: 100%; max-width: 1160px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.section { padding-block: 20px; }
.narrow { max-width: 640px; }
.pad { padding: 20px; }
.pad-top { padding-top: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack.gap-sm { gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: minmax(0, 1fr); }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.two > * { min-width: 0; }
.spread { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; line-height: 1.6; }
.block { display: block; }
.center-text { text-align: center; }
.foot-note { margin-top: 12px; }
.lead-ink { font-size: 1.1rem; margin: 10px 0 16px; }

@media (min-width: 560px) { .two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pad { padding: 28px; } }
@media (min-width: 920px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card h2 .ic, .section-head h2 .ic { color: var(--brand); }

/* ---------- header, prototype bar, nav ---------- */
.app-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 12; background: var(--surface); background: var(--header-bg); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.hdr-row { display: flex; align-items: center; gap: 10px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; margin-inline-end: auto; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; color: var(--ink); letter-spacing: -.01em; }
.brand-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(145deg, var(--brand), var(--accent)); color: #FFFFFF; box-shadow: var(--shadow-primary); }
:root[data-theme="dark"] .brand-mark { color: #0F172A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-mark { color: #0F172A; } }
.brand-mark.lg { width: 66px; height: 66px; border-radius: 20px; margin-bottom: 10px; }
.desk-nav { display: none; gap: 4px; }
.desk-link { background: none; border: 0; padding: 8px 14px; border-radius: 12px; font-weight: 600; min-height: 44px; color: var(--ink-soft); transition: background .15s, color .15s; }
.desk-link:hover { background: var(--surface-2); color: var(--ink); }
.desk-link.on { background: var(--info-soft); color: var(--link); }
.role-chip { background: var(--teal-soft); color: var(--teal-ink); font-weight: 700; padding: 4px 14px; border-radius: 999px; font-size: .9rem; border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.icon-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: background .15s, border-color .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.theme-btn { color: var(--brand); }
.theme-btn .ic { transition: transform .35s var(--ease); }
.theme-btn:active .ic { transform: rotate(-30deg) scale(.9); }

.proto-bar { background: var(--teal-soft); border-bottom: 1px solid var(--line); font-size: .92rem; }
.proto-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 10px; }
.proto-row p { display: flex; gap: 8px; align-items: center; color: var(--teal-ink); font-weight: 600; line-height: 1.5; }
.proto-switch { display: flex; align-items: center; gap: 10px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 2px; max-width: 100%; }
.seg button { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: transparent; font-weight: 600; }
.seg button.on { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-primary); }

.main { min-height: 60vh; }
.app-footer { background: var(--surface-2); color: var(--ink-soft-2); border-top: 1px solid var(--line); font-size: .9rem; padding-top: 22px; padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); margin-top: 24px; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -4px 24px rgba(15, 23, 42, .06);
  background: var(--header-bg); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
.bn-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding-top: 6px; padding-bottom: 6px; }
.bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; background: none; border: 0; border-radius: 14px; font-size: .78rem; font-weight: 600; color: var(--ink-soft); padding: 4px 2px; line-height: 1.3; transition: color .15s, background .15s; }
.bn-item:hover { color: var(--ink); }
.bn-item span { max-width: 100%; text-align: center; }
.bn-item.on { color: var(--link); background: var(--info-soft); font-weight: 700; }
@media (min-width: 920px) {
  .bottom-nav { display: none; }
  .desk-nav { display: flex; }
  .brand { margin-inline-end: 12px; }
  .hdr-row .role-chip { margin-inline-start: auto; }
  .app-footer { padding-bottom: 28px; }
}

.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: var(--backdrop); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; background: var(--surface); color: var(--ink);
  border-radius: 24px 24px 0 0; padding-top: 18px; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-lg); animation: up .25s var(--ease);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@keyframes up { from { transform: translateY(24px); opacity: .4; } }
.sheet-panel::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--line-strong); opacity: .5; margin: -6px auto 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sheet-item { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: start; font-weight: 600; transition: background .15s, border-color .15s; }
.sheet-item:hover { background: var(--surface-2); }
.sheet-item .ic { color: var(--brand); }
.sheet-item.on { background: var(--info-soft); color: var(--link); border-color: var(--link); }
.sheet-role { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; align-items: flex-start; }
@media (min-width: 920px) {
  .sheet-panel { left: auto; right: auto; inset-inline-end: 24px; top: calc(76px + env(safe-area-inset-top, 0px)); bottom: auto; width: 440px; border-radius: 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: fade .2s ease; }
  .sheet-panel::before { display: none; }
}

.toast-host { position: fixed; left: 0; right: 0; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--toast-bg); color: var(--toast-ink); padding: 12px 18px; border-radius: 16px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: 100%; animation: pop .25s var(--ease); border-inline-start: 4px solid var(--brand); }
.toast.err { background: var(--danger-btn); color: #fff; border-inline-start-color: #7F1D1D; }
@media (min-width: 920px) { .toast-host { bottom: 28px; } }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: var(--radius-md); border: 2px solid transparent; font-weight: 700; font-size: 1.02rem; line-height: 1.3; text-align: center; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-primary); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); border-color: var(--link); border-color: color-mix(in srgb, var(--link) 55%, var(--line)); color: var(--link); }
.btn-secondary:hover:not(:disabled) { background: var(--info-soft); border-color: var(--link); }
.btn-ghost { background: transparent; color: var(--ink-soft-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--danger-btn); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #B91C1C; }
.btn-light { background: #fff; color: #0F766E; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.btn-light:hover { background: #F0FDFA; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .75); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .12); }
.btn-lg { min-height: 60px; font-size: 1.12rem; padding: 0 28px; }
.btn.sm { min-height: 44px; padding: 0 16px; font-size: .95rem; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.actions.center { justify-content: center; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--link); font-weight: 700; min-height: 44px; padding: 0; }
.link-btn.back { margin-bottom: 10px; }
.link-btn.back .ic { transform: rotate(180deg); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 700; }
.hint { color: var(--ink-soft); font-size: .9rem; line-height: 1.5; }
.err { color: var(--bad); font-weight: 600; font-size: .93rem; }
.input { width: 100%; min-height: 52px; padding: 10px 14px; border-radius: var(--radius-md); border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--ink-soft); opacity: .8; }
select.input { cursor: pointer; }
textarea.input { resize: vertical; line-height: 1.6; }
.input.sm { min-height: 44px; width: auto; padding: 6px 10px; }
.input.ltr { direction: ltr; text-align: right; }
.input:hover:not(:disabled) { border-color: var(--ink-soft); }
.input:focus-visible, .input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--ring); }
.input:disabled { opacity: .55; }
.has-err .input { border-color: var(--bad); }
.has-err .input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 20%, transparent); }
.inline-field { display: flex; flex-direction: column; gap: 6px; }
.inline-field label { font-weight: 700; font-size: .95rem; }

.search { position: relative; }
.search > .ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.search .input { padding-inline-start: 46px; }
.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; transition: background .15s, border-color .15s, color .15s; }
button.chip:hover:not(.on) { border-color: var(--brand); color: var(--link); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips.static .chip { min-height: 36px; font-size: .9rem; cursor: default; }
.chip.ok { background: var(--good-soft); border-color: transparent; color: var(--good); }
.chip.miss { background: var(--bad-soft); border-color: transparent; color: var(--bad); }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-block: 6px 10px; margin-block: 8px 12px; scrollbar-width: thin; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft-2); font-weight: 700; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.tab:hover:not(.on) { border-color: var(--brand); color: var(--link); }
.tab.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-primary); }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--info-soft); color: var(--link); font-size: .85rem; }
.tab.on .count { background: color-mix(in srgb, var(--accent-ink) 22%, transparent); color: var(--accent-ink); }

.switch { position: relative; flex: none; width: 56px; height: 32px; border-radius: 999px; border: 0; background: var(--line-strong); padding: 0; transition: background .15s; }
.switch span { position: absolute; top: 4px; inset-inline-start: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.switch.on { background: var(--accent); }
.switch span { box-shadow: 0 1px 3px rgba(15, 23, 42, .3); }
.switch.on span { inset-inline-start: 28px; }

.check-group { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 16px; margin: 0; display: grid; gap: 2px; min-width: 0; }
.check-group legend { font-weight: 700; padding-inline: 6px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }

.role-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
.role-pick legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.role-card { display: flex; align-items: center; gap: 14px; text-align: start; padding: 14px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); transition: border-color .15s, background .15s; }
.role-card:hover { border-color: var(--brand); }
.role-card.on { border-color: var(--link); background: var(--info-soft); }

/* ---------- badges, notices, empty ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .88rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-info { background: var(--info-soft); color: var(--link); }
.b-good { background: var(--good-soft); color: var(--good); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-sample { background: var(--surface-2); color: var(--ink-soft); border: 1px dashed var(--line-strong); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-md); line-height: 1.6; border: 1px solid transparent; border-inline-start-width: 4px; }
.notice strong { display: block; }
.notice p { color: var(--ink); }
.n-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--brand) 25%, transparent); border-inline-start-color: var(--brand); } .n-info > .ic { color: var(--link); }
.n-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--bar-warn) 30%, transparent); border-inline-start-color: var(--bar-warn); } .n-warn > .ic { color: var(--warn); }
.n-good { background: var(--good-soft); border-color: color-mix(in srgb, var(--bar-good) 30%, transparent); border-inline-start-color: var(--bar-good); } .n-good > .ic { color: var(--good); }
.n-bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bar-bad) 30%, transparent); border-inline-start-color: var(--bar-bad); } .n-bad > .ic { color: var(--bad); }

.empty { text-align: center; padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ic { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 24px; background: var(--teal-soft); color: var(--teal-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 20%, transparent); margin-bottom: 4px; }
.empty p { color: var(--ink-soft); max-width: 28rem; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.page-head p { margin-top: 4px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }

/* ---------- hero & home ---------- */
.hero { position: relative; overflow: hidden; background: var(--hero-bg); background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--hero-accent) 18%, transparent), transparent 60%), linear-gradient(160deg, var(--hero-bg), var(--hero-bg-2)); color: var(--hero-ink); padding-block: 36px 52px; }
.hero-pulse { position: absolute; inset-inline: 0; bottom: 14px; width: 100%; height: 90px; opacity: .55; pointer-events: none; }
.hero-pulse path { stroke: var(--hero-accent); }
.hero-grid { position: relative; display: grid; gap: 28px; align-items: center; }
.hero-copy { min-width: 0; }
.eyebrow { color: var(--hero-accent); font-weight: 700; margin-bottom: 8px; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 5.4vw, 3rem); line-height: 1.3; }
.lead { margin-top: 14px; font-size: 1.12rem; color: rgba(255, 255, 255, .9); max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-card { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 24px; padding: 22px; min-width: 0; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hero-card h2 { color: #fff; margin-bottom: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps p { color: rgba(255, 255, 255, .82); font-size: .95rem; line-height: 1.55; }
.step-n { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: var(--hero-accent); color: #134E4A; font-family: var(--font-display); font-weight: 800; }
@media (min-width: 860px) { .hero { padding-block: 56px 72px; } .hero-grid { grid-template-columns: 1.25fr 1fr; gap: 48px; } }

.svc-ic { flex: none; display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; background: var(--teal-soft); color: var(--teal-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent); }
.svc-ic.lg { width: 76px; height: 76px; border-radius: 24px; margin-bottom: 14px; }
.svc-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: start; padding: 18px; font-weight: 400; color: var(--ink); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.svc-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow-lg); }
.svc-row { transition: border-color .2s, box-shadow .2s; }
.svc-row:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.svc-card strong { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.4; }
.svc-row { display: flex; gap: 16px; padding: 18px; align-items: flex-start; }
.svc-body { min-width: 0; flex: 1; }
.svc-body h3 { margin-bottom: 4px; }
.price { font-family: var(--font-display); font-weight: 700; color: var(--link); font-size: 1.1rem; }
.price small { font-family: var(--font-body); font-weight: 500; font-size: .85rem; color: var(--ink-soft); }
.big-price { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; color: var(--link); line-height: 1.3; margin-block: 4px; }

.detail-grid, .form-grid { display: grid; gap: 18px; align-items: start; }
.detail-grid > *, .form-grid > * { min-width: 0; }
@media (min-width: 900px) {
  .detail-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .sticky-card { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); }
}
.mini-details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.mini-details summary { cursor: pointer; font-weight: 700; color: var(--link); min-height: 44px; display: flex; align-items: center; }
.mini-details .split { margin-top: 10px; }

.facts { display: grid; gap: 12px; margin: 14px 0; }
.facts > div { min-width: 0; }
.facts dt { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: .9rem; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
@media (min-width: 600px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-block: 12px; }
.split > div { background: var(--surface-2); border-radius: var(--radius-md); padding: 12px 14px; min-width: 0; }
.split span { display: block; font-size: .88rem; color: var(--ink-soft-2); line-height: 1.5; }
.split strong { font-family: var(--font-display); font-size: 1.2rem; }

.success { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.success .notice { text-align: start; }
.ok-ic { display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--good-soft); color: var(--good); }

/* ---------- bookings ---------- */
.booking { padding: 18px; }
.bk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.timeline { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 6px; padding: 0; }
.timeline li { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--ink-soft); }
.timeline .dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); color: #fff; }
.timeline li.done { color: var(--ink); }
.timeline li.done .dot { background: var(--good); border-color: var(--good); }
.timeline li.now { color: var(--ink); font-weight: 700; }
.timeline li.now .dot { border-color: var(--link); background: var(--info-soft); color: var(--link); }
.tl-cancel { display: flex; align-items: center; gap: 8px; color: var(--bad); font-weight: 600; margin-top: 12px; }
.note-line { display: flex; gap: 8px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: .93rem; }
.review { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.review p { margin-top: 4px; }
.review-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars .ic.on { color: var(--star); fill: var(--star); }
.stars .ic.off { color: var(--line-strong); }
.star-btn { background: none; border: 0; padding: 4px; border-radius: 10px; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.star-btn.on { color: var(--star); } .star-btn.on .ic { fill: var(--star); }
.star-btn.off { color: var(--line-strong); }
.confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--bad-soft); border-radius: 14px; padding: 12px; margin-top: 14px; }
.confirm-row strong { flex-basis: 100%; }
.admin-actions { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------- dashboards ---------- */
.nurse-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.nurse-head.tight { padding: 0; }
.avatar { flex: none; display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 22px; background: linear-gradient(145deg, var(--brand), var(--accent)); color: var(--accent-ink); box-shadow: var(--shadow-primary); font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; }
.nurse-head .actions { margin-top: 0; }

.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-block: 16px; }
.stat { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; box-shadow: var(--shadow); }
.stat::after { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 0; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); opacity: .85; }
.stat span { display: block; color: var(--ink-soft); font-size: .88rem; line-height: 1.5; }
.stat strong { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 1.55rem; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--ink); }
.tile-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; box-shadow: var(--shadow); transition: border-color .2s; }
.tile:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.tile strong { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile-l { color: var(--ink-soft); font-size: .88rem; line-height: 1.5; }
.tile-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--teal-soft); color: var(--teal-ink); }
.tile.warn .tile-ic { background: var(--warn-soft); color: var(--warn); }
@media (min-width: 760px) { .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
th { background: var(--surface-2); color: var(--ink-soft-2); font-weight: 700; font-size: .88rem; white-space: nowrap; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-3); }
tbody tr:last-child td { border-bottom: 0; }
.pos { color: var(--good); font-weight: 700; }

.day-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-block: 6px; border-bottom: 1px solid var(--line); }
.day-row strong { min-width: 84px; }
.day-row.off strong { color: var(--ink-soft); }
.svc-toggle { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.doc-list li > span:first-child { display: inline-flex; align-items: center; gap: 8px; }

.svc-admin { display: flex; flex-direction: column; gap: 10px; }
.svc-admin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.svc-admin-row.off { opacity: .6; }
.svc-admin-row .grow { flex-basis: 220px; }
.price-edit { display: flex; align-items: center; gap: 8px; width: 170px; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 36px; align-items: center; gap: 10px; }
.bar-row strong { font-variant-numeric: tabular-nums; text-align: end; }
.bar-track { height: 16px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; min-width: 4px; }
.bar-fill.warn { background: var(--bar-warn); } .bar-fill.info { background: var(--bar-info); }
.bar-fill.good { background: var(--bar-good); } .bar-fill.bad { background: var(--bar-bad); }
.share-bar { display: flex; height: 20px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.share-bar span { height: 100%; }
.nurse-part { background: var(--teal); }
.plat-part { background: var(--bar-plat); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .92rem; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-inline-end: 8px; vertical-align: -2px; }

/* ---------- support ---------- */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { padding: 0; }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 58px; padding: 10px 18px; font-weight: 700; cursor: pointer; border-radius: var(--radius); }
.faq summary:hover { color: var(--link); }
.faq-chev { color: var(--brand); }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { padding: 0 18px 16px; color: var(--ink-soft); }
.faq-chev { transition: transform .15s; }
.faq details[open] .faq-chev { transform: rotate(-90deg); }
.ticket { border-top: 1px solid var(--line); padding-top: 10px; }

@media (prefers-reduced-motion: reduce) { *, .theme-anim, .theme-anim * { transition: none !important; animation: none !important; } .btn-primary:hover:not(:disabled), .svc-card:hover { transform: none; } }

/* ---------- loading / auth additions ---------- */
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 36px 16px; color: var(--ink-soft); font-weight: 600; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--teal-soft); border-top-color: var(--brand); animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.notice .btn { margin-top: 8px; }
.bell { position: relative; }
.bell-dot { position: absolute; top: 4px; inset-inline-start: 4px; box-shadow: 0 0 0 2px var(--surface); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--danger-btn); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.notif { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif.unread strong::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-inline-end: 8px; }
.setup { max-width: 640px; margin: 40px auto; }
.pw-wrap { position: relative; }
.link-inline { background: none; border: 0; color: var(--link); font-weight: 700; padding: 0; min-height: 44px; text-decoration: underline; }

/* ---------- narrow Android phones (<= 380px): keep the header on one row without horizontal scroll ---------- */
@media (max-width: 380px) {
  .hdr-row { gap: 6px; }
  .brand { gap: 6px; min-width: 0; }
  .brand-name { font-size: 1.2rem; }
  .brand-mark { width: 38px; height: 38px; }
  .role-chip { padding: 3px 9px; font-size: .78rem; white-space: nowrap; }
  .hdr-row .icon-btn { width: 44px; height: 44px; }
}

/* nurse verification documents */
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-row { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); min-width: 0; }
.doc-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-actions a.btn, .doc-actions label.btn { text-decoration: none; }
label.btn.disabled { opacity: .55; pointer-events: none; }
input.sr:focus-visible + .btn, .doc-actions:focus-within label.btn { outline: 3px solid var(--focus, #1a5fb4); outline-offset: 2px; }
/* commission payment (InstaPay) */
.pay-box { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; overflow-wrap: anywhere; }
.pay-box p { margin: 0; }
/* supplies with a request */
.supplies { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.supplies h4 { display: flex; align-items: center; gap: 6px; margin: 0; }
.sup-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.sup-pick { display: grid; gap: 8px; }
.sup-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sup-row label { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.sup-row select { width: 90px; }
/* name + switch rows that wrap on narrow phones (admin supplies) */
.toggle-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; }
.toggle-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.toggle-list li:first-child { border-top: 0; }
.toggle-list .tl-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.toggle-list li.off .tl-name { opacity: .6; }
/* bidding */
.offers { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.offers h4 { display: flex; align-items: center; gap: 6px; margin: 0; }
.offer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.offer { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; display: grid; gap: 4px; overflow-wrap: anywhere; background: var(--surface); transition: border-color .15s; }
.offer:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.offer.off { opacity: .6; }
.offer p { margin: 0; }
.offer-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.min-edit { display: flex; align-items: center; gap: 8px; }
.min-edit .input { width: 100px; }
/* bidding minimum rows: on narrow phones put the price box under the service name (seen squeezed on a real phone) */
.toggle-list li:has(.min-edit) { flex-wrap: wrap; }
.toggle-list li:has(.min-edit) .tl-name { flex: 1 1 160px; }

/* legal pages + footer links */
.legal-list { margin: 0; padding-inline-start: 1.25rem; display: grid; gap: 8px; }
.legal-list li { line-height: 1.8; }
.legal p { line-height: 1.9; }
.footer-links { margin-top: 4px; }
.footer-links .link-inline { color: var(--link); }

/* CAPTCHA (Cloudflare Turnstile) */
.captcha { display: grid; gap: 6px; min-height: 65px; }
.captcha-box { max-width: 100%; overflow: hidden; }

/* page titles + section headings get the brand accent */
.page-head h1 { letter-spacing: -.01em; }
.price, .big-price { color: var(--link); }
.ltr-inline { direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; font-size: .88rem; }

/* GPS: map + live trip */
.trip { border-top: 1px solid var(--line); padding-top: 12px; }
.trip h4 { display: flex; align-items: center; gap: 6px; margin: 0; }
.trip h4 .ic, .ok-inline { color: var(--brand); vertical-align: -3px; }
.map-box { position: relative; height: 240px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); isolation: isolate; }
.map-canvas { position: absolute; inset: 0; }
.map-box .leaflet-container { font-family: var(--font-body); background: var(--surface-2); }
.map-tip { font-family: var(--font-body); font-weight: 700; font-size: .85rem; direction: rtl; border-radius: 10px; padding: 2px 8px; }
:root[data-theme="dark"] .map-box .leaflet-tile { filter: brightness(.82) saturate(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .map-box .leaflet-tile { filter: brightness(.82) saturate(.9); } }
.map-fallback { padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-md); }
.live { display: grid; gap: 10px; }
.live-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; line-height: 1.6; }
.eta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0; padding: 8px 10px; border-radius: 12px; background: var(--brand-soft, rgba(15,118,110,.08)); line-height: 1.6; }
.live-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); animation: livepulse 1.8s ease-out infinite; margin-inline-end: 4px; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.warn-text { color: var(--warn); font-weight: 600; }
a.btn { text-decoration: none; }
.notice > div { min-width: 0; overflow-wrap: anywhere; }
.price-label { margin-bottom: -6px; }

/* chat */
.chat { border-top: 1px solid var(--line); padding-top: 10px; }
.chat-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 12px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 700; text-align: start; }
.chat-toggle:hover { border-color: var(--brand); }
.chat-toggle .ic { color: var(--brand); }
.chat-toggle > span:first-of-type { flex: 1; }
.chat-count { background: var(--danger-btn); color: #fff; }
.chat-chev { transform: rotate(-90deg); transition: transform .2s; }
.chat-chev.up { transform: rotate(90deg); }
.chat-box { background: var(--surface-2); border-radius: var(--radius-md); padding: 10px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; padding: 4px; }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 16px; line-height: 1.6; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.bubble p { white-space: pre-wrap; }
.bubble.mine { align-self: flex-start; background: var(--accent); color: var(--accent-ink); border-end-start-radius: 4px; }
.bubble.theirs { align-self: flex-end; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-end-end-radius: 4px; }
.bubble-who { display: block; font-size: .78rem; font-weight: 700; color: var(--link); }
.bubble-time { display: block; font-size: .75rem; opacity: .75; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 52px; resize: none; }
.chat-form .btn { flex: none; }
.chat-empty { text-align: center; padding: 10px; }
.contact-links { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.admin-locs .legal-list { gap: 4px; }

/* ---------- phone notifications (push) */
.push-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--radius-md);
  background: var(--info-soft); border: 1px solid var(--line); min-width: 0; }
.push-card h3 { font-size: 1.02rem; margin: 0; }
.push-card .push-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.push-card .push-body p { margin: 0; overflow-wrap: anywhere; }
.push-card .push-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: linear-gradient(145deg, var(--brand), var(--accent)); color: #FFFFFF; }
:root[data-theme="dark"] .push-card .push-ic { color: #0F172A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .push-card .push-ic { color: #0F172A; } }
.push-card.on { align-items: center; background: var(--good-soft); color: var(--ink); }
.push-card.on > .ic { color: var(--good); flex: none; }
.push-card.on p { margin: 0; }
.push-card .actions { margin: 0; }
.sheet-panel .push-card { margin: 0 0 12px; }

/* ---------- chat side panel (opens from the top of the booking card) */
.booking > .chat { border-top: 0; padding-top: 0; margin-bottom: 4px; }
.drawer { position: fixed; inset: 0; z-index: 45; }
.drawer-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: var(--backdrop); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s ease; }
.drawer-panel { position: absolute; inset-block: 0; inset-inline-start: 0; width: min(440px, 100%); display: flex; flex-direction: column;
  background: var(--surface); box-shadow: 0 0 40px rgba(15, 23, 42, .25); animation: drawer-in .22s ease; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.15rem; margin: 0; }
.drawer-head p { margin: 2px 0 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 14px; background: var(--surface-2); min-height: 0; }
.drawer-body .chat-list { max-height: none; overflow: visible; }
.drawer-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); gap: 8px; }
.drawer-foot p { margin: 0; }
body.no-scroll { overflow: hidden; }

/* ---------- opened from a notification: the request card flashes */
.card.flash { box-shadow: 0 0 0 3px var(--brand), var(--shadow-primary, 0 8px 24px rgba(13, 148, 136, .25)); transition: box-shadow .3s; }
button.notif { display: block; width: 100%; text-align: start; background: none; border: 0; border-bottom: 1px solid var(--line); color: inherit; font: inherit; cursor: pointer; }
button.notif:hover, button.notif:focus-visible { background: var(--surface-2); }

/* ---------- tabs in rows (owner, 6 Nov): every tab visible, no sideways swiping */
.tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); overflow: visible; }
.tab { justify-content: center; width: 100%; min-width: 0; padding: 0 12px; border-radius: var(--radius-md); white-space: normal; text-align: center; line-height: 1.3; }
.install-steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- «طريقة الاستخدام» + install at the top of the pages */
.top-help { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; min-width: 0; }
.top-help .push-card { margin: 0; }
.home-top { padding-top: 14px; margin-bottom: 14px; }
.guide-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--good-soft); border: 1px solid var(--line); color: var(--ink); font: inherit; cursor: pointer; min-height: 56px; }
.guide-banner .grow { display: flex; flex-direction: column; min-width: 0; }
.guide-banner strong { font-size: 1.02rem; }
.guide-banner > .ic:last-child { color: var(--muted); flex: none; }
.guide-banner:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.guide-step { display: flex; gap: 12px; padding: 14px 16px; align-items: flex-start; min-width: 0; }
.guide-step h2 { font-size: 1.05rem; margin: 0 0 4px; display: flex; align-items: center; gap: 6px; color: var(--accent); }
.guide-step p { margin: 0; overflow-wrap: anywhere; }
.guide-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(145deg, var(--brand), var(--accent)); color: #FFFFFF; }
:root[data-theme="dark"] .guide-n { color: #0F172A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .guide-n { color: #0F172A; } }
.guide-banner .push-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: linear-gradient(145deg, var(--brand), var(--accent)); color: #FFFFFF; }
:root[data-theme="dark"] .guide-banner .push-ic { color: #0F172A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .guide-banner .push-ic { color: #0F172A; } }
.notice-gps { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bad-soft, #FEE2E2); color: var(--bad); border: 1px solid var(--bad); }
.notice-gps span { color: var(--ink); font-size: .93rem; }
.delivery-card h2 { font-size: 1.05rem; margin: 0 0 6px; display: flex; align-items: center; gap: 6px; color: var(--good); }
.delivery-card.late h2 { color: var(--warn); }
.delivery-card.late { border-color: var(--warn); background: var(--warn-soft); }
.delivery-card p, .delivery-card ul { margin: 4px 0; }
.delivery-card ul { padding-inline-start: 20px; }
.withdraw-box { flex-direction: column; align-items: stretch; }

/* ---------- password field with show / hide (eye) */
.pw-wrap { position: relative; display: block; }
.pw-wrap .pw-input { padding-right: 52px; }
.pw-toggle { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); cursor: pointer; }
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--brand); }
.pw-toggle:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.late-cancel { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); margin-top: 6px; }
.late-cancel.admin { border: 1px solid var(--warn); }
.late-cancel strong { display: flex; align-items: center; gap: 6px; color: var(--warn); }
p.late-cancel { flex-direction: row; align-items: center; margin: 6px 0 0; }
.quote-box { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--info-soft); border: 1px solid var(--line); }
.quote-line { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.guide-devices { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.guide-devices h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: 6px; color: var(--accent); }
.guide-devices p { margin: 0; }
.guide-dev { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.guide-dev h3 { font-size: .98rem; margin: 0 0 4px; }
.guide-dev ul { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.chat-img { display: block; max-width: 220px; max-height: 260px; width: 100%; object-fit: cover; border-radius: 10px; margin: 2px 0 4px; }
.chat-img-link { display: inline-block; }
.chat-img-wait { display: block; padding: 6px 0; }
.chat-form .chat-cam { flex: none; min-width: 48px; padding-inline: 10px; }

/* ---------- in-app voice call */
.drawer-head .call-start { margin-inline-start: auto; }
.call-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: var(--backdrop); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.call-card { width: min(380px, 100%); background: var(--surface); border-radius: var(--radius); padding: 24px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.call-card h2 { margin: 6px 0 0; font-size: 1.2rem; }
.call-avatar { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand), var(--accent)); color: #FFFFFF; }
.call-timer { font-size: 1.4rem; font-weight: 700; margin: 0; direction: ltr; }
.call-note { margin: 0; font-weight: 600; }
.call-actions { display: flex; gap: 22px; margin: 12px 0 4px; }
.call-btn { width: 72px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.call-btn .ic { width: 60px; height: 60px; padding: 15px; border-radius: 50%; color: #FFFFFF; }
.call-btn.ok .ic { background: #16A34A; }
.call-btn.end .ic { background: #DC2626; transform: rotate(135deg); }
.call-btn.mute .ic { background: var(--line-strong); color: var(--ink); }
.call-btn.mute.on .ic { background: var(--warn); color: #FFFFFF; }
.call-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 12px; }

/* ---------- welcome: «أنا مريض» / «أنا ممرض» */
.welcome { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.welcome-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.welcome-head h1 { margin: 6px 0 0; }
.welcome-head p { margin: 0; }
.welcome-choices { display: grid; gap: 12px; }
@media (min-width: 640px) { .welcome-choices { grid-template-columns: 1fr 1fr; } }
.welcome-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px; border-radius: var(--radius);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; text-align: center; min-height: 150px; }
.welcome-choice strong { font-size: 1.15rem; }
.welcome-choice span:last-child { color: var(--ink-soft); }
.welcome-choice:hover, .welcome-choice:focus-visible { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--info-soft); }
.wc-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand), var(--accent)); color: #FFFFFF; }
.welcome-choice.nurse .wc-ic { background: linear-gradient(145deg, #2563EB, #1D4ED8); }
:root[data-theme="dark"] .wc-ic { color: #0F172A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wc-ic { color: #0F172A; } }
.auth-side { margin: 6px 0 0; font-weight: 700; color: var(--accent); }
.auth-nurse .auth-side { color: #2563EB; }

/* nurse: «تنبيه هام: لازم توثّق حسابك» at the very top until verified (owner, 7 Nov) */
.verify-alert { margin-bottom: 14px; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--warn); background: var(--warn-soft); color: var(--warn); }
.verify-alert h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.15rem; color: var(--warn); }
.verify-alert p { margin: 4px 0; }
.verify-alert ul { margin: 4px 0 8px; padding-inline-start: 22px; }
.verify-alert .actions { margin-top: 8px; }

/* ---------------------------------------------------------------- nursing services catalog (owner, 7 Nov) */
.pad-bottom { padding-bottom: 14px; }
.cat-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: 1fr 1fr 1fr; } }
.cat-card { display: flex; align-items: center; gap: 14px; padding: 16px; text-align: start; color: var(--ink); font-weight: 400; min-width: 0; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.cat-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow-lg); }
.cat-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.cat-text strong { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.4; }
.cat-count { align-self: flex-start; margin-top: 4px; font-size: .85rem; font-weight: 700; color: var(--teal-ink); background: var(--teal-soft); border-radius: 999px; padding: 2px 10px; }
.cat-go { flex: none; color: var(--muted); }
.cat-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; }
.cat-head h1 { margin: 0; }
.cat-head .svc-ic.lg { margin: 0; }
.svc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; font-size: .92rem; color: var(--muted); }
.svc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.svc-meta .rx { color: var(--warn); font-weight: 700; }
.price-line { font-weight: 700; color: var(--teal-ink); margin: 6px 0; }
.price-line.big { font-size: 1.25rem; line-height: 1.5; margin: 0; }
.svc-title { display: flex; align-items: center; gap: 14px; }
.svc-title h1 { margin: 0; }
.svc-title .svc-ic.lg { margin: 0; }
.ltr-inline { direction: ltr; unicode-bidi: isolate; text-align: start; }
.svc-sec h2 { display: flex; align-items: center; gap: 8px; font-size: 1.08rem; margin: 6px 0 4px; color: var(--teal-ink); }
.svc-sec p { margin: 0; line-height: 1.8; }
.svc-sec.warn { background: var(--warn-soft); border-radius: 14px; padding: 12px 14px; }
.svc-sec.warn h2 { color: var(--warn); }
.supply-list { margin: 4px 0 6px; padding-inline-start: 22px; line-height: 1.9; }
.emergency-box { border: 2px solid var(--bad); background: var(--bad-soft); color: var(--bad); border-radius: 16px; padding: 14px 16px; }
.emergency-box h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.1rem; color: var(--bad); }
.emergency-box ul { margin: 4px 0 10px; padding-inline-start: 22px; line-height: 1.8; color: var(--ink); }
.emergency-box.compact { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.emergency-box.compact h2 { margin: 0; }
.rx-confirm { border: 1.5px solid var(--warn); background: var(--warn-soft); border-radius: 14px; padding: 12px 14px; }
.rx-confirm label { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; line-height: 1.6; }
.rx-confirm input { width: 22px; height: 22px; flex: none; margin-top: 3px; }
.rx-confirm.has-err { border-color: var(--bad); }
.svc-picker { display: flex; flex-direction: column; gap: 8px; }
.pick-cat { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.pick-cat > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 700; list-style: none; min-height: 48px; }
.pick-cat > summary::-webkit-details-marker { display: none; }
.pick-cat[open] > summary { border-bottom: 1px solid var(--line); }
.pick-n { font-size: .85rem; color: var(--muted); background: var(--bg-soft, rgba(0,0,0,.05)); border-radius: 999px; padding: 2px 10px; }
.pick-n.on { color: var(--teal-ink); background: var(--teal-soft); }
.pick-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.pick-body > .btn { align-self: flex-start; }
.pick-body .svc-toggle { align-items: flex-start; }
.pick-body .svc-toggle .grow { min-width: 0; line-height: 1.6; }
.block { display: block; }
.cat-svc { border-top: 1px solid var(--line); padding-top: 8px; }
.cat-svc.off .cat-svc-row .grow, .pick-cat.off > summary { opacity: .6; }
.cat-svc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cat-svc-row .grow { flex: 1 1 180px; line-height: 1.6; }
.svc-editor { border: 1px dashed var(--line); border-radius: 14px; padding: 12px; margin-top: 8px; }
.add-row { display: flex; gap: 8px; align-items: center; }
.add-row .input { flex: 1; min-width: 0; }
.boost { border: 1.5px solid color-mix(in srgb, #F59E0B 55%, var(--line)); background: color-mix(in srgb, #F59E0B 9%, var(--card)); }
.boost.on { border-color: var(--good); background: var(--good-soft); }
.boost h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.12rem; }
.boost h2 .ic { color: #D97706; }
.boost p { margin: 4px 0; line-height: 1.8; }
/* nurse weekly hours (owner, 8 Nov): one clear row per day */
.week { display: flex; flex-direction: column; gap: 8px; }
.wk-day { display: grid; grid-template-columns: 76px auto 1fr; align-items: center; gap: 8px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.wk-day.off { background: var(--surface-2); }
.wk-name { font-size: 1.05rem; }
.wk-day.off .wk-name { color: var(--ink-soft); }
.wk-hours { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.wk-hours label { font-weight: 700; color: var(--ink-soft); }
.wk-hours .input.sm { width: auto; min-width: 0; flex: 1 1 88px; max-width: 130px; }
.wk-off { color: var(--ink-soft); font-weight: 700; }
@media (max-width: 380px) { .wk-day { grid-template-columns: 70px auto; } .wk-hours, .wk-off { grid-column: 1 / -1; } }
.push-on-note { margin: 0 0 4px; font-size: .82rem; }

/* nurse profile photo (8 Nov) */
.avatar-photo { object-fit: cover; padding: 0; background: var(--surface-2); }
.avatar-sm { width: 40px; height: 40px; border-radius: 14px; font-size: 1.05rem; }
.avatar-md { width: 68px; height: 68px; border-radius: 22px; }
.avatar-lg { width: 96px; height: 96px; border-radius: 28px; font-size: 2.2rem; }
.photo-row { display: flex; align-items: center; gap: 14px; }
.photo-row h2 { margin: 0 0 4px; }
.offer-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nurse-line { display: inline-flex; align-items: center; gap: 8px; }

/* «بندوّر على ممرض قريب منك» (8 Nov) */
.search-card { margin: 12px 0; padding: 14px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; overflow: hidden; }
.search-card .offers { text-align: start; margin-top: 12px; }
.search-card .actions { justify-content: center; margin-top: 12px; }
.search-title { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; margin: 6px 0 2px; }
.search-live { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin: 4px 0 2px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); animation: tm-blink 1.2s ease-in-out infinite; }
@keyframes tm-blink { 50% { opacity: .25; } }
.search-timer { font-family: var(--font-display); font-weight: 700; color: var(--accent); }
.search-steps { list-style: none; padding: 0; margin: 12px auto 0; max-width: 320px; text-align: start; display: grid; gap: 8px; }
.search-steps li { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.search-steps .ic { width: 24px; height: 24px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-soft); font-size: .8rem; font-weight: 700; }
.search-steps .done .ic { background: var(--good-soft); color: var(--good); }
.search-steps .now { font-weight: 700; }
.search-steps .now .ic { background: var(--teal-soft); color: var(--accent); }
.radar { position: relative; width: min(240px, 70vw); aspect-ratio: 1; margin: 2px auto 4px; }
.radar-map { position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background: linear-gradient(90deg, transparent 47%, var(--line) 47% 49%, transparent 49%),
              linear-gradient(0deg, transparent 62%, var(--line) 62% 64%, transparent 64%),
              linear-gradient(35deg, transparent 30%, var(--line) 30% 31.5%, transparent 31.5%),
              radial-gradient(circle, var(--surface-2), var(--surface)); }
.radar-ring { position: absolute; inset: 50%; border-radius: 50%; border: 2px solid var(--brand); opacity: 0; animation: tm-pulse 3s cubic-bezier(.2,.6,.3,1) infinite; }
.radar-ring:nth-of-type(4) { animation-delay: 1s; } .radar-ring:nth-of-type(5) { animation-delay: 2s; }
@keyframes tm-pulse { 0% { inset: 50%; opacity: .9; } 100% { inset: 0; opacity: 0; } }
.radar-sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 300deg, color-mix(in srgb, var(--brand) 30%, transparent) 360deg); animation: tm-spin 2.6s linear infinite; }
@keyframes tm-spin { to { transform: rotate(360deg); } }
.radar-center { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 20px; z-index: 3;
  background: linear-gradient(145deg, var(--brand), var(--accent)); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-primary); }
.radar-dot { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 11px; z-index: 2; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line); color: var(--ink-soft); opacity: .5; transform: scale(.6); transition: transform .5s, opacity .5s, background .5s; }
.radar-dot.seen { opacity: 1; transform: scale(1); border-color: var(--brand); color: var(--accent); }
.radar-dot.offer { opacity: 1; transform: scale(1.12); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.search-card.matched .avatar-lg { margin: 6px auto 4px; display: grid; }
@media (prefers-reduced-motion: reduce) { .radar-ring, .radar-sweep, .live-dot { animation: none; } .radar-ring { opacity: .3; inset: 20%; } }
.live-dot.idle { background: var(--warn); animation: none; }
.offer-dist { display: flex; align-items: center; gap: 4px; }
.here-box { display: grid; gap: 4px; margin-top: -4px; }
.here-ok { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--good); }
.sent-line { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 0 0 4px; color: var(--good); }
.sent-line .muted { color: var(--ink-soft); }

/* step-by-step walkthrough (8 Nov) */
.tour { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--bg) 92%, transparent); display: grid; place-items: center; padding: 12px; }
.tour-panel { width: min(460px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; outline: none; }
.tour-top { display: flex; justify-content: space-between; align-items: center; }
.tour-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.tour-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s; }
.tour-body { animation: tour-in .3s ease-out; }
@keyframes tour-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.tour-ic { width: 76px; height: 76px; margin: 6px auto 8px; border-radius: 24px; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand), var(--accent)); color: var(--accent-ink); box-shadow: var(--shadow-primary); }
.tour-body h2 { text-align: center; font-family: var(--font-display); font-size: 1.35rem; margin: 0 0 4px; }
.tour-lead { text-align: center; color: var(--ink-soft-2, var(--ink-soft)); margin: 0 0 8px; }
.tour-points { margin: 0; padding: 0 18px 0 0; display: grid; gap: 8px; line-height: 1.75; }
.tour-btn-name { color: var(--accent); white-space: normal; }
.tour-nav { display: flex; gap: 8px; margin-top: 4px; }
.tour-dots { display: flex; justify-content: center; gap: 6px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-dots span.on { background: var(--brand); width: 18px; border-radius: 99px; }
@media (prefers-reduced-motion: reduce) { .tour-body { animation: none; } .tour-bar span { transition: none; } }
.nurse-svc { border-top: 1px solid var(--line); padding-top: 8px; }
.nurse-svc summary { cursor: pointer; font-size: .92rem; padding: 6px 0; }

/* voice messages (8 Nov) */
.chat-form { flex-wrap: wrap; }
.chat-form .chat-mic { flex: none; min-width: 48px; padding-inline: 10px; }
.voice-rec { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; padding: 8px 10px; border-radius: 14px; background: var(--bad-soft, #FBE2DF); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad, #B3261E); animation: tm-blink 1s ease-in-out infinite; }
.rec-time { font-family: var(--font-display); font-weight: 700; }
.chat-audio { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-audio audio { max-width: 220px; height: 36px; }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }

/* tab with a small line under its name (owner, 9 Nov: «مناطق عملي — يمكن تعديلها في أي وقت») */
.tab.has-hint { padding-block: 6px; }
.tab-text { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.25; }
.tab-hint { font-size: .72rem; font-weight: 500; opacity: .85; }

.split > .split-note { grid-column: 1 / -1; margin: 0; }

/* chat composer (owner, 9 Nov): the writing area gets its own full row; tools + send under it; emoji panel */
.chat-form { flex-wrap: wrap; }
.chat-form .chat-text { flex: 1 1 100%; width: 100%; min-height: 84px; font-size: 1.05rem; }
.chat-tools { display: flex; gap: 8px; align-items: center; width: 100%; flex-wrap: wrap; }
.chat-tools .chat-send { margin-inline-start: auto; }
.chat-tools .voice-rec { flex: 1 1 100%; }
.chat-emoji-btn span { font-size: 1.35rem; line-height: 1; }
.chat-emoji-btn.on { background: var(--info-soft); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; width: 100%; padding: 8px; background: var(--surface-2); border-radius: var(--radius-md); }
.emoji-grid .emoji { font-size: 1.5rem; line-height: 1; min-height: 44px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; }
.emoji-grid .emoji:hover, .emoji-grid .emoji:focus-visible { background: var(--surface); }

.supplies-note { display: flex; gap: 6px; align-items: flex-start; background: var(--warn-soft); color: var(--ink); border-radius: var(--radius-md); padding: 8px 12px; margin: 6px 0; }
.chat-tools { flex-wrap: nowrap; }
.chat-tools .chat-cam, .chat-tools .chat-mic { min-width: 44px; padding-inline: 8px; }
.chat-tools .chat-send { padding-inline: 14px; }
.emoji-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); padding: 6px; }
.emoji-grid .emoji { font-size: 1.3rem; padding: 0; min-width: 0; }
/* while recording, only the recording bar (with its own «إلغاء» / «إرسال») shows under the writing area */
.chat-tools:has(.voice-rec) > :not(.voice-rec) { display: none; }
.chat-tools .voice-rec { flex: 1 1 100%; min-width: 0; }
