/* =========================================================
   阿爾瑪 Alma — 照護管理台

   Near-white ground, soft filled cards with no hairlines,
   one sans throughout, generous space, and colour used only
   where it carries state. Alma's palette, arranged the way
   the reference dashboards are arranged.
   ========================================================= */

:root {
  /* Ground and surfaces, straight off the website's stylesheet.
     cream-light is the working surface, cream-soft is a card,
     white is a tile inside one, cream is the track. */
  --ground: #f8f5ef;         /* --cream-light */
  --surface: #f3efe8;        /* --cream-soft, card */
  --surface-2: #ffffff;      /* tile inside a card */
  --surface-3: #ece9e3;      /* --cream, track and pressed */

  --ink: #111111;
  --text: #111111;
  --muted: rgba(17, 17, 17, 0.64);
  --faint: rgba(17, 17, 17, 0.48);
  --line: rgba(17, 17, 17, 0.07);
  --line-strong: rgba(17, 17, 17, 0.16);

  /* Dusty pink, the brand's one accent. It marks the person and
     the thing that needs a person. */
  --pink: #f3d5d5;
  --pink-soft: #f9e7e7;

  /* State. The accent and one alert, not a traffic light. */
  --on: #111111;             /* covered, assigned */
  --on-bg: #ece9e3;
  --open: #b2635d;           /* needs a nurse, reads on pink */
  --open-bg: #f9e7e7;
  --done: rgba(17, 17, 17, 0.32);
  --done-bg: #f0ede8;
  --alert: #b0433a;          /* clash */
  --alert-bg: #fbe9e7;
  --band: rgba(17, 17, 17, 0.045);   /* the healthy range on a chart, recessive */

  /* Shift kinds, quiet enough to sit thirty to a page. */
  --day-bg: #f5ead6;   --day-fg: #7d5c22;
  --night-bg: #e6e5f0; --night-fg: #45457a;
  --line-green: #06c755;
  --assigned: var(--on);
  --assigned-bg: var(--on-bg);

  --sans: "Satoshi", "PingFang TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "PT Serif", "PingFang TC", Georgia, serif;   /* brand mark only */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 12px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --pad-card: 26px;
  --gap: 18px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-pop: 0 24px 60px -24px rgba(17, 17, 17, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #101010;
    --surface: #191817;
    --surface-2: #1f1e1d;
    --surface-3: #2a2927;

    --ink: #f2efea;
    --text: #f2efea;
    --muted: rgba(242, 239, 234, 0.68);
    --faint: rgba(242, 239, 234, 0.48);
    --line: rgba(242, 239, 234, 0.08);
    --line-strong: rgba(242, 239, 234, 0.18);

    --pink: #6a4b4b;
    --pink-soft: #2e2323;

    --on: #f2efea;
    --on-bg: #2a2927;
    --open: #d9a09a;
    --open-bg: #342624;
    --done: rgba(242, 239, 234, 0.3);
    --done-bg: #232221;
    --alert: #e08a80;
    --alert-bg: #3a221f;
    --band: rgba(242, 239, 234, 0.06);
    --day-bg: #3a3122;   --day-fg: #e6c98f;
    --night-bg: #2b2a3d; --night-fg: #c3c2ec;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: var(--r-sm);
}

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

.ico { width: 17px; height: 17px; flex: 0 0 auto; display: block; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--ground) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand__mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--serif);
  font-size: 17px; line-height: 1;
  padding-bottom: 2px;
}
.brand__name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }

.topnav {
  display: flex; align-items: center; gap: 2px;
  margin: 0 auto;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--r-pill);
  position: relative; isolation: isolate;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }

.navbtn {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border: 0; background: none;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 200ms var(--ease-out);
}
.navbtn:hover { color: var(--text); }
.navbtn.is-on { color: var(--ground); }
.navbtn .ico { width: 16px; height: 16px; }
.navbtn[hidden] { display: none; }

.topbar__end { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.langbtn {
  background: none; border: 0;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out);
}
.langbtn:hover { background: var(--surface); color: var(--text); }

.iconbtn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; background: none;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out);
}
.iconbtn:hover { background: var(--surface); color: var(--text); }

/* The selected pill is one element that moves. */
.glide {
  position: absolute;
  top: 4px; bottom: 4px; left: 0;
  border-radius: var(--r-pill);
  background: var(--ink);
  z-index: 0;
  transition: transform 340ms var(--ease-out), width 340ms var(--ease-out);
  will-change: transform, width;
}
.glide--instant { transition: none; }

/* ---------- Page ---------- */

.main {
  padding: clamp(14px, 2vw, 26px) clamp(16px, 4vw, 40px) 90px;
  max-width: 1320px;
  margin: 0 auto;
}

.phead {
  display: flex; align-items: flex-end; gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.phead__text { flex: 1 1 280px; min-width: 0; }
.phead h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(27px, 3.4vw, 36px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.08;
  text-wrap: balance;
}
.phead__sub { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 62ch; }
.phead__acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 200ms var(--ease-out), background 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: translateY(-1px); } }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--ink); color: var(--ground); }
.btn--sm { padding: 7px 15px; font-size: 13px; }
.btn--danger { background: var(--alert-bg); color: var(--alert); }

.linkbtn {
  background: none; border: 0; padding: 4px 6px;
  color: var(--faint); font-size: 12.5px; cursor: pointer;
}
.linkbtn:hover { color: var(--text); }

.linknote {
  background: none; border: 0;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer; white-space: nowrap;
  transition: background 180ms var(--ease-out), color 180ms var(--ease-out);
}
.linknote:hover { background: var(--surface-3); color: var(--text); }
.linknote--has { color: var(--text); }

/* ---------- Cards ---------- */

.pcard, .card, .panel, .stat, .note, .gridwrap {
  background: var(--surface);
  border: 0;
  border-radius: var(--r-lg);
}
.pcard { padding: var(--pad-card); }
.panel { padding: 20px; }
.note { padding: 20px 22px; }

.pcard__head, .sec__head {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.pcard__head h2, .sec__head h2 {
  margin: 0;
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em;
}
.sec__note { color: var(--faint); font-size: 12.5px; }
.pcard__head .sec__note, .sec__head .sec__note { margin-left: auto; }
.sec__acts { margin-left: auto; display: flex; gap: 8px; }
.sec { margin-bottom: 26px; }

.quiet { margin: 0; color: var(--muted); }

/* ---------- Figures ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--gap);
  margin-bottom: 26px;
}
.stat { padding: 22px 24px; }
.stat__k { font-size: 13px; color: var(--muted); }
.stat__v {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 34px; font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat--alert .stat__v { color: var(--open); }
.stat--bad .stat__v { color: var(--alert); }

/* ---------- Pills and tags ---------- */

.pill {
  display: inline-flex; align-items: center;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--muted);
}
.pill--assigned { background: var(--on-bg); color: var(--text); }
.pill--open { background: var(--open-bg); color: var(--open); }
.pill--done { background: var(--done-bg); color: var(--done); }
.pill--cancelled { background: var(--surface-3); color: var(--faint); }
.pill--conflict { background: var(--alert-bg); color: var(--alert); }
.pill--quiet { background: var(--surface-3); color: var(--muted); }
.pill--demo { background: var(--pink-soft); color: var(--open); }

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
}

/* ---------- Segmented controls ---------- */

.tabs, .seg {
  display: inline-flex;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  position: relative; isolation: isolate;
}
.pcard .tabs { background: var(--surface-3); }
.tab, .seg button {
  position: relative; z-index: 1;
  border: 0; background: none;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 200ms var(--ease-out);
}
.tab:hover, .seg button:hover { color: var(--text); }
.tab.is-on, .seg button.is-on { color: var(--ground); background: none; }

/* ---------- Rows ---------- */

.rows { display: flex; flex-direction: column; gap: 8px; }

.row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 16px 20px;
  background: var(--surface-2);
  border: 0;
  border-radius: var(--r-md);
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
  transition: transform 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .row:hover { transform: translateY(-1px); } }
.row--done { opacity: 0.6; }
.row--cancelled { opacity: 0.45; }
.row--conflict { background: var(--alert-bg); }

.row__when { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.row__when b { display: block; font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.row__who { min-width: 0; }
.row__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__nurse { min-width: 0; font-size: 13.5px; }
.row__nurse span { color: var(--faint); }
.row__end { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Card grid ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--gap);
}
.card {
  padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: transform 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .card:hover { transform: translateY(-3px); } }
.card__top { display: flex; align-items: flex-start; gap: 10px; }
.card__name { font-family: var(--serif); font-size: 19px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.25; }
.card__sub { font-size: 13px; color: var(--muted); }
.card__pills { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.card__foot {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: auto; padding-top: 14px;
  font-size: 12.5px; color: var(--muted);
}
.card__foot b {
  color: var(--text); font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Patient page ---------- */

.crumbs {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  font-size: 13.5px;
}
.crumbs__link { background: none; border: 0; padding: 4px 2px; color: var(--muted); cursor: pointer; }
.crumbs__link:hover { color: var(--text); }
.crumbs__sep { color: var(--faint); }
.crumbs__here { font-weight: 500; }
.crumbs__acts { margin-left: auto; display: flex; gap: 8px; }

.safety {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  background: var(--pink-soft);
  border-radius: var(--r-lg);
  padding: 18px 24px;
  margin-bottom: var(--gap);
  font-size: 13.5px;
}
.safety span { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.safety i {
  font-style: normal; font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--open); flex: 0 0 auto;
}

.ppage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: var(--gap);
  align-items: start;
}
.ppage__main, .ppage__side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

.who { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 30px; }
.who__id { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; justify-content: center; }
.mono-avatar {
  width: 86px; height: 86px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pink);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 30px; font-weight: 400;
  margin-bottom: 10px;
  user-select: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mono-avatar { background: var(--surface-3); color: var(--text); }
}
.who__name { font-family: var(--serif); font-size: 22px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.22; }
.who__sub { font-size: 13px; color: var(--muted); }

.who__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 22px 26px;
  align-content: start;
}
.who__f dt { font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.who__f dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.who__f dd.mono { font-variant-numeric: tabular-nums; }

.dl { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px 16px; font-size: 14px; }
.dl dt { color: var(--muted); font-size: 12.5px; }
.dl dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.dl dd.mono { font-variant-numeric: tabular-nums; }

/* ---------- Vitals ---------- */

.vgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 10px;
  margin-bottom: var(--gap);
}
.vcard {
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.vcard.is-on { border-color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .vcard:hover { transform: translateY(-2px); } }
.vcard__k { font-size: 12.5px; color: var(--muted); }
.vcard__v {
  display: flex; align-items: baseline; gap: 5px;
  font-family: var(--serif);
  font-size: 28px; font-weight: 400; letter-spacing: -0.01em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.vcard__v.is-bad { color: var(--alert); }
.vcard__v i { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.trendwrap {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  padding: 20px 16px 10px;
}
.trend { width: 100%; height: auto; display: block; }
.trend__ax { font-family: var(--mono); font-size: 11px; fill: var(--faint); }

/* ---------- Coverage strip ---------- */

.coverwrap { margin-bottom: var(--gap); }
.cover { display: flex; gap: 6px; }
.cover__day { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.cover__bars { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; width: 100%; min-height: 44px; }
.cover__bar { height: 18px; border-radius: 6px; background: var(--surface-3); }
.cover__bar--assigned { background: color-mix(in srgb, var(--text) 20%, transparent); }
.cover__bar--done { background: color-mix(in srgb, var(--text) 10%, transparent); }
.cover__bar--open { background: var(--pink); box-shadow: inset 0 0 0 1.5px var(--open); }
.cover__bar--none { background: color-mix(in srgb, var(--text) 5%, transparent); }
.cover__lab { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cover__day--today .cover__lab { color: var(--text); font-weight: 600; }

/* ---------- Timeline ---------- */

.tl { display: flex; flex-direction: column; gap: 8px; }
.tl__item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1.1fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  animation: rise 300ms var(--ease-out) both;
}
.tl__item--conflict { background: var(--alert-bg); }
.tl__date { font-variant-numeric: tabular-nums; }
.tl__date b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.tl__date span { font-size: 12px; color: var(--faint); }
.tl__what b, .tl__who b { display: block; font-weight: 500; font-size: 14px; }
.tl__what span { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.tl__end { display: flex; align-items: center; gap: 8px; }
.tl__date, .tl__what, .tl__who { cursor: pointer; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: rise 300ms var(--ease-out) both; }

/* ---------- Week grid ---------- */

.gridwrap { overflow-x: auto; padding: 6px; }
.wgrid { display: grid; grid-template-columns: 160px repeat(7, minmax(116px, 1fr)); min-width: 960px; }
.wgrid__cell { padding: 6px; min-height: 56px; }
.wgrid__head {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
  min-height: 0; padding: 10px;
  font-size: 12px;
}
.wgrid__head b { display: block; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wgrid__head span { color: var(--faint); }
.wgrid__head.is-today b { color: var(--text); }
.wgrid__head.is-today span { color: var(--open); }
.wgrid__lab {
  position: sticky; left: 0; z-index: 1;
  background: var(--surface);
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
}
.wgrid__head.wgrid__lab { z-index: 3; }
.wgrid__lab b { font-weight: 500; font-size: 14px; }
.wgrid__lab span { font-size: 12px; color: var(--faint); }
.wgrid__day { display: flex; flex-direction: column; gap: 5px; }

.chip {
  display: block; width: 100%;
  border: 0;
  border-radius: var(--r-sm);
  padding: 6px 9px;
  font-size: 12px; line-height: 1.3;
  cursor: pointer; text-align: left; font-family: inherit;
  /* The ordinary case carries no fill. A week that is fully covered should
     read as calm, so only the cells that want attention are tinted. */
  background: transparent;
  color: var(--text);
  transition: background 140ms var(--ease-out);
}
.chip:hover { background: var(--surface-2); }
/* One line each, so a long name shortens instead of making the row taller. */
.chip b, .chip span {
  display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip b { font-weight: 500; }
.chip span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip--assigned { background: transparent; }
.chip--assigned:hover { background: var(--surface-2); }
.chip--open { background: var(--open-bg); color: var(--open); }
.chip--open span { color: var(--open); opacity: 0.75; }
.chip--done { background: var(--done-bg); color: var(--done); }
.chip--done span { color: var(--done); }
.chip--cancelled { background: var(--surface-3); color: var(--faint); text-decoration: line-through; }
.chip--conflict { background: var(--alert-bg); color: var(--alert); }
.chip--conflict span { color: var(--alert); opacity: 0.8; }
.chip--add {
  background: none; color: var(--faint);
  text-align: center; padding: 5px;
  opacity: 0;
  transition: opacity 180ms var(--ease-out);
}
.wgrid__cell:hover .chip--add, .chip--add:focus { opacity: 1; }

/* ---------- Notes ---------- */

.note__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.note__date { font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; }
.note__by { font-size: 12.5px; color: var(--muted); }
.note__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 20px; }
.note__f { font-size: 13.5px; }
.note__f dt { font-size: 11.5px; color: var(--faint); margin-bottom: 2px; }
.note__f dd { margin: 0; }
.vitals { display: flex; flex-wrap: wrap; gap: 8px; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.vitals span { background: var(--surface); border-radius: var(--r-pill); padding: 3px 11px; }
.vitals i { font-style: normal; color: var(--faint); }

/* ---------- Nurse list ---------- */

.nlist { display: flex; flex-direction: column; gap: 6px; }
.nlist__row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 0; width: 100%;
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: transform 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .nlist__row:hover { transform: translateY(-2px); } }
.nlist__av {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pink);
  font-family: var(--serif);
  font-size: 15px; font-weight: 400;
}
.nlist__t { min-width: 0; flex: 1 1 auto; }
.nlist__t b { display: block; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nlist__t span { font-size: 11.5px; color: var(--faint); }
.nlist__n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; flex: 0 0 auto; }

/* ---------- Toolbar ---------- */

.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--gap); }
.bar__spacer { flex: 1 1 auto; }

.search {
  flex: 1 1 200px; max-width: 320px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
}
.search::placeholder { color: var(--faint); }

.weeknav { display: inline-flex; align-items: center; gap: 6px; }
.weeknav__label { font-size: 14px; font-weight: 500; min-width: 150px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 16px; }
.form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.form__grid--2 { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; color: var(--faint); }
.field input, .field select, .field textarea {
  padding: 11px 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.field--full { grid-column: 1 / -1; }
.field__hint { font-size: 11.5px; color: var(--faint); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: auto; margin: 0; }

fieldset.fset { border: 0; border-radius: var(--r-md); padding: 0; margin: 0; }
fieldset.fset legend { font-size: 12px; color: var(--faint); padding: 0 0 10px; }

details.fset {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 0;
}
details.fset > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  font-size: 13.5px; color: var(--muted);
}
details.fset > summary::-webkit-details-marker { display: none; }
details.fset > summary:hover { color: var(--text); }
details.fset[open] > summary { color: var(--text); }
details.fset > summary .chev { width: 14px; height: 14px; margin-left: auto; transition: transform 220ms var(--ease-out); }
details.fset[open] > summary .chev { transform: rotate(90deg); }
details.fset > .fset__body { padding: 0 18px 18px; }
.fset__n {
  font-size: 11.5px; font-variant-numeric: tabular-nums;
  background: var(--surface-3); color: var(--muted);
  border-radius: var(--r-pill); padding: 2px 9px;
}

.form__acts {
  display: flex; gap: 10px; align-items: center;
  padding-top: 16px;
}

.warn { background: var(--alert-bg); color: var(--alert); border-radius: var(--r-md); padding: 12px 16px; font-size: 13px; }
.info { background: var(--pink-soft); color: var(--open); border-radius: var(--r-md); padding: 12px 16px; font-size: 13px; }

/* ---------- Banner, empty, misc ---------- */

.banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px 22px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: var(--gap);
}
.banner__spacer { flex: 1 1 auto; }

.empty {
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.empty .ico { width: 22px; height: 22px; margin: 0 auto 12px; opacity: 0.35; }
.empty p { margin: 0 0 16px; }

.copyable {
  background: none; border: 0; padding: 0;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 7px;
  border-radius: var(--r-sm);
}
.copyable .ico { width: 13px; height: 13px; opacity: 0; transition: opacity 160ms ease; }
@media (hover: hover) and (pointer: fine) { .copyable:hover .ico { opacity: 0.4; } }
.copyable.is-copied { color: var(--open); }
.copyable.is-copied .ico { opacity: 1; }

.paylist { display: flex; flex-direction: column; }
.paylist > div {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 12px; align-items: baseline;
  padding: 10px 0;
  font-size: 13.5px;
}
.paylist > div + div { border-top: 1px solid var(--line); }
.paylist span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.paylist b { font-weight: 600; font-variant-numeric: tabular-nums; }

.split {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.split > div {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.split span { font-size: 12px; color: var(--faint); }
.split b { font-family: var(--serif); font-size: 24px; font-weight: 400; font-variant-numeric: tabular-nums; }
.split__cut { background: var(--pink-soft); }

.sharelink {
  display: flex; gap: 10px; align-items: center;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 8px 8px 8px 16px;
}
.sharelink input { flex: 1 1 auto; min-width: 0; border: 0; background: none; padding: 0; font-family: var(--mono); font-size: 12.5px; }
.sharelist { margin: 0; padding-left: 20px; font-size: 13.5px; color: var(--muted); }
.sharelist li { margin-bottom: 6px; }

/* ---------- Modal ---------- */

.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__scrim {
  position: absolute; inset: 0;
  background: rgba(17, 17, 17, 0.32);
  backdrop-filter: blur(3px);
  transition: opacity 220ms var(--ease-out);
}
.modal__box {
  position: relative;
  background: var(--ground);
  border-radius: var(--r-lg);
  width: min(680px, 100%);
  max-height: min(88vh, 940px);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-pop);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
@starting-style {
  .modal__box { opacity: 0; transform: scale(0.97); }
  .modal__scrim { opacity: 0; }
}
.modal.is-closing .modal__box { opacity: 0; transform: scale(0.98); transition-duration: 140ms; }
.modal.is-closing .modal__scrim { opacity: 0; transition-duration: 140ms; }

.modal__head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 14px; box-shadow: 0 1px 0 var(--line); }
.modal__title { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 400; flex: 1 1 auto; }
.modal__body { padding: 16px 22px 22px; overflow-y: auto; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 30px;
  transform: translateX(-50%);
  background: var(--ink); color: var(--ground);
  padding: 11px 22px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  z-index: 70;
  box-shadow: var(--shadow-pop);
}
.toast[hidden] { display: none; }

/* ---------- Login ---------- */

.login { max-width: 360px; margin: 14vh auto 0; }
.login h1 { font-family: var(--serif); font-size: 29px; font-weight: 400; margin: 0 0 6px; }
.login p { color: var(--muted); margin: 0 0 24px; }

/* ---------- Skeleton ---------- */

.skel { display: flex; flex-direction: column; gap: 12px; padding: 10px 0; }
.skel__line, .skel__row {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-3) 40%, var(--surface) 80%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-md);
}
.skel__line--title { height: 34px; width: 240px; margin-bottom: 14px; }
.skel__row { height: 70px; }
@keyframes shimmer { 0% { background-position: 120% 0; } 100% { background-position: -20% 0; } }

/* ---------- Narrow ---------- */

@media (max-width: 1060px) {
  .ppage { grid-template-columns: minmax(0, 1fr); }
  .ppage__side { flex-direction: row; flex-wrap: wrap; }
  .ppage__side > * { flex: 1 1 280px; }
}

@media (max-width: 760px) {
  :root { --pad-card: 20px; --gap: 14px; }
  .topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .topnav { order: 3; width: 100%; margin: 0; justify-content: flex-start; }
  .topbar__end { margin-left: auto; }
  .brand__name { display: none; }
  .who { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .row, .tl__item { grid-template-columns: 70px minmax(0, 1fr); row-gap: 8px; }
  .row__nurse, .tl__who { grid-column: 1 / -1; }
  .row__end, .tl__end { grid-column: 1 / -1; justify-content: flex-start; }
  .dl { grid-template-columns: 92px minmax(0, 1fr); }
  .ppage__side { flex-direction: column; }
  .modal { padding: 0; place-items: end stretch; }
  .modal__box { max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; width: 100%; }
}

/* ---------- Print ---------- */

@media print {
  .topbar, .crumbs__acts, .tabs, .linknote, .banner, .modal, .toast { display: none !important; }
  .main { padding: 0; max-width: none; }
  .ppage { grid-template-columns: 1fr; }
  .pcard, .card { break-inside: avoid; }
  body { background: #fff; font-size: 12px; }
}

/* =========================================================
   Hero
   Alma's own care photography, with the live facts pinned on
   it: who is with this person today, and the latest reading.
   ========================================================= */

.phead__ring { display: flex; align-items: center; gap: 14px; }
.ring { width: 72px; height: 72px; flex: 0 0 auto; }
.ring__t { font-size: 15px; font-weight: 600; fill: var(--text); font-variant-numeric: tabular-nums; }
.phead__ringtext { font-size: 12.5px; color: var(--muted); line-height: 1.4; max-width: 14ch; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.hero__img {
  position: relative;
  min-height: 440px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-3) center/cover no-repeat;
  isolation: isolate;
}
/* a soft floor so the white chips always have something to sit on */
.hero__img::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(17, 17, 17, 0.20) 0%, rgba(17, 17, 17, 0) 38%,
    rgba(17, 17, 17, 0) 58%, rgba(17, 17, 17, 0.28) 100%);
  z-index: 0;
}

.hchip {
  position: absolute; z-index: 1;
  background: color-mix(in srgb, var(--surface-2) 90%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-radius: var(--r-md);
  padding: 12px 15px;
  box-shadow: 0 10px 30px -12px rgba(17, 17, 17, 0.4);
  max-width: 68%;
}
.hchip--nurse { top: 18px; left: 18px; display: flex; align-items: center; gap: 11px; }
.hchip--vital { bottom: 18px; right: 18px; min-width: 168px; }

.hchip__k { font-size: 11px; color: var(--faint); }
.hchip__v {
  display: flex; align-items: baseline; gap: 5px;
  font-family: var(--serif); font-size: 24px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.hchip__v i { font-style: normal; font-family: var(--sans); font-size: 11.5px; color: var(--muted); }
.hchip__name { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.hchip__when { display: block; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hchip--nurse > span:last-child { min-width: 0; }
.hchip .spark { width: 100%; height: 26px; display: block; margin-top: 6px; }

/* the vertical coverage scale down the left edge, as in the reference */
.hscale {
  position: absolute; z-index: 1;
  left: 18px; top: 92px; bottom: 26px;
  width: 30px;
  display: flex; flex-direction: column; justify-content: space-between;
  align-items: flex-start;
}
.hscale__tick { width: 9px; height: 1.5px; background: rgba(255, 255, 255, 0.5); border-radius: 2px; }
.hscale__tick--on { width: 20px; background: var(--surface-2); height: 2px; }
.hscale__val {
  font-size: 11px; font-weight: 600;
  color: var(--surface-2);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(17, 17, 17, 0.5);
}

.hero__side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* the small round action in a card corner */
.cornerbtn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--ink); color: var(--ground);
  cursor: pointer;
  transition: transform 200ms var(--ease-out);
}
.cornerbtn:hover { transform: translateY(-2px); }
.cornerbtn .ico { width: 15px; height: 15px; }

@media (max-width: 1060px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero__img { min-height: 300px; }
}

/* =========================================================
   Home
   One place that says what to do, one that says what is
   happening, and everything else kept quiet.
   ========================================================= */

.homegrid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--gap);
  margin-top: var(--gap);
  align-items: start;
}

.count {
  margin-left: auto;
  min-width: 24px; height: 24px;
  padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  background: var(--ink); color: var(--ground);
  font-size: 12.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Needs you ---------- */

.todo { display: flex; flex-direction: column; gap: 8px; }

.todo__row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
/* the reason is the loudest thing in the row, because it is why you are reading it */
.todo__why {
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--open);
}
.todo__row--clash { background: var(--alert-bg); }
.todo__row--clash .todo__why { color: var(--alert); }
.todo__row--task .todo__why { color: var(--muted); }

.todo__t { min-width: 0; }
.todo__t b { display: block; font-weight: 500; font-size: 14.5px; }
.todo__t span { display: block; font-size: 12.5px; color: var(--muted); }
.todo__more { margin-top: 12px; }

.pcard--clear { background: var(--pink-soft); }
.clear { display: flex; align-items: center; gap: 16px; }
.clear__ico {
  width: 20px; height: 20px;
  flex: 0 0 auto;
  padding: 9px;
  box-sizing: content-box;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--open);
}
.clear b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 400; }
.clear span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; }

/* ---------- On duty ---------- */

.duty { display: flex; flex-direction: column; gap: 10px; }
.duty__card {
  display: block; width: 100%;
  text-align: left; font: inherit; color: inherit;
  border: 0; border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 18px 20px;
  cursor: pointer;
  transition: transform 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .duty__card:hover { transform: translateY(-2px); } }

.duty__top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.duty__who { min-width: 0; }
.duty__who b { display: block; font-weight: 600; font-size: 15px; }
.duty__who span { display: block; font-size: 12.5px; color: var(--muted); }
.duty__meta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* how far through the shift we are, so handover is not a surprise */
.duty__bar {
  height: 6px; border-radius: var(--r-pill);
  background: var(--surface-3);
  margin: 12px 0 8px;
  overflow: hidden;
}
.duty__bar i { display: block; height: 100%; background: var(--ink); border-radius: var(--r-pill); }
.duty__left { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Later ---------- */

.later { display: flex; flex-direction: column; gap: 2px; }
.later__row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 14px; align-items: center;
  padding: 13px 14px;
  border: 0; border-radius: var(--r-md);
  background: none; width: 100%;
  text-align: left; font: inherit; color: inherit;
  cursor: pointer;
  transition: background 180ms var(--ease-out);
}
.later__row:hover { background: var(--surface-2); }
.later__in { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.later__t b { display: block; font-weight: 500; font-size: 14px; }
.later__t span { display: block; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.later__n { font-size: 13px; color: var(--muted); white-space: nowrap; }

.banner--foot { margin: 26px 0 0; font-size: 13px; }

@media (max-width: 1060px) { .homegrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .todo__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .todo__why { grid-column: 1 / -1; }
  .later__row { grid-template-columns: 64px minmax(0, 1fr); }
  .later__n { grid-column: 2; font-size: 12px; }
}

.sv__acts { display: flex; justify-content: center; margin: 24px 0 4px; }

/* ---------- Settings ---------- */
/* One column of quiet cards. No nested surfaces, hairline separation only,
   so the page reads as a list of decisions rather than a stack of boxes. */
.sgrid { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }

.scard {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.scard__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.scard__head h2 { font-family: var(--serif); font-weight: 400; font-size: 17px; margin: 0; }
.scard__note { margin: 0 0 16px; font-size: 13px; line-height: 1.55; color: var(--muted); max-width: 60ch; }

.sfields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 14px; }
.sfield { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sfield--full { grid-column: 1 / -1; }
.sfield > span { font-size: 12px; color: var(--muted); }
.sfield input,
.sfield select {
  width: 100%; min-height: 40px;
  border: 0; border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 0 12px;
  font-family: inherit; font-size: 14px; color: var(--text);
}
.sfield input.mono { font-family: var(--mono); font-size: 13px; }
.sfield input:focus-visible,
.sfield select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.sfield__hint { font-size: 11.5px; color: var(--faint); font-style: normal; line-height: 1.5; }

.stoggle {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; margin-bottom: 6px;
  border-top: 1px solid var(--line);
}
.stoggle span { display: flex; flex-direction: column; gap: 2px; }
.stoggle b { font-weight: 500; font-size: 14px; }
.stoggle i { font-style: normal; font-size: 12px; color: var(--muted); max-width: 52ch; }
.stoggle input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--ink); }

.sacts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sacts .btn { cursor: pointer; }
.seg--wide { display: inline-flex; }

@media (max-width: 680px) {
  .sfields { grid-template-columns: 1fr; }
  .scard { padding: 16px; }
}
.iconbtn.is-on { background: var(--surface-3); color: var(--text); }
.sf__pay { margin: -4px 0 14px; font-size: 12.5px; color: var(--muted); }

.rates { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.rates th {
  text-align: left; font-weight: 400; font-size: 11.5px; color: var(--muted);
  padding: 0 10px 8px 0; border-bottom: 1px solid var(--line);
}
.rates td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rates td:first-child { font-size: 13.5px; white-space: nowrap; }
.rates input {
  width: 100%; max-width: 110px; min-height: 36px;
  border: 0; border-radius: var(--r-sm); background: var(--surface-2);
  padding: 0 10px; font-family: var(--mono); font-size: 13px; color: var(--text);
}
.rates input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.rates__keep { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }


/* Notion databases, listed as links once they exist. */
.ndbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.ndb {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px 7px 10px; border-radius: 999px;
  background: var(--chip); color: var(--ink);
  font-size: 13px; text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.ndb:hover { background: var(--chip-hover, var(--chip)); transform: translateY(-1px); }
.ndb__i { font-size: 14px; line-height: 1; }
.btn--quiet { opacity: .62; }
.btn--quiet:hover { opacity: 1; }


/* Sign in screens */
.login__logo { height: 26px; width: auto; display: block; margin: 0 0 18px; }
/* The wordmark is black ink. On the dark ground it turns light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login__logo { filter: invert(1); }
}
:root[data-theme="dark"] .login__logo { filter: invert(1); }
.login__note { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 18px; }
.login .field { display: grid; gap: 6px; margin-bottom: 12px; }
.login .field span { font-size: 12.5px; color: var(--muted); }

/* Account and people in Settings */
.acct { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 6px; }
.acct__who { display: grid; gap: 2px; }
.acct__who b { font-weight: 500; }
.acct__who span { font-size: 13px; color: var(--muted); }
.people { display: grid; gap: 2px; margin: 4px 0 14px; }
.person { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 6px 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person__who { display: grid; gap: 2px; min-width: 0; }
.person__who b { font-weight: 500; }
.person__who b i { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }
.person__who span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.person__acts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.person__av {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; background: var(--pink);
  font-family: var(--serif); font-size: 13px;
}
@media (min-width: 760px) {
  .sgrid--team .person { grid-template-columns: 36px minmax(0, 1fr) auto auto; }
  .sgrid--team .person__acts { grid-column: auto; justify-content: flex-end; }
}
.person--off { opacity: .55; }
.invite { display: grid; gap: 6px; margin: 4px 0 10px; font-size: 13px; color: var(--muted); }


/* ---------- Nurses: the pool ----------
   Counts first, the way a lab report leads with how many markers are in
   range. Each count is a button that filters the roster below. */

.pool {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 8px 8px 16px;
  margin-bottom: 16px;
}
.pool__ks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.pool__k {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 14px 16px;
  border: 0; border-radius: var(--r-md);
  background: none; color: inherit; font: inherit; text-align: left;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms var(--ease-out);
}
.pool__k:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { .pool__k:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); } }
.pool__k.is-on { background: var(--surface-2); }
.pool__n {
  font-family: var(--serif); font-weight: 400;
  font-size: 30px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pool__k span { font-size: 13px; color: var(--muted); }
.pool__k.is-on span { color: var(--text); }
.pool__bar {
  display: flex; gap: 3px;
  height: 6px; margin: 10px 16px 0;
}
.pool__bar i { display: block; height: 100%; border-radius: var(--r-pill); min-width: 0; }
.pool__busy { background: var(--ink); }
.pool__free { background: #e3b4b0; }
.pool__off { background: var(--line-strong); }

/* ---------- Nurses: filters ---------- */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 14px; }
.filters .search { flex: 1 1 220px; max-width: 300px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  border: 0; border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text); font: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}
.fchip span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.fchip:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .fchip:hover { background: var(--surface-3); } }
.fchip.is-on { background: var(--ink); color: var(--ground); }
.fchip.is-on span { color: color-mix(in srgb, var(--ground) 70%, transparent); }

/* ---------- Nurses: the roster ---------- */

.ntable { background: var(--surface); border-radius: var(--r-lg); padding: 6px; }
.nhead, .nrow {
  display: grid;
  grid-template-columns: 36px minmax(160px, 1.5fr) minmax(140px, 1.1fr) minmax(120px, 1fr) 104px 92px;
  gap: 14px;
  align-items: center;
}
.nhead { padding: 10px 14px 8px; font-size: 12px; color: var(--muted); }
.nrow {
  padding: 10px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 140ms ease;
}
.nrow + .nrow { box-shadow: inset 0 1px 0 var(--line); }
@media (hover: hover) and (pointer: fine) { .nrow:hover { background: var(--surface-2); box-shadow: none; } .nrow:hover + .nrow { box-shadow: none; } }
.nrow--off { opacity: 0.55; }

.nrow__av {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--pink);
  font-family: var(--serif); font-size: 13px;
}
.nrow__who { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nrow__name {
  border: 0; background: none; padding: 0;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--text);
  text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nrow__name i { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 2px; }
.nrow__sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nrow__shifts { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.nrow__none { color: var(--faint); }
.ntag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 12px; line-height: 1.5;
  white-space: nowrap;
  background: var(--surface-3); color: var(--muted);
}
.ntag--day { background: var(--day-bg); color: var(--day-fg); }
.ntag--night { background: var(--night-bg); color: var(--night-fg); }
.ntag--full { background: var(--pink-soft); color: var(--open); }
.nrow__cred { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nrow__certs { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nrow__yrs { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nrow__load { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nrow__load.is-busy { color: var(--text); font-weight: 500; }
.nrow__acts { display: flex; justify-content: flex-end; gap: 6px; }
.nact {
  height: 30px; min-width: 30px;
  display: inline-grid; place-items: center;
  padding: 0 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background 140ms ease;
}
.nact .ico { width: 14px; height: 14px; }
.nact:active { transform: scale(0.95); }
.nact--line { background: var(--line-green); color: #fff; }
.ncount { margin: 10px 4px 0; font-size: 12.5px; color: var(--muted); }

@media (max-width: 900px) {
  .pool__ks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* On a phone each set of chips is one line that scrolls sideways, so the
     roster starts on the first screen instead of the fourth. */
  .filters .search { max-width: none; flex-basis: 100%; }
  .fchips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px;
  }
  .fchips::-webkit-scrollbar { display: none; }
  .nhead { display: none; }
  .nrow {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-areas: "av who acts" "av shifts shifts" "av cred load";
    gap: 6px 12px;
    align-items: start;
  }
  .nrow__av { grid-area: av; }
  .nrow__who { grid-area: who; }
  .nrow__acts { grid-area: acts; }
  .nrow__shifts { grid-area: shifts; }
  .nrow__cred { grid-area: cred; flex-direction: row; gap: 8px; align-items: baseline; }
  .nrow__load { grid-area: load; text-align: right; }
}

/* ---------- Nurse detail ---------- */

.nhero { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.nhero__av {
  width: 56px; height: 56px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--pink);
  font-family: var(--serif); font-size: 19px;
}
.nhero__t { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.nhero__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.nhero__contact { display: flex; flex-wrap: wrap; gap: 8px; }
.nhero__contact .btn { text-decoration: none; }
.nhero__contact .ico { width: 14px; height: 14px; }
.btn--line { background: var(--line-green); color: #fff; }
.stats--tight { margin-bottom: 16px; }
.ndl { margin-bottom: 16px; }

.sgrid--team { max-width: 860px; }

/* ---------- Vitals: in range or not ---------- */

.vsum { display: flex; flex-wrap: wrap; gap: 14px; margin: -6px 0 14px; font-size: 13px; }
.vsum span { display: inline-flex; align-items: center; gap: 7px; }
.vsum span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.vsum__ok { color: var(--muted); }
.vsum__ok::before { background: var(--ink); }
.vsum__bad { color: var(--alert); font-weight: 500; }
.vsum__bad::before { background: var(--alert); }

.vtrack {
  position: relative; display: block;
  height: 4px; margin-top: 10px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
}
.vtrack__band { position: absolute; top: 0; bottom: 0; border-radius: var(--r-pill); background: var(--line-strong); }
.vtrack__dot {
  position: absolute; top: 50%;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--surface-2);
}
.vtrack__dot.is-bad { background: var(--alert); }


/* ---------- Nurse page ---------- */

.nhead2 {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.nhead2__av {
  width: 64px; height: 64px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--pink);
  font-family: var(--serif); font-size: 21px;
}
.nhead2__t { flex: 1 1 240px; min-width: 0; }
.nhead2__t h1 {
  margin: 0;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(27px, 3.4vw, 36px);
  letter-spacing: -0.015em; line-height: 1.08;
}
.nhead2__ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Taking shifts or not: two words, the chosen one filled. */
.nstate { background: var(--surface); }
.nstate button { transition: color 160ms ease, background 160ms ease, transform 160ms var(--ease-out); }
.nstate button:active { transform: scale(0.97); }
.nstate button.is-on { background: var(--ink); color: var(--ground); }
.nstate button.is-on[data-v="0"] { background: var(--surface-3); color: var(--text); }

.nrate, .nsort {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 13px; color: var(--muted);
}
.nrate select, .nsort select {
  border: 0; border-radius: var(--r-pill);
  padding: 6px 10px;
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.nsort { margin-left: auto; }

/* What decides a call, in one strip. */
.nfacts {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.4fr 0.9fr;
  gap: 2px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 6px;
  margin-bottom: var(--gap);
}
.nfact { padding: 14px 16px; min-width: 0; }
.nfact + .nfact { border-left: 1px solid var(--line); }
.nfact__k { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.nfact__v { display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; font-size: 13px; }
.nfact__big { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.nfact__sub { flex-basis: 100%; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.nfact__none { color: var(--faint); }

/* Ways to reach her, each one tappable. */
.ncontact { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.ncall {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text); text-decoration: none;
  min-width: 0;
  transition: transform 160ms var(--ease-out), background 140ms ease;
}
.ncall:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) { a.ncall:hover { background: var(--surface-3); } }
.ncall .ico { width: 18px; height: 18px; color: var(--muted); }
.ncall span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ncall i { font-style: normal; font-size: 12px; color: var(--muted); }
.ncall b { font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ncall__mark {
  flex: 0 0 auto;
  padding: 3px 7px; border-radius: 7px;
  background: var(--line-green); color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em;
}
.ncall--flat .ncall__mark { background: var(--surface-3); color: var(--muted); }
.nemerg { margin: 14px 2px 0; font-size: 13.5px; }
.nemerg i { font-style: normal; color: var(--muted); margin-right: 10px; font-size: 12.5px; }

.nspecial { margin: 0 0 16px; font-size: 15px; line-height: 1.6; }
.nnote { margin: 0; white-space: pre-line; font-size: 14px; line-height: 1.6; }

@media (max-width: 900px) {
  .nfacts { grid-template-columns: 1fr 1fr; }
  .nfact + .nfact { border-left: 0; }
  .nfact:nth-child(even) { border-left: 1px solid var(--line); }
  .nfact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .nhead2__ctl { flex-basis: 100%; }
  .nsort { margin-left: 0; }
}
