/* HailCare UI. Requires hailcare-tokens.css.
   A quiet tinted page with white cards on it: each shift, each list, each
   section of a form and each panel is a card with a hairline edge and a soft
   shadow. Inside a card, hierarchy comes from size, weight and space; notes
   and empty states sit in a tinted well. "Needs action" keeps its warm tint.
   No inline styles anywhere (strict CSP).
   Naming: block, block__part, block--variant; state is-*. See DESIGN.md. */

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: var(--fw-regular) var(--fs-body)/var(--lh-body) var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Signed out, a soft light falls from the top of the page, behind the
   floating header and the first heading, and fades into the page tint. */
body:not(.signed-in) { position: relative; }
body:not(.signed-in)::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 640px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 90% 100% at 50% 0%, var(--wash), transparent 72%);
}
@media print { body:not(.signed-in)::before { display: none; } }
/* One page fades into the next where the browser can (a cross-fade, off
   under reduced motion). */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
h1, h2, h3 { margin: 0; line-height: var(--lh-snug); overflow-wrap: anywhere; text-wrap: balance; }
/* No word left alone on a paragraph's last line, where the browser can help. */
p, li, dt, dd, figcaption { text-wrap: pretty; }
h1 { font-size: var(--fs-title); font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: -0.022em; }
h2 { font-size: var(--fs-heading); font-weight: 650; letter-spacing: -0.012em; }
h3 { font-size: var(--fs-body); font-weight: var(--fw-semibold); }
p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
img, svg { max-width: 100%; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); text-decoration-thickness: 2px; }
strong, b { font-weight: var(--fw-semibold); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }

.muted { color: var(--muted); }
.small { font-size: var(--fs-meta); }
.lead { font-size: var(--fs-lead); line-height: 1.45; }
.measure { max-width: var(--measure); }
.num { font-variant-numeric: tabular-nums; }
/* A figure that must not break across lines: a pay range ("$40–60/hr"). */
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ico { width: 20px; height: 20px; flex: none; vertical-align: middle; }
/* Each icon draws its regular weight (partials/icon.ejs). The current page's
   nav and tab icons switch to bold; ratings show the filled star. */
.ico__bold, .ico__fill { display: none; }
.nav__link.is-active .ico__regular, .tab.is-active .ico__regular { display: none; }
.nav__link.is-active .ico__bold, .tab.is-active .ico__bold { display: inline; }

/* ---- Shell ---------------------------------------------------------------
   Header on every page. Signed in: nav links in the header from 768px, a
   bottom tab bar below that. */
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 50;
  display: inline-flex; align-items: center; min-height: var(--control-h-sm); padding: 0 var(--sp-4);
  border-radius: var(--r-md); background: var(--primary); color: var(--primary-ink);
  font-weight: var(--fw-semibold); text-decoration: none;
}
.skip-link:focus { top: var(--sp-2); color: var(--primary-ink); }

.container { width: 100%; max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.container--narrow { max-width: var(--narrow); margin-inline: auto; }

.header { background: var(--surface); border-bottom: 1px solid var(--rule); }
.header__inner { display: flex; align-items: center; gap: var(--sp-4); min-height: var(--header-h); }
/* Signed out (the public pages, log in, sign up): the header floats 12px
   below the top edge, centred and as wide as its content, on a translucent
   surface over a blur, and stays in view as the page scrolls. Its buttons
   sit 4px inside its 16px corners, so their corners are 12px. Anchors and
   focused fields stop 80px down, clear of it. */
body:not(.signed-in) .header {
  position: sticky; top: var(--sp-3); z-index: 40;
  align-self: center; width: max-content; max-width: calc(100% - 2 * var(--gutter)); margin-top: var(--sp-3);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: var(--surface-glass); box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(16px) saturate(1.8); backdrop-filter: blur(16px) saturate(1.8);
}
body:not(.signed-in) .header__inner { width: auto; max-width: none; min-height: 0; gap: var(--sp-6); padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-4); }
body:not(.signed-in) .header__brand { margin-right: 0; }
/* The plain error page's header holds the wordmark alone. */
body:not(.signed-in) .header__inner:not(:has(.header__actions)) { padding-right: var(--sp-4); }
html:has(body:not(.signed-in)) { scroll-padding-top: 80px; scroll-behavior: smooth; }
.header__brand { display: flex; align-items: center; height: var(--control-h-sm); margin-right: auto; color: var(--ink); }
.header__brand .hc-wordmark { height: 22px; }
.header__actions { display: flex; align-items: center; gap: var(--sp-2); }
/* Signed out: Log in or Sign up, on its own page, sits on the petrol tint like the current nav item. */
.header__actions .btn[aria-current="page"] { background: var(--primary-soft); color: var(--primary-soft-ink); border-color: transparent; }
/* Signed in, from 768px: the nav sits beside the wordmark, Log out on the right.
   The current page sits on a petrol tint. */
.nav { display: none; align-items: center; gap: var(--sp-1); }
.nav__link {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--control-h-sm); padding: 0 14px;
  border-radius: var(--r-pill); color: var(--muted); font-weight: var(--fw-semibold); text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-color) var(--ease), color var(--dur-color) var(--ease);
}
.nav__link .ico { width: 20px; height: 20px; }
.nav__link:hover { color: var(--ink); background: var(--fill); }
.nav__link.is-active { color: var(--primary-soft-ink); background: var(--primary-soft); }
.nav__link:focus-visible { border-radius: var(--r-pill); }
/* Tablets: labels only, so four links and Log out fit on one line. */
@media (min-width: 768px) and (max-width: 959px) { .nav__link > .ico { display: none; } .nav__link { padding: 0 var(--sp-3); } }

.main { flex: 1 0 auto; padding-top: var(--sp-7); padding-bottom: var(--sp-9); }
.main:focus { outline: none; }

.footer { border-top: 1px solid var(--rule); padding: var(--sp-7) 0 var(--sp-8); color: var(--muted); font-size: var(--fs-meta); }
.footer--app { padding: var(--sp-5) 0 var(--sp-6); font-size: var(--fs-caption); }
.footer__inner { display: grid; gap: var(--sp-2); }
.footer p { max-width: var(--measure); }
.footer__links { display: flex; flex-wrap: wrap; gap: 0 var(--sp-5); }
/* The public pages, first in the footer (partials/footer-nav.ejs). Footer
   links stand alone, so each is a 44px tap target. */
.footer__nav { display: flex; flex-wrap: wrap; gap: 0 var(--sp-6); margin-bottom: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--rule); }
.footer__nav a, .footer__links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: var(--fw-semibold); text-decoration: none; }
/* A row of links, not links in a sentence: ink and muted, underlined on hover and focus. */
.footer__nav a { color: var(--ink); }
.footer__links a { color: var(--muted); }
.footer__nav a:hover, .footer__links a:hover, .footer__nav a:focus-visible, .footer__links a:focus-visible { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 0 var(--sp-2) env(safe-area-inset-bottom);
  background: var(--surface-glass); border-top: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(16px) saturate(1.8); backdrop-filter: blur(16px) saturate(1.8);
}
.tab {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 3px;
  min-height: var(--tabbar-h);
  color: var(--muted); font-size: var(--fs-tab); font-weight: var(--fw-semibold); line-height: 1.2; text-decoration: none;
}
.tab:hover { color: var(--ink); }
.tab .ico { width: 26px; height: 26px; }
.tab__icon { position: relative; display: block; }
.tab.is-active { color: var(--primary); }
/* A bar along the top edge marks the current tab without relying on colour. */
.tab.is-active::before {
  content: ""; position: absolute; top: 0; left: 26%; right: 26%; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--primary);
}
.tab:focus-visible { outline-offset: -3px; }
.tab__badge { position: absolute; top: -6px; left: 16px; }
body.signed-in { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
/* Keep focused and scrolled-to controls clear of the tab bar. */
@media (max-width: 767px) {
  html:has(body.signed-in) { scroll-padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); }
}

@media (min-width: 768px) {
  .header__brand .hc-wordmark { height: 24px; }
  .signed-in .header__brand { margin-right: var(--sp-5); }
  .nav { display: flex; margin-right: auto; }
  .tabbar { display: none; }
  body.signed-in { padding-bottom: 0; }
  .main { padding-top: var(--sp-9); padding-bottom: var(--sp-10); }
}

@media (forced-colors: active) {
  .nav__link.is-active, .tab.is-active, .header__actions .btn[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; }
}

/* Unread count: the only orange in the interface. */
.badge-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink);
  font-size: var(--fs-caption); font-weight: var(--fw-bold); line-height: 1; font-variant-numeric: tabular-nums;
}

/* ---- Page structure ---------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-4) var(--sp-6); margin-bottom: var(--sp-7); }
.page-head__text { display: grid; gap: var(--sp-2); min-width: 0; }
.page-head__sub { color: var(--muted); overflow-wrap: anywhere; }
.backlink {
  display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--control-h-sm); margin: calc(var(--sp-3) * -1) 0 var(--sp-2) -4px;
  color: var(--muted); font-weight: var(--fw-semibold); text-decoration: none;
}
.backlink:hover { color: var(--ink); }

/* A section: a heading with an optional count, then its content. */
.section { margin-top: var(--sp-9); }
.section:first-child, .page-head + .section { margin-top: 0; }
.section__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); }
.section__head > .more, .section__head > .section__aside { margin-left: auto; }
.count {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 var(--sp-2);
  border-radius: var(--r-pill); background: var(--card); box-shadow: inset 0 0 0 1px var(--rule); color: var(--muted);
  font-size: var(--fs-meta); font-weight: var(--fw-semibold); line-height: 1; font-variant-numeric: tabular-nums;
}

.stack { display: grid; gap: var(--sp-3); align-content: start; }
.stack > * { min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }

/* Card: a white surface with a hairline edge and a soft shadow. Notes and
   empty states inside one sit in a tinted well (--well); on the page itself
   they are cards too. */
.panel, .list, .card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  --well: var(--panel-bg);
}
/* Panel: a card with padding, for the block a screen is about. "Needs
   action" keeps its warm tint. */
.panel { padding: var(--sp-5); }
.panel--attention { background: var(--attention-bg); border-color: var(--attention-rule); box-shadow: none; --well: var(--card); }
.panel--attention .count { background: var(--attention-rule); box-shadow: none; color: var(--ink); }
.panel--attention .list > li + li { border-top-color: var(--attention-rule); }
@media (min-width: 768px) { .panel { padding: var(--sp-6) var(--sp-7); } }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--control-h); padding: 0 var(--sp-6);
  border-radius: var(--r-md); border: 1.5px solid transparent;
  font: var(--fw-semibold) var(--fs-body)/1.2 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-color) var(--ease), border-color var(--dur-color) var(--ease), color var(--dur-color) var(--ease), box-shadow var(--dur-color) var(--ease), transform var(--dur-move) var(--ease);
}
.btn:hover { text-decoration: none; }
/* Pressed: the button moves down a pixel. */
.btn:active:not([disabled]):not([aria-disabled="true"]) { transform: translateY(1px); }
.btn .ico { width: 18px; height: 18px; }
.btn--primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-button); }
.btn--primary:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn--primary:active { background: var(--primary-active); box-shadow: none; }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--control-border); box-shadow: var(--shadow-button); }
.btn--secondary:hover { background: var(--fill); color: var(--ink); border-color: var(--ink); }
.btn--secondary:active { background: var(--fill-strong); }
.btn--ghost { background: transparent; color: var(--primary); }
.btn--ghost:hover { background: var(--primary-soft); color: var(--primary-soft-ink); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn--sm { min-height: var(--control-h-sm); padding: 0 var(--sp-4); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.action-form { margin: 0; }

/* ---- Status pill, rating, avatar ------------------------------------------------ */
.pill {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: var(--fs-caption); font-weight: 650; line-height: 1; white-space: nowrap;
  background: var(--fill); color: var(--muted); vertical-align: middle;
}
.pill--info { background: var(--primary-soft); color: var(--primary-soft-ink); }

/* Tag: a fact about a shift (its requirement). Outlined and square-cornered,
   so it never reads as a status pill. It is content, not a label, so it is
   set at the secondary size (15px), not the 14px of pills. */
.tag {
  display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px;
  border-radius: var(--r-sm); border: 1px solid var(--rule-strong); background: var(--surface);
  color: var(--ink); font-size: var(--fs-meta); font-weight: var(--fw-semibold); line-height: 1.25; overflow-wrap: anywhere;
}
.pill--ok { background: var(--success-soft); color: var(--success); }
.pill--warn { background: var(--warning-soft); color: var(--warning); }
.pill--bad { background: var(--danger-soft); color: var(--danger); }

.rating { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rating .ico { width: 16px; height: 16px; }
.rating .ico__fill { display: inline; }
.rating strong { font-weight: var(--fw-semibold); }

.avatar {
  display: inline-grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-soft-ink); font-size: 24px; font-weight: var(--fw-bold); line-height: 1;
}

/* ---- Lists ---------------------------------------------------------------------
   A list is one card, its rows separated by hairlines (the inbox, ratings,
   certifications). A list of shifts is a stack of cards instead, one per
   shift, 12px apart. Inside a panel the panel is the card, and the rows
   run edge to edge between hairlines. */
.list { list-style: none; margin: 0; padding: 0; isolation: isolate; }
.list > li { position: relative; padding: var(--sp-5); overflow-wrap: anywhere; }
.list > li + li { border-top: 1px solid var(--rule); }
.list:has(> .shift), .panel .list { background: none; border: 0; border-radius: 0; box-shadow: none; }
.list:has(> .shift) { display: grid; gap: var(--sp-3); }
.panel .list { display: block; }
.panel .list > li { padding-left: 0; padding-right: 0; }

/* Shift row (partials/shift-item.ejs), used in every list of shifts.
   Three blocks: .shift__main (title, place, then the requirement and the
   status on one last line), .shift__when (date, time) and .shift__side (pay,
   hourly rate). Each block keeps its
   lines together, so a long title never pulls the time away from the date.
   Phones: date and pay on the first line, large; the title block below.
   From 768px: three columns, when | pay | what. Date, time and pay sit side
   by side and pay lines up in its own column; the title column takes the rest. */
.shift {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "when side"
    "main main"
    "actions actions";
  column-gap: var(--sp-4);
  align-items: start;
}
/* On the page each shift is a card. One whose title is a link is clickable
   as a whole: it rises a little on hover and takes the focus ring. */
.list > .shift {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-color) var(--ease), border-color var(--dur-color) var(--ease), transform var(--dur-move) var(--ease);
}
.list > .shift + .shift { border-top: 1px solid var(--rule); }
@media (hover: hover) {
  .list > .shift:has(.shift__title a):hover { border-color: var(--rule-strong); box-shadow: var(--shadow-raised); transform: translateY(-1px); }
  .list > .shift:has(.shift__actions:hover) { border-color: var(--rule); box-shadow: var(--shadow-card); transform: none; }
}
.shift::before {
  content: ""; position: absolute; inset: -1px; z-index: -1;
  border-radius: inherit; pointer-events: none;
  transition: background-color var(--dur-color) var(--ease);
}
.shift:focus-within::before { outline: 3px solid var(--focus); outline-offset: 2px; }
.shift:has(.shift__actions :focus)::before { outline: none; }
/* Inside a panel a shift is a row between hairlines: a tint on hover. */
.panel .list > .shift { background: none; border: 0; border-radius: 0; box-shadow: none; transform: none; }
.panel .list > .shift + .shift { border-top: 1px solid var(--rule); }
.panel .shift::before { inset: 4px calc(var(--sp-3) * -1); border-radius: var(--r-md); }
.panel .shift:focus-within::before { outline-offset: 0; }
.panel .shift:has(.shift__title a:hover)::before, .panel .shift:hover::before { background: var(--fill); }
.panel .shift:has(.shift__actions:hover)::before { background: transparent; }

.shift__when { grid-area: when; min-width: 0; }
.shift__side { grid-area: side; display: grid; justify-items: end; text-align: right; }
.shift__main { grid-area: main; min-width: 0; margin-top: var(--sp-3); }

.shift__date, .shift__pay {
  font-size: var(--fs-figure); font-weight: var(--fw-bold); line-height: 1.25; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.shift__time { font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; overflow: hidden; }
/* "7:00–11:00 AM · 4 h": when the duration wraps to its own line in a narrow
   column, its dot falls in the clipped strip left of the column, so the line
   never starts with "·". */
.shift__time-in { display: flex; flex-wrap: wrap; margin-left: -.75em; }
.shift__time-in > * { padding-left: .75em; }
.shift__dur { color: var(--muted); font-weight: var(--fw-regular); white-space: nowrap; }
.shift__dur::before { content: "·"; display: inline-block; width: .75em; margin-left: -.75em; text-align: center; }
.shift__rate { color: var(--muted); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.6; }
/* Supplies, expected volume, and Home visits (when checked) under the place line; small and muted so the card stays compact. */
.shift__extras { display: flex; flex-wrap: wrap; column-gap: var(--sp-3); color: var(--muted); font-size: var(--fs-meta); line-height: 1.6; }
.shift__status { margin-top: var(--sp-2); }
/* The last line: the requirement tag (or a note) first, the status pill at
   the far end; the pill moves under a tag too long to share the line. */
.shift__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-3); }
.shift__foot > .shift__req, .shift__foot > .shift__note { margin-top: 0; }
.shift__foot > .shift__note { flex: 1 1 12rem; }
.shift__foot > .shift__status { margin: 0 0 0 auto; }
.shift__title { font-size: var(--fs-lead); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.shift__title a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.shift__title a::after { content: ""; position: absolute; inset: 0; }
.shift__title a:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; }
.shift__title a:focus-visible { outline: none; }
.shift__where { margin-top: 2px; color: var(--muted); font-size: var(--fs-meta); }
.shift__req { margin-top: var(--sp-2); }
.shift__note { margin-top: var(--sp-1); color: var(--muted); font-size: var(--fs-meta); }
.shift__note--warn { color: var(--warning); font-weight: var(--fw-semibold); }

@media (min-width: 768px) {
  .shift {
    grid-template-columns: 13rem 7rem minmax(0, 1fr);
    grid-template-areas:
      "when side main"
      ". . actions";
    column-gap: var(--sp-6);
  }
  .shift__side { justify-items: start; text-align: left; }
  .shift__main { margin-top: 0; }
}
/* Buttons under a row ("Needs action"): above the link that covers the row,
   and focusing one rings the button, not the whole row. Long labels
   ("Rate Maximiliana") wrap inside the button. Cancel shift and Report
   no-show carry less weight than the row's main action: danger text without
   an outline (they still ask to confirm). */
.shift__actions { grid-area: actions; position: relative; z-index: 1; margin-top: var(--sp-4); gap: var(--sp-2) var(--sp-3); }
.shift__actions .btn { max-width: 100%; padding-top: 8px; padding-bottom: 8px; white-space: normal; overflow-wrap: anywhere; text-align: center; line-height: 1.3; }
.shift__actions .btn--danger { border-color: transparent; padding-left: var(--sp-3); padding-right: var(--sp-3); }
/* Tablets: inside the "Needs action" panel the title column is narrow, so the
   row's buttons take a full-width row under the date, pay and title. */
@media (min-width: 768px) and (max-width: 959px) {
  .panel--attention .shift { grid-template-areas: "when side main" "actions actions actions"; }
}
/* On the warm "Needs action" panel the hover tint is warm too. */
.panel--attention .shift:hover::before, .panel--attention .shift:has(.shift__title a:hover)::before {
  background: color-mix(in srgb, var(--attention-rule) 45%, var(--attention-bg));
}
.panel--attention .shift:has(.shift__actions:hover)::before { background: transparent; }

/* Key/value details: label left, value right, hairlines between rows.
   Markup: <dl class="kv"><div class="kv__row"><dt>…</dt><dd>…</dd></div></dl> */
.kv { display: grid; margin: 0; }
.kv__row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: var(--sp-4); align-items: baseline; padding: var(--sp-4) 0; }
.kv__row + .kv__row { border-top: 1px solid var(--rule); }
.kv dt { color: var(--muted); font-size: var(--fs-meta); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv__sub { display: block; color: var(--muted); font-size: var(--fs-meta); }
/* Narrow phones: the label sits above its value, so an address or a
   certification's full name gets the whole width instead of a 170px column. */
@media (max-width: 479px) { .kv__row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
@media (min-width: 768px) { .kv__row { grid-template-columns: 11rem minmax(0, 1fr); gap: var(--sp-6); } }

/* ---- Disclosure ----------------------------------------------------------------
   A chevron that points right when closed and down when open, the same in
   every browser (the native marker is hidden). */
.more > summary {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 48px; cursor: pointer;
  font-weight: var(--fw-semibold); color: var(--primary); list-style: none;
}
.more > summary:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before {
  content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 0 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}
.more[open] > summary::before { transform: rotate(45deg); margin-top: -4px; }
.more[open] > summary { margin-bottom: var(--sp-2); }

/* ---- Flash messages ----------------------------------------------------------- */
.flashes { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-7); }
.flash { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md); background: var(--primary-soft); }
.flash > .ico { width: 22px; height: 22px; margin-top: 1px; color: var(--primary); }
.flash__body { display: grid; gap: var(--sp-1); }
.flash__body a { font-weight: var(--fw-semibold); }
.flash--success { background: var(--success-soft); }
.flash--success > .ico { color: var(--success); }
.flash--error { background: var(--danger-soft); }
.flash--error > .ico { color: var(--danger); }
/* Links in an error (the error summary's field links, "Find other shifts"):
   danger red, 7.2:1 on the pink tint (petrol there is only 6.6:1), and a
   field name never breaks across lines. */
.flash--error a, .flash--error a:hover { color: var(--danger); }
.flash--error a { white-space: nowrap; }

/* ---- Forms -------------------------------------------------------------------- */
.form { display: grid; gap: var(--sp-6); }
.fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: var(--sp-5); min-width: 0; }
.fieldset > legend { float: left; width: 100%; padding: 0; margin: 0; font-size: var(--fs-heading); font-weight: 650; letter-spacing: -0.012em; line-height: var(--lh-snug); }
.fieldset + .fieldset { margin-top: var(--sp-5); }
/* Each section of a form is a card, its legend the card's heading. */
.form .fieldset:not(.fieldset .fieldset, .shifts-rating) {
  padding: var(--sp-5); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  --well: var(--panel-bg);
}
@media (min-width: 768px) { .form .fieldset:not(.fieldset .fieldset, .shifts-rating) { padding: var(--sp-6) var(--sp-7) var(--sp-7); } }
.field { display: grid; gap: var(--sp-2); align-content: start; min-width: 0; }
.label { font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.label__opt { color: var(--muted); font-weight: var(--fw-regular); }
.help { font-size: var(--fs-meta); color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-width: 0; min-height: var(--control-h); padding: 12px 14px;
  border-radius: var(--r-md); border: 1.5px solid var(--control-border);
  background: var(--surface); color: var(--ink); font: var(--fw-regular) var(--fs-body)/1.3 var(--font);
  transition: border-color var(--dur-color) var(--ease), box-shadow var(--dur-color) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink); }
.textarea { min-height: 120px; resize: vertical; line-height: var(--lh-body); }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--primary); }
/* Date and time inputs carry a picker icon: tighter side padding keeps the
   value whole in a narrow column. */
.input[type="date"], .input[type="time"] { padding-left: 12px; padding-right: 8px; }
/* A jump to a field (the error summary's links) keeps its label in view. */
.input, .select, .textarea, .check input { scroll-margin-top: var(--sp-9); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.input-affix { position: relative; }
.input-affix__pre { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-affix .input { padding-left: 30px; }
.err { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-meta); color: var(--danger); font-weight: var(--fw-semibold); }
.err .ico { width: 18px; height: 18px; margin-top: 1px; }
.grid-2, .grid-3 { display: grid; gap: var(--sp-5) var(--sp-4); }
/* Three fields (date, start, end; city, state, ZIP): on phones the first
   takes the row and the other two pair up below it. */
.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 > :first-child { grid-column: 1 / -1; }
@media (min-width: 600px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 > :first-child { grid-column: auto; }
}
/* In the 440px column (log in, sign up) three fields never fit side by side:
   keep the phone layout at every width. */
.container--narrow .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.container--narrow .grid-3 > :first-child { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: var(--sp-3); min-height: 48px; padding: var(--sp-3) 0; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--primary); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); padding-top: var(--sp-2); }

/* No-patient-information note */
.notice { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border-radius: var(--r-md); border: 1px solid var(--rule); background: var(--well, var(--card)); color: var(--muted); font-size: var(--fs-meta); }
.notice .ico { margin-top: 1px; color: var(--ink); }
.notice b { color: var(--ink); }
/* "HailCare does not verify credentials…" (partials/credential-notice.ejs):
   under a page head or section heading, or after a shift's details. */
.credential-notice { margin-bottom: var(--sp-6); }
.credential-notice--after { margin: var(--sp-5) 0 0; }
/* Compact: the same words as one muted line, no panel, where people come
   back every day (dashboards, Find shifts, profiles). */
.credential-notice--compact { padding: 0; border: 0; background: none; font-size: var(--fs-caption); line-height: 1.45; margin-bottom: var(--sp-5); }
.credential-notice--compact .ico { width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }

/* Empty state: one sentence and, optionally, one link. */
.empty { padding: var(--sp-5) var(--sp-6); border-radius: var(--r-lg); border: 1px solid var(--rule); background: var(--well, var(--card)); color: var(--muted); }
.empty a { font-weight: var(--fw-semibold); }

/* Pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--rule); }

/* Public pages: a section below the first screen rises 32px and fades in
   once as it scrolls into view (public/js/app.js adds .reveal, then
   .is-revealed). Without JavaScript nothing is hidden. */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease); }
.reveal.is-revealed { opacity: 1; transform: none; }
@media print { .reveal { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:active:not([disabled]):not([aria-disabled="true"]) { transform: none; }
  .list > .shift:hover { transform: none; }
  /* Sections only fade in: no movement. */
  .reveal { transform: none; transition: opacity var(--dur-reveal) var(--ease) !important; }
}

/* The dashboard's note after a shift (views/partials/invite-note.ejs) and
   the quiet link to Share HailCare at the end of the dashboards. */
.invite-note { margin-bottom: var(--sp-8); }
.invite-note__title { font-size: var(--fs-lead); margin: 0 0 var(--sp-2); }
.invite-note__text { color: var(--muted); margin: 0 0 var(--sp-4); }
.invite-note__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
/* A phlebotomist's "Finish your profile" (views/partials/profile-note.ejs):
   each missing item an open circle, as on a checklist, linking to its field. */
.profile-note__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.profile-note__list a { display: inline-flex; align-items: center; gap: var(--sp-3); min-height: 40px; font-weight: var(--fw-semibold); }
.profile-note__list a::before { content: ''; flex: none; width: 16px; height: 16px; border: 2px solid var(--rule-strong); border-radius: 50%; }
/* A clinic's first shift (views/partials/first-steps.ejs): three numbered steps, then a way to start. */
.first-steps { margin-bottom: var(--sp-8); }
.first-steps__list { margin: 0 0 var(--sp-5); padding-left: var(--sp-6); display: grid; gap: var(--sp-3); color: var(--muted); }
.first-steps__list b { color: var(--ink); }
.first-steps__list li::marker { color: var(--primary); font-weight: var(--fw-bold); }
.invite-link { margin-top: var(--sp-8); font-size: var(--fs-meta); }

/* A line under a checkbox, lined up with its label (22px box + 12px gap). */
.check__hint { margin: calc(var(--sp-2) * -1) 0 0 34px; }
