/* Matern AI. One visual world for the planner, the midwife phone view and the parent page.
   A solid navy rail frames a quiet work area: Cloud ground, hairlines instead of cards, no
   shadows on the planner. In the work area colour has four jobs, each with words or an icon
   beside it: Matern Blue for the one primary action, green for good news (completed, on the
   way, time saved), red for attention (late running, short staffing), and one route colour
   per midwife. Navy is the structure and the ink for headings. Type: Figtree throughout. */
:root {
  --who-w: 268px; /* the name column of the timeline; the time slider uses it too */
  /* Neutrals from the brand: Cloud ground, Ink text, Slate secondary text, Line hairlines. */
  --bg: #f5f8fb; --paper: #fff;
  --ink: #13202f; --ink-2: #4b5a6b; --muted: #5e6b7b;
  --line: #d5dfea; --line-soft: #e6edf4; --ctl: #c5d2e0; --hover: #eef3f8;
  /* Midnight navy: structure, the rail and heading ink. */
  --navy: #14213d; --on-navy-soft: #c9d0de;
  /* Matern Blue: the one primary action on a screen, always with white text (6.4:1).
     Deep Blue is its hover. Mist marks selected rows and calm surfaces; Sky is the track
     and border tint; Ai Blue is for marks on navy, never body text. */
  --blue: #005eb8; --blue-deep: #00468a; --mist: #eaf2fb; --sky: #b4cfea; --ai-blue: #4d8ece;
  /* Green: good news. A state, never a button fill. */
  --good: #1d7a4f; --good-2: #9fd8bd; --good-bg: #e6f4ec; --good-line: #b9dfc9; --good-bright: #4cc68a;
  /* Red: urgent, late, short. Always with an icon and words. */
  --bad: #c0262d; --bad-bg: #fcebec; --bad-line: #f1c0c2; --bad-ink: #8e1b21;
  --grey-pin: #8a96a5;
  /* Figtree throughout, from Google Fonts at 400 to 800. */
  --font: Figtree, Arial, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1); --t: 180ms;
  --gut: 28px; /* page gutter on the planner */
  font-family: var(--font);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--font);
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "ss01" 0; }
h1, h2, p, ol, ul, dl, dd { margin: 0; }
ol, ul { list-style: none; padding: 0; }
small { color: var(--muted); font-size: 12.5px; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tn, b, .fact b, .when, time { font-variant-numeric: tabular-nums; }
::selection { background: var(--sky); }
* { scrollbar-width: thin; scrollbar-color: var(--ctl) transparent; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 4px; }

.ic { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.ic-grip { fill: currentColor; stroke: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
/* A midwife's picture: photo, or initials on her colour. Her colour also rings the photo, so
   the four midwives stay distinguishable when photos are in use. */
.av { position: relative; flex: none; display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%;
  background: var(--c); color: #fff; font: 600 calc(var(--s) * .4)/1 var(--font); letter-spacing: .01em;
  box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px var(--c); overflow: visible; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.team .av, .who .av { box-shadow: none; }
.team .av img, .who .av img { box-shadow: 0 0 0 2px var(--c); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 99px; border: 1px solid var(--ctl); background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color var(--t) var(--ease), opacity var(--t) var(--ease); }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn:disabled { opacity: .55; cursor: default; }
/* A spent primary action (for example "Times sent to parents") goes quiet Mist, not faded blue. */
.btn.primary:disabled, .btn.primary:disabled:hover { opacity: 1; background: var(--mist); border-color: var(--sky); color: var(--ink-2); }

.flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--bad);
  background: var(--bad-bg); border: 1px solid var(--bad-line); border-radius: 99px; padding: 1px 8px 1px 6px; white-space: nowrap; }
.flag .ic { width: 12px; height: 12px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); background: var(--ink); color: #fff;
  padding: 8px 8px 8px 18px; border-radius: 14px; opacity: 0; pointer-events: none; z-index: 2000;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
#toast span { padding: 6px 4px 6px 0; }
#toast button { font: inherit; font-weight: 600; color: var(--ink); background: #fff; border: 0; border-radius: 99px;
  min-height: 36px; padding: 0 14px; cursor: pointer; }
#toast button:focus-visible { outline-color: #fff; }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* ---------- planner shell ---------- */
body.planner #app, .shell { height: 100%; }
.shell { display: flex; }
/* The rail: solid navy with white text. */
.rail { width: 232px; flex: none; background: var(--navy); border-right: 1px solid var(--navy);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.rail :focus-visible { outline-color: #fff; }
.wordmark { display: block; padding: 4px 10px 20px; align-self: flex-start; line-height: 0; border-radius: 6px; }
.wordmark img { display: block; height: 26px; width: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; height: 34px; padding: 0 10px; border-radius: 6px;
  font-weight: 500; color: var(--on-navy-soft); text-decoration: none; transition: background-color var(--t) var(--ease); }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a[aria-current] { background: rgba(255, 255, 255, .16); color: #fff; }
.rail-h { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sky); padding: 24px 10px 6px; }
.team button { display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 10px; border: 0;
  border-radius: 6px; background: none; font: inherit; color: #e8ecf4; text-align: left; cursor: pointer;
  transition: background-color var(--t) var(--ease), opacity var(--t) var(--ease); }
.team button:hover { background: rgba(255, 255, 255, .08); }
.team button[aria-pressed="true"] { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 500; }
.team button.dim { opacity: .45; }
.team .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .ct { color: var(--sky); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.head { height: 60px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 var(--gut); border-bottom: 1px solid var(--line); }
.head h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: var(--navy); }
.head .date { color: var(--muted); }
.actions { margin-left: auto; display: flex; gap: 8px; }

/* Facts row: plain figures, time saved larger at the right. */
.facts { flex: none; display: flex; align-items: flex-end; gap: 40px; height: 92px; padding: 14px var(--gut) 16px; border-bottom: 1px solid var(--line); }
.fact .lbl { display: block; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.fact p { display: flex; align-items: baseline; gap: 8px; }
.fact b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; white-space: nowrap; color: var(--navy); }
.fact small { white-space: nowrap; }
.fact.warn b, .fact.warn small { color: var(--bad); }
.fact b .u { font-family: var(--font); font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.fact.save b .u { font-size: 16px; color: inherit; }
.fact.warn b .u { color: inherit; }
.fact small .ic { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.fact.save { margin-left: auto; text-align: right; }
.fact.save b { font-size: 28px; line-height: 1.15; }
.fact.save p { justify-content: flex-end; }
.fact.save.good b { color: var(--good); }
.fact .note { display: block; }
.fact .info { display: inline-grid; place-items: center; width: 20px; height: 20px; margin: -3px -3px -3px 4px; letter-spacing: 0; padding: 0; border: 0;
  border-radius: 50%; background: none; color: var(--muted); cursor: help; vertical-align: -2px; }
.fact .info:hover, .fact .info:focus-visible { color: var(--blue); }
.drive { background: var(--good); }
.admin { background: var(--good-2); }

.body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- week ---------- */
.week-wrap { flex: 1; overflow: auto; padding: 4px var(--gut) var(--gut); }
.week { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 900px; }
.week th, .week td { padding: 12px 12px; text-align: left; vertical-align: top; font-weight: 400; border-bottom: 1px solid var(--line-soft); }
.week thead th { font-weight: 600; border-bottom-color: var(--line); padding-top: 16px; }
.week thead small { display: block; font-weight: 400; }
.week th[scope="row"] { width: 190px; padding-left: 0; color: var(--ink-2); font-weight: 500; }
.week tr.person th { font-weight: 400; color: var(--ink); }
.week tr.person th .dot { margin-right: 9px; vertical-align: 1px; }
.week tr.person { transition: opacity var(--t) var(--ease); }
.week tr.person.dim { opacity: .4; }
.week tr.person.sel > * { background: var(--mist); }
.week tr.person.sel > .today { background: var(--sky); }
.week tbody tr:nth-child(4) > * { border-bottom-color: var(--line); }
.week td small { display: block; }
.week td.num b { font-size: 16px; font-weight: 600; }
.week .past { color: var(--muted); }
.week .today { background: color-mix(in srgb, var(--mist) 70%, #fff); }
.week thead .today a { display: block; text-decoration: none; }
.week thead .today a small { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--sky); }
.week thead .today a:hover small { text-decoration-color: var(--blue); }
.week td.off, .week td.leave { color: var(--muted); }
.week .flag { margin-top: 6px; white-space: normal; align-items: flex-start; max-width: 100%; border-radius: 12px;
  flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
/* The count wraps below "Short:" as a whole when the column is narrow. */
.week .flag .nw { flex-basis: auto; }
.week .flag .ic { margin-top: 2px; }

/* ---------- plan and live: timeline over map ---------- */
.timeline { flex: none; padding: 2px var(--gut) 8px; border-bottom: 1px solid var(--line); }
.t-row { display: flex; align-items: center; height: 52px; border-top: 1px solid var(--line-soft); transition: opacity var(--t) var(--ease); }
.t-row.t-head { border-top: 0; height: 24px; }
.t-row.dim { opacity: .35; }
.t-row.sel { background: var(--mist); border-radius: 6px; }
.t-row.drop { background: color-mix(in srgb, var(--c) 6%, transparent); outline: 1px dashed var(--c); outline-offset: -1px; border-radius: 6px; }
.t-who { width: var(--who-w); flex: none; display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 12px 0 0;
  background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
.t-who b { font-weight: 500; }
.t-who b, .t-who small { display: block; white-space: nowrap; }
.t-who small.late { display: flex; align-items: center; gap: 5px; color: var(--bad); }
.t-who small.late .ic { width: 12px; height: 12px; }
.t-who[aria-pressed="true"] b { text-decoration: underline; text-underline-offset: 3px; }
.t-track { position: relative; flex: 1; height: 38px;
  background: repeating-linear-gradient(to right, var(--line-soft) 0 1px, transparent 1px 12.5%); border-right: 1px solid var(--line-soft); }
.t-head .t-track { height: 22px; background: none; border: 0; }
.t-hour { position: absolute; top: 4px; transform: translateX(-50%); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-hour:first-child { transform: none; }
.t-hour:last-child { transform: translateX(-100%); }
.t-back { position: absolute; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.t-back i { width: 8px; height: 8px; margin-left: -4px; border-radius: 2px; background: var(--navy); }
.t-back.flip { flex-direction: row-reverse; transform: translate(-100%, -50%); }
.t-back.flip i { margin-left: 0; margin-right: -4px; }
.t-drive { position: absolute; top: 50%; height: 2px; margin-top: -1px; opacity: .5;
  background: repeating-linear-gradient(90deg, var(--c) 0 3px, transparent 3px 6px); }
.t-visit { position: absolute; top: 0; bottom: 0; border-radius: 6px; padding: 3px 7px; overflow: hidden; line-height: 1.3;
  background: color-mix(in srgb, var(--c) 9%, #fff); border: 1px solid color-mix(in srgb, var(--c) 32%, #fff); }
.t-visit[draggable] { cursor: grab; }
.t-visit b, .t-visit small { display: block; white-space: nowrap; overflow: hidden; }
.t-visit:focus-visible { outline-offset: 1px; z-index: 2; }
/* Tooltip for timeline blocks: the same look as the map tooltips. */
.tip { position: fixed; z-index: 2500; max-width: 280px; pointer-events: none; font: 12.5px/1.4 var(--font); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); padding: 6px 9px; }
.tip b { font-weight: 600; }
.t-visit b { font-weight: 500; font-size: 12.5px; }
.t-visit.tight { padding-left: 4px; padding-right: 4px; }
/* A declared delay: a marked gap in the row before the drive, with its length. */
.t-delay { position: absolute; top: 50%; height: 16px; margin-top: -8px; border-radius: 4px; overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--bad-bg) 0 4px, #fff 4px 8px); border: 1px solid var(--bad-line);
  display: grid; place-items: center; font-size: 11.5px; line-height: 1; color: var(--bad); font-variant-numeric: tabular-nums; }
.t-delay span { white-space: nowrap; }
.t-visit small { font-size: 11.5px; color: color-mix(in srgb, var(--c) 30%, var(--ink-2)); }
.t-visit .ic { width: 12px; height: 12px; margin-right: 3px; vertical-align: -1px; }
.t-visit.done { background: color-mix(in srgb, var(--good) 7%, #fff); border-color: color-mix(in srgb, var(--good) 28%, #fff); color: var(--ink-2); }
.t-visit.done .ic { color: var(--good); }
.t-visit.done small { color: var(--muted); }
.t-visit.now { padding: 3px 5px; border-color: var(--c); border-width: 1.5px; background: color-mix(in srgb, var(--c) 14%, #fff); z-index: 1; }
.t-visit.now small { color: var(--ink); font-weight: 500; }

.low { flex: 1; min-height: 0; display: flex; }
.map { flex: 1; min-width: 0; background: #eef0ee; }
.side { width: 340px; flex: none; overflow-y: auto; border-left: 1px solid var(--line); padding: 16px 20px; background: var(--bg); }
.side-h { font-size: 15px; font-weight: 700; color: var(--navy); }
.side-p { font-size: 12.5px; color: var(--muted); margin: 2px 0 10px; }

.tray li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line-soft); cursor: grab; }
.grip { color: var(--muted); display: flex; margin-left: -4px; }
.fam { flex: 1; min-width: 0; }
.fam b { font-weight: 500; }
.fam b, .fam small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 30px; padding: 0 8px 0 10px; font: inherit; font-size: 12.5px;
  font-weight: 500; color: var(--ink); background: var(--paper); border: 1px solid var(--ctl); border-radius: 8px; cursor: pointer; white-space: nowrap; }
.pick:hover, .pick[aria-expanded="true"] { background: var(--hover); }
.pick .chev { flex: none; color: var(--ink-2); }
/* The list a .pick button opens. It sits on the body, above the map and the panels. */
.menu { position: fixed; z-index: 3000; min-width: 168px; padding: 4px; background: var(--paper); border: 1px solid var(--ctl);
  border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .14); font-size: 13px; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 10px; font: inherit; color: var(--ink);
  background: none; border: 0; border-radius: 8px; text-align: left; cursor: pointer; white-space: nowrap; }
.menu button:hover { background: var(--mist); }
.menu button:focus-visible { background: var(--mist); outline: 2px solid var(--navy); outline-offset: -2px; }
.menu button[aria-checked="true"] { font-weight: 500; }
.menu .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.menu .tick { margin-left: auto; padding-left: 12px; color: var(--navy); display: flex; }

.banner { margin: 10px 0 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 13px; background: var(--paper); }
.banner a { font-weight: 600; color: var(--blue); text-underline-offset: 3px; }
.status { margin-top: 8px; }
.status li { padding: 10px 0 12px; border-top: 1px solid var(--line-soft); transition: opacity var(--t) var(--ease); }
.status li:first-child { border-top: 0; }
.status li.dim { opacity: .4; }
.status li.sel { background: var(--mist); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 6px; }
.status p { margin-top: 4px; font-size: 13px; }
.status .nx { color: var(--ink-2); }
.status .nx b { font-weight: 500; color: var(--ink); }
.status .nx .ic { margin-right: 5px; color: var(--good); }
.who { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 30px; padding: 0; background: none; border: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 4px; }
.who b { flex: 1; font-weight: 500; }
.who[aria-pressed="true"] b { text-decoration: underline; text-underline-offset: 3px; }
.prog { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.status .links { display: flex; gap: 14px; justify-content: flex-end; margin-top: 2px; }
.status .links a { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--ink-2); text-decoration: none; }
.status .links .ic { width: 11px; height: 11px; }
.status .links a:hover, .status .links a:focus-visible { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Map: pins, base, controls. The map controls may keep a small shadow. */
.pin { width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff;
  font: 600 11.5px/1 var(--font); font-variant-numeric: tabular-nums;
  display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.pin .ic { width: 12px; height: 12px; stroke-width: 2.25; }
.pin.done { background: var(--good); }
/* On Live: a midwife's picture where the plan says she is, with a status badge. */
.mw-pin { position: relative; display: grid; place-items: center; width: 40px; height: 40px; }
.mw-pin .av { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c), 0 2px 6px rgba(0, 0, 0, .35); }
.mw-pin .badge { position: absolute; right: -3px; bottom: -3px; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 10px;
  display: grid; place-items: center; background: var(--navy); color: #fff; border: 1.5px solid #fff;
  font: 600 10.5px/1 var(--font); font-variant-numeric: tabular-nums; }
.mw-pin .badge .ic { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.mw-pin .badge .ic .win { fill: var(--navy); }
.mw-pin .badge .ic .wh { stroke: var(--navy); stroke-width: 1.1; }
.pin.todo { width: 16px; height: 16px; background: var(--grey-pin); }
.pin.base { width: 64px; height: 22px; border-radius: 5px; background: var(--navy); font-size: 10.5px; }
.leaflet-container { font-family: inherit; }
.leaflet-tooltip { font: 12.5px/1.4 var(--font); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); padding: 6px 9px; }
.leaflet-tooltip b { font-weight: 600; }
.leaflet-bar { border: 1px solid var(--ctl) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .1) !important; border-radius: 8px !important; overflow: hidden; }
.leaflet-bar a { width: 28px !important; height: 28px !important; line-height: 28px !important; color: var(--ink) !important; }
.leaflet-control-attribution { font-size: 10px; color: var(--ink-2); background: rgba(255, 255, 255, .8) !important; }
.leaflet-control-attribution a { color: var(--ink-2); }
.style-picker { display: flex; gap: 6px; }
.map.dark { background: #1a2540; }
.style-picker .pick { height: 26px; font-size: 12px; color: var(--ink-2); background: rgba(255, 255, 255, .92); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
/* Mute the fallback OpenStreetMap tiles so the routes stand out. */
.map.osm .leaflet-tile-pane { filter: grayscale(.75) brightness(1.05) opacity(.8); }

@media (max-width: 1000px) {
  body.planner #app, .shell { height: auto; }
  .shell { flex-direction: column; }
  .rail { width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .wordmark { padding: 0 10px 0 4px; align-self: center; }
  .nav { flex-direction: row; }
  .rail-h { display: none; }
  .team { display: flex; flex-wrap: wrap; }
  .facts { flex-wrap: wrap; gap: 16px 32px; }
  .fact.save { margin-left: 0; }
  .timeline { overflow-x: auto; }
  .t-row { min-width: 820px; }
  .low { flex-direction: column; }
  .map { height: 380px; flex: none; }
  .side { width: auto; border-left: 0; border-top: 1px solid var(--line); }
  .head { height: auto; min-height: 60px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
}

/* ---------- phone views ---------- */
/* On a wide screen: a centred phone-sized column with a hairline outline. On a phone: full screen. */
body.phone-page { background: var(--mist); font-size: 16px; line-height: 1.5; }
body.phone-page #app { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.phone { width: 390px; max-width: 100%; height: 800px; max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 24px; }
.phone small { font-size: 14px; }
.phone .btn { height: auto; min-height: 48px; padding: 0 18px; border-radius: 99px; font-size: 16px; }

/* Midwife */
.m-head, .m-prog { background: var(--navy); color: #fff; }
.m-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 6px; position: relative; z-index: 1; }
.m-head h1 { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; flex: 1; }
.m-head .av { box-shadow: 0 0 0 2px var(--navy), 0 0 0 4px var(--c); }
.m-head .date { color: var(--on-navy-soft); font-size: 14px; }
/* The header and progress read as one navy block: the -1px overlap hides the seam that
   shows at fractional device scales, and the header's 6px bottom padding keeps the
   picture's 4px ring inside it. */
.m-prog { padding: 7px 20px 18px; margin-top: -1px; }
.bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--good-bright); transform-origin: left; transition: transform var(--t) var(--ease); }
.m-prog p { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 14px; color: #fff; }
.m-prog .flag { font-size: 13px; }

.nv { padding: 22px 20px 20px; border-bottom: 1px solid var(--line); }
.nv-when { display: flex; align-items: center; gap: 12px; }
.nv-when .tn { font-size: 34px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; line-height: 1.1; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 2px 10px 2px 8px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--paper); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.nv h2 { font-size: 24px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; margin-top: 10px; line-height: 1.25; }
.nv-addr { margin-top: 2px; }
.nv-meta { margin-top: 4px; color: var(--muted); font-size: 14px; }
.btns { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; margin-top: 18px; }
.btns .btn { padding: 0 8px; }
.link-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin-top: 6px; padding: 0 2px; background: none; border: 0;
  font: inherit; font-weight: 600; color: var(--blue); text-decoration: underline; text-underline-offset: 4px;
  text-decoration-color: var(--sky); cursor: pointer; }
.late-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.phone .late-opts .btn { padding: 0 4px; font-size: 15px; }
.late-opts .btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.nv-done { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.nv-done .ic { width: 24px; height: 24px; color: var(--good); }
.nv-done { color: var(--good); }
.empty { color: var(--muted); padding: 40px 20px; text-align: center; }

.m-list { padding: 18px 20px 28px; }
.m-back { padding: 0 20px 18px; margin-top: -14px; font-size: 14px; color: var(--muted); }
.m-list:has(+ .m-list) { padding-bottom: 6px; }
.m-list h2 { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.m-list li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.m-list li:first-child { border-top: 0; }
.when { font-weight: 600; width: 46px; flex: none; }
.what { flex: 1; min-width: 0; }
.what b { font-weight: 500; }
.what b, .what small { display: block; }
.m-list li.done .when, .m-list li.done .what b { color: var(--muted); }
.tick { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--good); white-space: nowrap; padding-top: 2px; }

/* Parent */
.parent-wrap { display: flex; gap: 32px; align-items: center; justify-content: center; flex-wrap: wrap; }
.sms { width: 280px; font-size: 14px; }
.sms p { background: var(--paper); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 11px 14px;
  margin: 6px 0 0; overflow-wrap: anywhere; }
.sms p + p { margin-top: 10px; }
.sms p.none { background: transparent; border-style: dashed; border-color: var(--ctl); color: var(--muted); }
.p-head { background: var(--navy); color: #fff; }
.p-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; }
.p-logo { display: block; height: 20px; width: auto; }
.p-head small { color: var(--on-navy-soft); }
.p-head.with-time .p-bar { border-bottom: 1px solid rgba(255, 255, 255, .14); }
.p-body { padding: 22px 22px 32px; display: flex; flex-direction: column; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-ink);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 2px; font-size: 15px; }
.notice + .p-status { margin-top: 14px; }
.notice .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--bad); }
.arrival { padding: 22px 22px 28px; color: #fff; }
.arrival span { display: block; font-size: 18px; font-weight: 500; color: var(--on-navy-soft); letter-spacing: -.01em; }
.arrival strong { display: block; font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; text-wrap: balance; }
.p-big { font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; line-height: 1.2; display: flex; align-items: center; gap: 10px; text-wrap: balance; }
.p-big .ic { width: 28px; height: 28px; color: var(--good); }
.p-status { color: var(--ink-2); }
.p-big + .p-status { margin-top: 14px; }
.p-status b { font-weight: 600; color: var(--navy); }
.p-status b.go { color: var(--good); }
.p-who { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.p-who .av { margin: 3px; }
.p-who p { display: flex; flex-direction: column; line-height: 1.3; }
.p-who p > small { font-size: 13px; }
.p-who p > b { font-size: 19px; font-weight: 700; color: var(--navy); margin: 2px 0 1px; }
.p-who p > span { color: var(--ink-2); font-size: 15px; }
.p-facts { margin-top: 20px; border-top: 1px solid var(--line); }
.p-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.p-facts dt { color: var(--muted); }
.p-facts dd { font-weight: 500; text-align: right; }
.steps { margin-top: 28px; display: grid; gap: 14px; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.steps .mk { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ctl); flex: none; display: grid; place-items: center; }
.steps .past { color: var(--ink); }
.steps .past .mk { background: var(--navy); border-color: var(--navy); color: #fff; }
.steps .mk .ic { width: 12px; height: 12px; stroke-width: 2.25; }
.steps .now { color: var(--navy); font-weight: 600; }
.steps .now .mk { border: 6px solid var(--navy); }
.steps .go { color: var(--good); font-weight: 600; }
.steps .now.go .mk { border-color: var(--good); }
.steps .past.go .mk { background: var(--good); border-color: var(--good); }
.p-call { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.p-call p { color: var(--ink-2); font-size: 15px; }
.btn.wide { width: 100%; margin-top: 12px; }

@media (max-width: 520px) {
  body.phone-page #app { padding: 0; display: block; }
  .phone { width: 100%; height: auto; min-height: 100vh; max-height: none; border: 0; border-radius: 0; }
  .sms { display: none; }
}


.nw { white-space: nowrap; }

/* ---------- headings and big numbers ----------
   One face (Figtree). Headings and big numbers use tabular numerals so times never shift. */
.head h1, .fact b, .side h2, .scrub-time, .planning-card h2,
.m-head h1, .nv-when .tn, .nv h2, .p-big, .arrival strong { font-variant-numeric: tabular-nums; }

/* ---------- time slider on Live ---------- */
.scrub { flex: none; display: flex; align-items: center; padding: 10px var(--gut) 2px; }
.scrub-ctl { width: var(--who-w); flex: none; display: flex; align-items: center; gap: 10px; }
.scrub-ctl .pick { height: 28px; padding: 0 10px 0 8px; }
.scrub-ctl .pick .ic { width: 13px; height: 13px; }
.scrub-time { font-size: 15px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.scrub input { flex: 1; min-width: 0; margin: 0 -8px; --x: calc(8px + (100% - 16px) * var(--f, 0)); height: 24px; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.scrub input::-webkit-slider-runnable-track { height: 4px; border-radius: 99px;
  background: linear-gradient(to right, transparent 8px, var(--navy) 8px var(--x), var(--sky) var(--x) calc(100% - 8px), transparent calc(100% - 8px)); }
.scrub input::-moz-range-track { height: 4px; border-radius: 99px;
  background: linear-gradient(to right, transparent 8px, var(--navy) 8px var(--x), var(--sky) var(--x) calc(100% - 8px), transparent calc(100% - 8px)); }
.scrub input::-moz-range-progress { background: none; }
.scrub input::-webkit-slider-thumb { -webkit-appearance: none; box-sizing: border-box; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: var(--navy); border: 2px solid #fff; outline: 1px solid var(--navy); }
.scrub input::-moz-range-thumb { box-sizing: border-box; width: 16px; height: 16px; border-radius: 50%; background: var(--navy); border: 2px solid #fff; outline: 1px solid var(--navy); }
.t-now { position: absolute; top: -8px; bottom: -8px; width: 2px; margin-left: -1px; background: var(--navy); pointer-events: none; }

/* ---------- planning dialog ---------- */
.planning { position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center; padding: 20px;
  background: rgba(20, 33, 61, .32); opacity: 0; transition: opacity var(--t) var(--ease); }
.planning.in { opacity: 1; }
.planning.out { opacity: 0; }
.planning-card { width: 420px; max-width: 100%; background: var(--paper); border-radius: 14px; padding: 24px 24px 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .22); transform: translateY(6px); transition: transform var(--t) var(--ease); }
.planning.in .planning-card { transform: none; }
.planning-top { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
.planning-card h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--navy); }
/* The brand's "Pathway swoop" loader: the icon revealed by a moving stroke mask. */
.mx-loader { width: 52px; height: auto; flex: none; display: block; }
.mx-sweep{stroke-dasharray:.28 1.6;stroke-dashoffset:.28;animation:mxSweep 2.8s infinite}
@keyframes mxSweep{0%{stroke-dashoffset:.28;animation-timing-function:cubic-bezier(.65,0,.35,1)}86%{stroke-dashoffset:-1.04}100%{stroke-dashoffset:-1.04}}
.mx-draw{stroke-dasharray:1 1.2;stroke-dashoffset:1.1;animation:mxDraw 4.4s infinite}
@keyframes mxDraw{0%{stroke-dashoffset:1.1;animation-timing-function:cubic-bezier(.65,0,.35,1)}55%{stroke-dashoffset:0}72%{stroke-dashoffset:0;animation-timing-function:cubic-bezier(.65,0,.35,1)}100%{stroke-dashoffset:-1.1}}
.planning-bar { height: 6px; border-radius: 99px; background: var(--sky); overflow: hidden; }
.planning-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--blue); transition: width 700ms var(--ease); }
.planning-card ol { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.planning-card li { display: flex; align-items: center; gap: 10px; color: var(--muted); transition: color var(--t) var(--ease); }
.planning-card li.now { color: var(--ink); font-weight: 500; }
.planning-card li.done { color: var(--ink-2); }
.planning-card .mark { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ctl); display: grid; place-items: center; color: #fff; }
.planning-card .mark .ic { width: 10px; height: 10px; stroke-width: 2.5; visibility: hidden; }
.planning-card li.done .mark .ic { visibility: visible; }
.planning-card li.now .mark { border-color: var(--sky); border-top-color: var(--blue); animation: planning-spin 700ms linear infinite; }
.planning-card li.done .mark { border-color: var(--good); background: var(--good); }
@keyframes planning-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .mx-draw, .mx-sweep { stroke-dashoffset: 0; }
  .mx-sweep { stroke-dasharray: none; }
}

/* The Undo button is a finger target on the phone views. */
#toast button { min-height: 44px; }
