/* =====================================================================
   portal.css - the volunteer portal's own styles (rider.html only).

   Redesign stage 3 (plan 6.1, 6.2): this was the 1,000-line <style> block
   in rider.html, moved here unchanged in what it styles and converted to
   the --pt-* colour tokens below. Loaded after style.css (shared with the
   Map view console) so these rules still win; the consoles never load it.

   Day and night: portaltheme.js puts data-theme="light" or "dark" on
   <html>. :root is the dark set (today's "Night" look, and what shows
   before the script has run); :root[data-theme="light"] is the daytime
   set. Things that look the same in both themes: the SOS button and SOS
   panel (solid red, white text), the signature pad (white pad, dark ink),
   the QR code, photos, map tiles. No prefers-color-scheme: Auto is by the
   clock (portaltheme.js). Token table: docs/premium-redesign/stage3-portal-rules.md
   ===================================================================== */

/* v4.16 - the "Night" design. One set of tokens; the old --portal-*
   names point at them so everything drawn by rider.js matches. */
:root {
    --pt-bg: #08131f;
    --pt-card: #102231;
    --pt-raised: #172c3d;
    --pt-line: #2b4354;
    --pt-text: #f2f6fa;
    --pt-text-2: #b6c6d4;
    --pt-muted: #92a6b8;
    --pt-red: #c8102e;
    --pt-red-hover: #a90d27;
    --pt-sos: #ff334b;
    --pt-sos-btn: #d61d33;   /* v4.46: the SOS button itself (white text 5.1:1) */
    --pt-ok: #59c99a;
    --pt-warn: #f2b24c;
    --pt-focus: #7fb3ff;
    --pt-info: #9ecbff;
    --pt-ok-tint: rgba(89, 201, 154, .14);
    --pt-warn-tint: rgba(242, 178, 76, .14);
    --pt-red-tint: rgba(200, 16, 46, .16);
    --pt-info-tint: rgba(127, 179, 255, .14);
    --pt-go: #238636;
    --pt-on-fill: #FFFFFF;
    --pt-overlay: rgba(0, 0, 0, .6);
    --pt-shadow: 0 8px 24px rgba(0, 0, 0, .4);

    /* Stage 3 additions (rules doc: "if nothing fits, add a token"). Dark = the
       colour that was hard-coded here before; light passes 4.5:1 for text. */
    --pt-nav-h: 76px;                       /* the tab bar (was 64px) */
    --pt-nav-bg: #0b1826;                   /* the tab bar's own ground */
    --pt-avatar: #3a4e60;                   /* initials circle */
    --pt-line-strong: #3a5568;              /* outlines that must show (secondary buttons) */
    --pt-raised-hover: #223049;             /* a secondary button under the finger */
    --pt-field: #0d1117;                    /* text boxes, selects, inset help items */
    --pt-red-text: #ff8a98;                 /* error / danger / "can't" words on the ground */
    --pt-red-line: rgba(248, 81, 73, .6);   /* red outlines (Can't do it, short-staffed) */
    --pt-warn-line: rgba(245, 158, 11, .45);/* amber outlines (notes, "please confirm") */
    --pt-info-line: rgba(59, 130, 246, .45);/* a job card's blue edge */
    --pt-go-btn: #1a7f37;                   /* the green .btn (v4.46: white text 5.1:1) */
    --pt-go-btn-hover: #19733f;
    --pt-blue-btn: #1f6feb;                 /* "as a driver" fill */
    --pt-neutral-btn: #30363d;              /* "own vehicle" fill (white text) */
    --pt-select: #58a6ff;                   /* a chosen day / time / size: its outline */
    --pt-select-tint: rgba(88, 166, 255, .18);
    --pt-now: #facc15;                      /* "do this now": yellow marks and words */
    --pt-now-fill: #facc15;                 /* yellow fills (dark text on them, both themes) */
    --pt-on-now: #111111;
    --pt-relay: #d2b8ff;                    /* relay / hand-over purple: text and marks */
    --pt-relay-tint: rgba(137, 87, 229, .10);/* relay / hand-over backgrounds */
    --pt-relay-fill: #6d28d9;               /* relay step numbers (white text, both themes) */
    --pt-relay-line: rgba(167, 139, 250, .5);
    --pt-relay-text: #e9d5ff;
    --pt-overlay-strong: rgba(0, 0, 0, .8); /* behind full windows */
    --pt-card-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    --pt-edge-shadow: 0 -10px 12px -8px rgba(0, 0, 0, .6);  /* pinned Save / Cancel bar */
    --pt-scheme: dark;                      /* date / time pickers drawn to match */

    --portal-bg: var(--pt-bg);
    --portal-surface: var(--pt-card);
    --portal-surface-2: var(--pt-raised);
    --portal-line: var(--pt-line);
    --portal-line-strong: var(--pt-line-strong);
    --portal-text: var(--pt-text);
    --portal-muted: var(--pt-muted);
    /* Fills with white text on them: the same in both themes. */
    --portal-blue: #3b82f6;
    --portal-green: #22c55e;
    --portal-amber: #f59e0b;
    --portal-red: #dc2626;   /* SOS fill: never changes with the theme */
}

/* The daytime set. */
:root[data-theme="light"] {
    --pt-bg: #F3F6FA;
    --pt-card: #FFFFFF;
    --pt-raised: #EEF2F7;
    --pt-line: #C9D3E1;
    --pt-text: #0A1830;
    --pt-text-2: #3B4A63;
    --pt-muted: #4A5A75;
    --pt-red: #C4122F;
    --pt-red-hover: #A50F27;
    --pt-sos: #C4122F;
    --pt-sos-btn: #d61d33;
    --pt-ok: #0E7A45;
    --pt-warn: #8A4B00;
    --pt-focus: #1B4F9C;
    --pt-info: #1B4F9C;
    --pt-ok-tint: #E3F4EA;
    --pt-warn-tint: #FFF1D6;
    --pt-red-tint: #FCE8EB;
    --pt-info-tint: #E8F0FB;
    --pt-go: #0E7A45;
    --pt-on-fill: #FFFFFF;
    --pt-overlay: rgba(10, 24, 48, .45);
    --pt-shadow: 0 8px 22px rgba(10, 24, 48, .10);

    --pt-nav-bg: #FFFFFF;
    --pt-avatar: #DCE3ED;
    --pt-line-strong: #9AA8BC;
    --pt-raised-hover: #E1E8F1;
    --pt-field: #FFFFFF;
    --pt-red-text: #B3102B;
    --pt-red-line: rgba(196, 18, 47, .55);
    --pt-warn-line: rgba(138, 75, 0, .35);
    --pt-info-line: #A9C2E6;
    --pt-go-btn: #0E7A45;
    --pt-go-btn-hover: #0B6338;
    --pt-blue-btn: #1B4F9C;
    --pt-neutral-btn: #4A5A75;
    --pt-select: #1B4F9C;
    --pt-select-tint: #E8F0FB;
    --pt-now: #8A5A00;
    --pt-now-fill: #facc15;
    --pt-on-now: #111111;
    --pt-relay: #5B21B6;
    --pt-relay-tint: #F1EAFE;
    --pt-relay-fill: #6d28d9;
    --pt-relay-line: #C4B5FD;
    --pt-relay-text: #4C1D95;
    --pt-overlay-strong: rgba(10, 24, 48, .55);
    --pt-card-shadow: 0 1px 2px rgba(10, 24, 48, .06);
    --pt-edge-shadow: 0 -10px 12px -8px rgba(10, 24, 48, .18);
    --pt-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--pt-bg);
}

body {
    background: var(--pt-bg);
    color: var(--pt-text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    padding: 0;
    margin: 0;
    display: block;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;
}

.container {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

/* ---- the frame ---- */
.pt-app {
    padding: 0 16px calc(var(--pt-nav-h) + 24px + env(safe-area-inset-bottom));
}
[data-panel][hidden] { display: none !important; }
/* style.css (shared with the consoles) styles <header> as the console's
   bar: on phones it's position:relative with z-index 2000, which put it
   OVER the portal's pop-ups. Undone here, by class. (Its white text too.) */
.pt-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: max(14px, env(safe-area-inset-top)) 0 4px;
    position: static; z-index: auto; height: auto; grid-column: auto;
    background: none; border-bottom: none; box-shadow: none; color: var(--pt-text);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
/* The browser's "Install app" offer is a row under Account (rider.js). */
#pt-install-slot .pt-row { border-top: 1px solid var(--pt-line); }
.pt-brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; letter-spacing: 0.01em; }
.pt-brand img { width: 34px; height: auto; display: block; }
.pt-head-right { display: flex; align-items: center; gap: 10px; }
.pt-icon-btn {
    position: relative; width: 48px; height: 48px; border-radius: 50%;
    background: var(--pt-raised); border: 1px solid var(--pt-line); color: var(--pt-text);
    font-size: 18px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.pt-badge {
    position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 10px; background: var(--pt-sos); color: var(--pt-on-fill); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
/* Stage 3: 48px, like every other tap target (was 44px). */
.pt-avatar {
    width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--pt-line);
    background: var(--pt-avatar); color: var(--pt-text); font-weight: 600; font-size: 16px;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.pt-avatar[hidden], .pt-icon-btn[hidden], .pt-sos[hidden], .pt-badge[hidden] { display: none; }
.pt-avatar-lg { width: 56px; height: 56px; font-size: 20px; cursor: default; }
.pt-greet {
    position: sticky; top: 0; z-index: 70;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 0 12px; background: var(--pt-bg);
}
.pt-greet h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 600; overflow-wrap: anywhere; }
/* v4.53 (outside audit): the "saved on this phone" banners (signatures, SOS, job answers)
   used to be position:fixed at the very top and covered Messages and SOS. They now sit in
   the sticky greeting bar, on their own line under the SOS button, so they stay in view
   while scrolling and never cover it. h1 basis 0 keeps name + SOS on line one. */
.pt-greet { flex-wrap: wrap; }
.pt-greet h1 { flex: 1 1 0; min-width: 0; }
#pt-queue-banners { flex: 0 0 100%; display: flex; flex-direction: column; gap: 6px; }
#pt-queue-banners:empty { display: none; }
#pt-queue-banners > div { border-radius: 8px; }
#pt-queue-banners > #sos-queue-banner { order: -1; }
.pt-sos {
    flex: none; min-width: 84px; min-height: 48px; padding: 0 18px; border-radius: 10px;
    /* v4.36 - solid red (was an outline): SOS must look more urgent than any routine button. */
    /* v4.46 - audit U6: a deeper red behind the words (white on the old
       #ff334b was 3.6:1; this is 5.1:1). Still unmistakably red.
       Stage 3: the same red and white in the day theme as at night. */
    background: var(--pt-sos-btn); color: #fff; border: 2px solid var(--pt-sos-btn);
    font-family: inherit; font-size: 17px; font-weight: 800; line-height: 1; letter-spacing: 0.06em; cursor: pointer;
}
.pt-sos:hover { filter: brightness(0.94); }
.pt-sos.active { background: var(--pt-sos-btn); color: #fff; animation: pt-sos-pulse 1.6s ease-in-out infinite; }
@keyframes pt-sos-pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 51, 75, 0.25); } }

/* Controller status strip */
#controller-strip:empty { display: none; }
.pt-strip {
    display: flex; align-items: center; gap: 10px; min-height: 52px;
    background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 12px;
    padding: 8px 8px 8px 14px; margin-bottom: 14px; font-size: 15px;
}
.pt-strip > i, .pt-strip > .ui-icon { font-size: 18px; flex: none; }
.pt-strip.warn > i, .pt-strip.warn > .ui-icon { color: var(--pt-warn); }
.pt-strip.ok > i, .pt-strip.ok > .ui-icon { color: var(--pt-ok); }
.pt-strip-text { flex: 1; min-width: 0; line-height: 1.3; }
.pt-strip-text small { display: block; color: var(--pt-muted); font-size: 13px; }
/* v4.40 - audit item 7: the portal hasn't heard from the server for a while. */
.pt-strip-text small.pt-stale { color: var(--pt-warn); font-weight: 600; }
.pt-strip-refresh { background: none; border: 0; padding: 0 2px; color: var(--pt-warn); font: inherit; text-decoration: underline; cursor: pointer; min-height: 48px; }
.pt-strip-act {
    flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px;
    border: none; border-left: 1px solid var(--pt-line); background: none; color: var(--pt-text-2);
    font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; border-radius: 0 8px 8px 0;
}
.pt-strip-act.call { color: var(--pt-ok); font-weight: 600; }
/* v4.48 - audit U14: the name gets the whole line; Call / Contact options sit
   underneath, side by side. Before, they shared one row and, with bigger text,
   the name was squeezed into a tall thin column. */
/* v4.48 - audit U16: the location notice's three short lines, then "More detail" */
.loc-short { list-style: none; margin: 12px 0 10px; padding: 0; }
.loc-short li { font-size: 18px; line-height: 1.4; margin: 0 0 10px; padding-left: 26px; position: relative; color: var(--pt-text); }
.loc-short li::before { content: '✓'; position: absolute; left: 0; color: var(--pt-ok); font-weight: 800; }
.loc-more { margin: 0 0 14px; }
.loc-more summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-size: 16px; font-weight: 700; color: var(--pt-info); }
.pt-strip { flex-wrap: wrap; row-gap: 0; padding: 10px 12px 0 14px; }
.pt-strip-text { flex: 1 1 calc(100% - 40px); padding-bottom: 8px; }
.pt-strip-act { flex: 1 1 auto; justify-content: center; border-left: 0; border-top: 1px solid var(--pt-line); border-radius: 0; min-height: 48px; font-size: 16px; }
.pt-strip-act + .pt-strip-act { border-left: 1px solid var(--pt-line); }

/* Home: what you're doing now comes first. Mid-job the jobs go above the
   shift card; an open SOS goes above everything. */
#pt-home-flow { display: flex; flex-direction: column; }
body.pt-busy #pt-jobs-section { order: -1; }
/* v4.47 - audit U11: mid-job, the photo card and "On shift now" go below the shortcuts */
body.pt-busy #rider-idphoto, body.pt-busy #on-shift-now { order: 2; }
.pt-shift.pt-shift-bar { padding: 14px 16px; }
.pt-shift.pt-shift-bar .portal-card-title { font-size: 19px; line-height: 1.3; margin: 0; }
.pt-shift.pt-shift-bar .portal-card-title i, .pt-shift.pt-shift-bar .portal-card-title .ui-icon { color: var(--pt-ok); margin-right: 4px; }
.pt-shift.pt-shift-bar .portal-card-copy { margin: 4px 0 0; font-size: 16px; }
.pt-shift-bar #btn-shift-toggle { display: none; }
body.pt-sos-on #safety-container { order: -2; }
/* v4.70: weather and ice stand-down banner. Stays above the jobs when they move
   up mid-job (same order, earlier in the page), and below an open SOS (-2). */
body.pt-busy #pt-weather { order: -1; }
#pt-weather[hidden] { display: none; }
.pt-weather {
    display: flex; align-items: flex-start; gap: 10px; min-height: 52px;
    border-radius: 12px; padding: 12px 14px; margin: 0 0 14px;
    font-size: 17px; font-weight: 600; line-height: 1.35; color: var(--pt-text);
    border: 1px solid var(--pt-line); background: var(--pt-card);
}
.pt-weather > .ui-icon { flex: none; font-size: 20px; margin-top: 2px; }
.pt-weather-text { flex: 1; min-width: 0; }
.pt-weather.wait { background: var(--pt-warn-tint); border-color: var(--pt-warn); }
.pt-weather.wait > .ui-icon { color: var(--pt-warn); }
.pt-weather.alert { background: var(--pt-red-tint); border-color: var(--pt-sos); border-width: 2px; }
.pt-weather.alert > .ui-icon { color: var(--pt-sos); }
/* v4.71: tonight's ice notice (rider.js renderNightNotice). Same place and
   tones as the banner above; below an open SOS, never over it. */
body.pt-busy #pt-weather-night { order: -1; }
#pt-weather-night[hidden] { display: none; }
.pt-night {
    border-radius: 12px; padding: 12px 14px; margin: 0 0 14px;
    color: var(--pt-text); border: 1px solid var(--pt-line); background: var(--pt-card);
}
.pt-night.wait { background: var(--pt-warn-tint); border-color: var(--pt-warn); }
.pt-night.ok { background: var(--pt-ok-tint); border-color: var(--pt-ok); }
.pt-night-head { display: flex; align-items: flex-start; gap: 10px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.pt-night-head > .ui-icon { flex: none; font-size: 20px; margin-top: 2px; }
.pt-night.wait .pt-night-head > .ui-icon { color: var(--pt-warn); }
.pt-night.ok .pt-night-head > .ui-icon { color: var(--pt-ok); }
.pt-night-text { flex: 1; min-width: 0; }
.pt-night-thanks { margin: 10px 0 0; font-size: 17px; font-weight: 700; color: var(--pt-ok); }
.pt-night-line, .pt-night-reminder { margin: 6px 0 0; font-size: 16px; line-height: 1.4; color: var(--pt-text-2); }
.pt-night-reminder { font-weight: 600; color: var(--pt-text); }
.pt-night-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pt-night-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 56px; width: 100%; padding: 12px 16px; border-radius: 14px; box-sizing: border-box;
    font: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
    background: var(--pt-raised); color: var(--pt-text); border: 2px solid var(--pt-line);
}
.pt-night-btn.go { background: var(--pt-go); color: var(--pt-on-fill); border-color: var(--pt-go); }
.pt-night-btn.small { min-height: 48px; font-size: 16px; }
.pt-night-btn:disabled { opacity: .6; cursor: default; }
.pt-night-btn:focus-visible { outline: 3px solid var(--pt-focus); outline-offset: 2px; }
.pt-h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; margin: 6px 2px 10px; }
.pt-h2 i, .pt-h2 .ui-icon { color: var(--pt-text-2); font-size: 18px; }
.pt-h3 { font-size: 15px; font-weight: 600; color: var(--pt-text-2); margin: 20px 2px 8px; }
.pt-panel-title { font-size: 22px; font-weight: 600; margin: 4px 2px 14px; }
.pt-kicker { color: var(--pt-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }

/* The main shift button: a pill, as in the design. */
.btn.pt-pill, .btn.pt-pill:hover, .btn.pt-pill:active, .btn.pt-pill:focus {
    background: var(--pt-red); border-radius: 999px; min-height: 56px; font-size: 18px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px;
}
.btn.pt-pill:hover { background: var(--pt-red-hover); }
.pt-shift .loc-notice-line { color: var(--pt-muted) !important; margin-top: 14px !important; line-height: 1.45; }
.pt-shift .loc-notice-line button { color: var(--pt-info) !important; }

/* Shortcuts (2 x 2) and rows */
.pt-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 4px 0 12px; }
.pt-tile {
    display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px 10px 14px;
    background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 14px;
    color: var(--pt-text); font: inherit; font-size: 15px; font-weight: 500; text-align: left; cursor: pointer;
}
.pt-tile > i:first-child, .pt-tile > .ui-icon:first-child { font-size: 20px; color: var(--pt-text-2); width: 22px; text-align: center; flex: none; }
.pt-tile span { flex: 1; min-width: 0; line-height: 1.25; }
.pt-chev { color: var(--pt-muted); font-size: 13px; flex: none; }
.pt-list { background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 16px; overflow: hidden; margin-bottom: 14px; }
.pt-row {
    display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 12px 16px;
    background: none; border: none; border-top: 1px solid var(--pt-line); color: var(--pt-text);
    font: inherit; font-size: 16px; text-align: left; text-decoration: none; cursor: pointer;
}
.pt-list > .pt-row:first-child { border-top: none; }
.pt-row > i:first-child, .pt-row > .ui-icon:first-child { font-size: 19px; color: var(--pt-text-2); width: 22px; text-align: center; flex: none; }
.pt-row-label { flex: 1; min-width: 0; line-height: 1.3; }
.pt-row-label small { display: block; color: var(--pt-muted); font-size: 13px; margin-top: 2px; }
.pt-row-aside { color: var(--pt-text-2); font-size: 14px; }
.pt-row-card { background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 14px; margin-bottom: 12px; }
.pt-row-danger > i:first-child, .pt-row-danger > .ui-icon:first-child, .pt-row-danger .pt-row-label { color: var(--pt-red-text); }
.pt-tile:hover, .pt-row:hover, .pt-icon-btn:hover { background: var(--pt-raised); }
.pt-row-card:hover { background: var(--pt-raised); }

.pt-onshift { background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 14px; padding: 12px 16px; margin: 0 0 12px; font-size: 15px; color: var(--pt-text-2); }
.pt-profile-card { display: flex; align-items: center; gap: 14px; }
.pt-profile-name { font-size: 18px; font-weight: 600; }
.pt-profile-sub { color: var(--pt-muted); font-size: 14px; }
.pt-foot { text-align: center; color: var(--pt-muted); font-size: 12px; margin: 26px 0 8px; }
.pt-foot .app-version { color: var(--pt-muted); }

/* Bottom navigation. Stage 3 (plan 6.1): 76px plus the phone's own bottom
   edge; the chosen tab has a tinted capsule behind its icon and a bold label
   (it no longer relies on red: red is kept for SOS and urgent). */
.pt-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--pt-nav-bg); border-top: 1px solid var(--pt-line);
    padding-bottom: env(safe-area-inset-bottom);
}
.pt-nav-btn {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: var(--pt-nav-h); border: none; background: none; color: var(--pt-text-2);
    font: inherit; font-size: 12px; cursor: pointer;
}
.pt-nav-btn i, .pt-nav-btn .ui-icon { font-size: 20px; position: relative; z-index: 1; }
.pt-nav-btn > span { position: relative; z-index: 1; }
.pt-nav-btn.on { color: var(--pt-text); font-weight: 700; }
.pt-dot { position: absolute; top: 9px; left: calc(50% + 10px); width: 11px; height: 11px; border-radius: 50%; background: var(--pt-sos); border: 2px solid var(--pt-nav-bg); }
.pt-nav-btn > .pt-dot { position: absolute; z-index: 2; }
.pt-dot[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The capsule: behind the icon, centred on it. */
.pt-nav-btn.on::before {
    content: ''; position: absolute; top: calc(50% - 33px); left: 50%; width: 64px; height: 34px;
    transform: translateX(-50%); border-radius: 999px; background: var(--pt-info-tint);
}
@media (min-width: 600px) { .pt-nav { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border-left: 1px solid var(--pt-line); border-right: 1px solid var(--pt-line); border-radius: 14px 14px 0 0; } }

/* Contact options sheet */
.pt-sheet-mask { position: fixed; inset: 0; z-index: 9500; background: var(--pt-overlay); display: flex; align-items: flex-end; justify-content: center; }
.pt-sheet {
    width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--pt-card); color: var(--pt-text);
    border: 1px solid var(--pt-line); border-radius: 18px 18px 0 0; padding: 8px 0 calc(16px + env(safe-area-inset-bottom));
    box-shadow: var(--pt-shadow);
}
.pt-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 6px 18px; }
.pt-sheet-head h2 { font-size: 18px; font-weight: 600; margin: 0; }
.pt-sheet .pt-row { border-top: 1px solid var(--pt-line); }
.pt-sheet-note { display: flex; gap: 8px; margin: 12px 18px 0; color: var(--pt-muted); font-size: 13px; line-height: 1.45; }

/* Messages open from the header here, not the floating button. */
body .ac-fab { display: none !important; }

/* Focus you can see, and no movement for people who'd rather not. */
.pt-app :focus-visible, .pt-nav :focus-visible, .pt-sheet :focus-visible, .btn:focus-visible { outline: 3px solid var(--pt-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .btn:active { transform: none !important; }
    .pt-sos.active { animation: none; }
    /* v4.87 (redesign stage 9, reduced-motion pass): no fades on buttons either. */
    *, *::before, *::after { transition: none !important; }
}

.card {
    background: var(--pt-card);
    border: 1px solid var(--pt-line);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: var(--pt-card-shadow);
}

.card h3 {
    margin-top: 0;
    color: var(--portal-text);
}

/* Glove-friendly: riders tap these in bike gloves, often in the rain.
   48px minimum height + bigger text = far fewer mis-taps. */
/* v4.16: operational confirmations (sign for pickup, confirm a job, save a
   signature) stay GREEN, as riders know them. Red is kept for the one
   main shift button and for emergencies, so a confirm never looks like
   the SOS. */
.btn {
    background: var(--pt-go-btn);   /* v4.46 - audit U6: was #1f8a4c (white text 4.4:1, now 5.1:1) */
    color: var(--pt-on-fill);
    border: none;
    padding: 14px 16px;
    min-height: 52px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    margin-top: 8px;
    letter-spacing: 0;
    font-family: inherit;
}

.btn:hover {
    background: var(--pt-go-btn-hover);
}

.btn:disabled { opacity: 0.6; cursor: progress; }

.btn:active {
    transform: scale(0.985);
}

.btn-secondary {
    background: var(--portal-surface-2);
    border: 1px solid var(--portal-line-strong);
    color: var(--portal-text);
}

.btn-secondary:hover {
    background: var(--pt-raised-hover);
}

/* Navigation links inside job cards - same glove-friendly sizing.
   48px to match .btn: this is tapped in gloves, in the rain, often in a
   hurry, and it was the one undersized target left in the portal. */
.nav-link {
    padding: 12px 14px !important;
    font-size: 14px !important;
    min-height: 48px;
    display: inline-flex !important;
    align-items: center;
    border-radius: 10px;
}

/* Toasts. The base look comes from style.css; these overrides put them
   where a phone user can actually see them (full width, above the thumb)
   instead of a 300px box in the bottom-right corner. */
/* v4.37 - messages drop in below the top bar (Home's SOS / the job
   screen's < All jobs · SOS), not over the job's buttons at the bottom
   (phone audit P13). Never over SOS. */
#toast-container {
    left: 12px;
    right: 12px;
    top: calc(env(safe-area-inset-top, 0px) + 132px);
    bottom: auto;
    align-items: stretch;
}

#toast-container .toast {
    max-width: none;
    font-size: 1rem;
    padding: 14px 18px;
    transform: translateY(-20px);
}

#toast-container .toast.show {
    transform: translateY(0);
}

.toast.info {
    border-left-color: var(--pt-select);
}

select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    background: var(--pt-field);
    color: var(--portal-text);
    border: 1px solid var(--portal-line-strong);
    font-size: 16px;
    margin-bottom: 12px;
    min-height: 52px;
}

.portal-section {
    margin-top: 14px;
}

.portal-section-title {
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 16px 2px 8px;
}

/* v4.16: calm cards. On shift gets a green edge AND says so in words. */
.portal-status-card {
    border-color: var(--pt-line);
    background: var(--pt-card);
    border-left: 4px solid var(--pt-ok);
}

.portal-status-card.off {
    border-left: 1px solid var(--pt-line);
}

.portal-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}
.pt-shift .portal-card-title { font-size: 26px; line-height: 1.2; margin-bottom: 6px; }

.portal-card-copy {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--pt-text-2);
}
.pt-shift .portal-card-copy { margin-bottom: 0; }

.safety-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* The :hover/:active states are NOT decoration here. `.btn:hover` is
   specificity (0,2,0) and beats a bare `.btn-sos` (0,1,0), so without
   these the emergency button repaints GREEN the moment it is touched -
   the same green as an ordinary confirm. On iOS :hover is applied on tap
   and sticks until something else is tapped, and sendSos() then opens a
   confirm() and waits on geolocation for up to 5s, so a rider would sit
   looking at a green SOS button wondering whether it had fired.
   v3.06 was safe only because the colour was an inline style.
   Stage 3: --portal-red is the same in both themes, so SOS is too. */
.btn-sos,
.btn-sos:hover,
.btn-sos:active,
.btn-sos:focus {
    background: var(--portal-red);
    min-height: 58px;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.22);
}

.btn-safe {
    border-color: rgba(34, 197, 94, 0.58);
    color: var(--pt-ok);
}

/* Same trap, lower stakes: without this a secondary button flips to the
   primary green on tap and reads as the main action.
   NOTE :hover is deliberately NOT in this group. `.btn-secondary:hover`
   earlier in this stylesheet already ties `.btn:hover` on specificity
   and wins on source order, so the green leak is closed without it -
   and grouping :hover here would override that rule and silently cost
   secondary buttons their lighten-on-tap feedback. */
.btn-secondary,
.btn-secondary:active {
    background: var(--portal-surface-2);
}

.rider-job-card {
    border-color: var(--pt-info-line);
    padding: 0;
    overflow: hidden;
}

.rider-job-card.urgent {
    border-color: var(--pt-red-line);
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.16);
}

.job-priority-strip {
    background: var(--portal-red);
    color: var(--pt-on-fill);
    font-weight: 850;
    text-align: center;
    padding: 8px 10px;
    font-size: 13px;
}

.job-body {
    padding: 16px;
}

.job-kicker {
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.job-title {
    color: var(--portal-text);
    font-size: 22px;
    line-height: 1.08;
    margin: 0 0 12px;
}

.job-line {
    border-top: 1px solid var(--pt-line);
    padding-top: 12px;
    margin-top: 12px;
}

.job-label {
    display: block;
    color: var(--portal-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.job-place {
    color: var(--portal-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}

.job-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;   /* v4.36 - was 8px: Confirm and Can't do it too close for a gloved thumb */
    margin: 12px 0;
}

/* v4.39 - audit A5: Confirm is THE button; "Can't do it..." is smaller,
   outlined and well below it, so a hurried thumb can't hit the wrong one.
   Stage 3: Confirm 56px (main action), Can't do it 48px (tap target). */
.job-actions.job-ack {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 26px;
}
.job-ack .btn-ack-yes {
    background: var(--pt-go);
    margin-top: 0;
    min-height: 56px;
    font-size: 18px;
}
.job-ack .btn-ack-no {
    background: transparent;
    color: var(--pt-red-text);
    border: 1.5px solid var(--pt-red-line);
    margin: 0 auto;
    width: auto;
    min-width: 60%;
    min-height: 48px;
    font-size: 15px;
}

/* Standing directions for a door - how to get from the door to the ward
   (v3.29). Blue, not amber: this is help, not a warning, and it must not
   compete with the controller's instructions above it. */
.job-door-note {
    margin-top: 8px;
    padding: 8px 10px;
    border-left: 3px solid var(--pt-info);
    background: var(--pt-info-tint);
    border-radius: 0 8px 8px 0;
    color: var(--pt-text-2);
    font-size: 13px;
    line-height: 1.45;
}

.job-note {
    background: var(--pt-warn-tint);
    border: 1px solid var(--pt-warn-line);
    color: var(--pt-warn);
    padding: 10px 12px;
    border-radius: 10px;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.35;
}

/* v3.64 - simple job cards in the list, and one job at a time full screen. */
.js-compact { cursor: pointer; }
.js-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* v4.48 - audit U15: the place is the headline; the job code is small. */
.js-ref { font-size: 15px; font-weight: 700; color: var(--pt-muted); margin-right: 4px; letter-spacing: 0.02em; }
.js-tag { color: var(--pt-on-fill); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.js-next { margin: 8px 0 4px; font-size: 22px; font-weight: 700; line-height: 1.3; color: var(--pt-text); }
.js-verb {
    display: inline-block; margin-right: 8px; padding: 2px 9px; border-radius: 6px;
    background: var(--pt-now-fill); color: var(--pt-on-now); font-size: 13px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.04em; vertical-align: 2px;
}
.js-warn { color: var(--pt-warn); font-weight: 600; font-size: 14px; margin-top: 4px; }
.js-open { margin-top: 12px; font-size: 17px; }
#job-sheet {
    display: none; position: fixed; inset: 0; z-index: 90;   /* under .modal (100): signature/hand-over windows open on top */
    background: var(--pt-bg); color: var(--pt-text); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
body.js-sheet-open { overflow: hidden; }
/* v4.11 - room at the bottom so the message button never sits on the last button */
.js-sheet-inner { max-width: 560px; margin: 0 auto; padding: 12px 16px 130px; }
/* v4.36 - pinned, so the job screen's SOS never scrolls out of reach. */
.js-top {
    display: flex; align-items: center; gap: 8px; margin: -12px 0 10px; padding: 12px 0 8px;
    position: sticky; top: 0; z-index: 5; background: var(--pt-bg);
}
.js-top .btn { width: auto; margin: 0; min-height: 48px; padding: 8px 14px; }
.js-back { font-size: 16px; }
.js-count { flex: 1; text-align: center; color: var(--pt-muted); font-weight: 600; }
.js-sos { background: var(--portal-red) !important; color: var(--pt-on-fill); font-weight: 800; }
.js-title { margin: 8px 0 12px; font-size: 22px; }
.js-stepper { display: flex; align-items: center; margin: 0 0 14px; }
.js-step { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--pt-muted); font-size: 15px; }
.js-step span {
    width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--pt-raised); color: var(--pt-text); font-weight: 800;
}
.js-step.done { color: var(--pt-ok); }
.js-step.done span { background: var(--pt-go); color: var(--pt-on-fill); }
.js-step.now { color: var(--pt-text); }
.js-step.now span { background: var(--pt-now-fill); color: var(--pt-on-now); }
.js-step-line { flex: 1; height: 3px; background: var(--pt-line); margin: 0 10px; border-radius: 2px; }
.js-confirm { background: var(--pt-warn-tint); border: 1px solid var(--pt-warn-line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-weight: 600; }
.js-now { background: var(--pt-card); border: 2px solid var(--pt-now); border-radius: 14px; padding: 16px; }
.js-now-label { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pt-now); }
/* v4.45 - audit U1: an offered job shows only what it is, then Confirm. */
.js-offer { background: var(--pt-card); border: 2px solid var(--pt-line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.js-offer-row { margin: 10px 0 0; font-size: 18px; line-height: 1.35; color: var(--pt-text); }
.js-offer-row span { display: block; font-size: 15px; font-weight: 700; color: var(--pt-muted); }
/* v4.51 - what3words added in Edit job: a button by the place, and a line on an offer */
.js-w3w { display: inline-flex; align-items: center; gap: 2px; width: auto; min-height: 48px; margin: 4px 0 6px; padding: 8px 14px; text-decoration: none; font-size: 17px; font-weight: 700; }
.js-w3w-mark { color: var(--pt-sos); font-weight: 800; }
.js-offer-w3w { display: block; font-style: normal; font-size: 16px; font-weight: 700; color: var(--pt-red-text); margin-top: 2px; }
.js-offer-after { font-size: 16px; color: var(--pt-text-2); text-align: center; margin: 4px 0 10px; }
.js-place { font-size: 24px; font-weight: 800; line-height: 1.25; margin: 6px 0 8px; color: var(--pt-text); }
.js-nav { display: inline-block; width: auto; text-decoration: none; margin: 4px 0 6px; }
.js-hint { font-size: 17px; line-height: 1.4; margin: 10px 0 14px; color: var(--pt-text); }
.js-primary { font-size: 20px; min-height: 60px; font-weight: 800; }
.js-extra .btn, .js-extra a.btn { margin-top: 10px; }
.js-extra a.btn { display: block; text-align: center; text-decoration: none; }
.js-details { margin-top: 16px; }
.js-details summary { cursor: pointer; color: var(--pt-info); font-weight: 600; padding: 8px 0; min-height: 48px; display: flex; align-items: center; }
.js-done { font-size: 54px; text-align: center; margin-top: 30px; }
.js-restbtn { text-align: left; margin-top: 8px; }
/* v4.36 - where the job goes after this step, and the rarely-needed
   "Nothing to collect", set well apart from "Arrived - all OK". */
.js-then { margin: 0 0 8px; color: var(--pt-text-2); font-size: 15px; }
.js-then strong { color: var(--pt-text); }
.js-problem { margin-top: 26px; padding-top: 14px; border-top: 1px dashed var(--pt-line); }
.js-problem p { margin: 0 0 4px; color: var(--pt-muted); font-size: 14px; }
.js-problem .btn { background: transparent; border: 1px solid var(--pt-line-strong); color: var(--pt-text-2); font-weight: 600; }

/* v3.63 - a relay spelled out as numbered steps for the volunteer. */
.relay-steps {
    background: var(--pt-relay-tint);
    border: 1px solid var(--pt-relay-line);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 12px 0;
}
.relay-steps h4 { margin: 0 0 8px; font-size: 16px; color: var(--pt-relay-text); }
.relay-steps ol { margin: 0; padding-left: 0; list-style: none; counter-reset: rs; }
.relay-steps li {
    counter-increment: rs;
    position: relative;
    padding: 6px 0 8px 38px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--pt-text);
}
.relay-steps li::before {
    content: counter(rs);
    position: absolute; left: 0; top: 4px;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--pt-relay-fill); color: var(--pt-on-fill);
    font-weight: 800; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.relay-steps li.done { color: var(--pt-muted); }
.relay-steps li.done::before { content: "✓"; background: var(--pt-go); }
.relay-steps li.now { font-weight: 600; }
.relay-steps li.now::before { box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.75); }
.relay-steps .btn { width: auto; min-height: 48px; padding: 7px 14px; font-size: 14px; margin: 6px 6px 0 0; text-decoration: none; display: inline-block; }
.relay-steps .rs-note { margin: 8px 0 0; font-size: 14px; color: var(--pt-warn); }

.job-success {
    color: var(--pt-ok);
    font-weight: 750;
    margin: 10px 0 0;
}

.empty-state {
    text-align: center;
    color: var(--portal-muted);
    padding: 20px 14px;
}

/* Modal for Signature */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    max-height: none;   /* v4.36 - style.css caps .modal at 80vh on phones; the portal's windows use the whole screen */
    padding: 0;         /* v4.37 - ...and pads it by 20px, which pushed the rota window off the right edge */
    background-color: var(--pt-overlay-strong);
    overflow-y: auto;
}

.modal-content {
    background-color: var(--portal-surface);
    color: var(--pt-text);
    margin: 18px auto;
    padding: 20px;
    border: 1px solid var(--portal-line);
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
}

/* The signature pad: a white pad with dark ink in BOTH themes (the person
   signing must see their signature exactly as it is saved). */
canvas {
    background: #FFFFFF;
    border-radius: 4px;
    width: 100%;
    height: 200px;
    touch-action: none;
    cursor: crosshair;
}

/* v4.36 - Save and Cancel stay at the bottom of the screen however long
   the window is; Clear moved up beside the pad, away from Save. */
.signature-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    position: sticky; bottom: 0; z-index: 2;
    padding: 10px 0 12px; background: var(--portal-surface);
    box-shadow: var(--pt-edge-shadow);
}
.sig-pad-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.sig-pad-head .btn { width: auto; margin: 0 0 6px auto; min-height: 48px; padding: 6px 14px; font-size: 14px; }
.sig-check-row { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-top: 10px; font-size: 16px; color: var(--pt-text-2); cursor: pointer; }
.sig-check-row input { width: 26px; height: 26px; margin: 0; flex: none; }
/* v4.37 - a "?" after a full-width button sits beside it, not on a line of its own (P14) */
#safety-container .btn:has(+ .help-q), #activity-container .btn:has(+ .help-q) { display: inline-block; width: calc(100% - 50px); vertical-align: middle; }
/* v4.46: 12px clear (the "?" now has a 10px invisible edge, which must not reach the button) */
#safety-container .btn + .help-q, #activity-container .btn + .help-q { vertical-align: middle; margin: 12px 0 0 12px; }
/* ...and Home shows the noticeboard once: the news card when there is news, the row when not. */
body:has(#team-notices .tp-nb) [data-panel="home"] .pt-row-card[onclick="openNoticeboard()"] { display: none; }
/* v4.37 - windows never wider than the phone (the rota's ran ~9px off the
   right edge), and the rota's title bar with its Close stays in view (P7). */
.modal-content { box-sizing: border-box; }
#rota-modal h3 { position: sticky; top: 0; z-index: 3; background: var(--portal-surface); margin: -20px -20px 10px; padding: 14px 20px 10px; border-radius: 16px 16px 0 0; }
#rota-modal h3 .btn { min-height: 48px; min-width: 48px; }
/* v4.37 - signed out with nothing to show: no empty "Current jobs" heading (P15).
   A "sign in again" card in the list still shows the section. */
body:not(.pt-signed-in) #pt-jobs-section:not(:has(#jobs-container > *)) { display: none; }
/* v4.37 - vehicle check rows (were 13px boxes 27px apart) */
.vc-row { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 16px; color: var(--pt-text-2); cursor: pointer; border-bottom: 1px solid var(--pt-line); }
.vc-row input { width: 24px; height: 24px; margin: 0; flex: none; }

.input-group {
    margin-top: 10px;
}

.input-group input {
    width: calc(100% - 22px);
    padding: 10px;
    border-radius: 4px;
    background: var(--pt-field);
    color: var(--pt-text);
    border: 1px solid var(--portal-line);
}

/* Help centre */
.help-item {
    border: 1px solid var(--portal-line);
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--pt-field);
    overflow: hidden;
}

.help-item>summary {
    cursor: pointer;
    padding: 11px 12px;
    min-height: 48px;
    font-weight: 600;
    font-size: 15px;
    color: var(--portal-text);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.help-item>summary::-webkit-details-marker {
    display: none;
}

/* Stage 3: the open/closed chevron is drawn in CSS (it was a Font Awesome
   glyph, which showed as an empty box once that font went in stage 2). */
.help-item>summary::after {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin: 0 4px 4px 12px;
    border-right: 2px solid var(--portal-muted);
    border-bottom: 2px solid var(--portal-muted);
    transform: rotate(45deg);
}

.help-item[open]>summary::after {
    transform: rotate(-135deg);
    margin-bottom: -4px;
}

.help-text {
    padding: 0 12px 12px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--pt-muted);
}

.help-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pt-info);
    margin: 14px 0 6px;
}

@media (max-width: 430px) {
    /* v4.16: the old header and button-grid rules went with the redesign. */
    .pt-greet h1 { font-size: 24px; }

    .job-actions {
        grid-template-columns: 1fr;
    }

    .signature-controls {
        flex-direction: column;
    }
}

/* REMOVED (v3.08): a duplicate `body .modal` block and a pair of
   `body .modal[style*="display: block"]` selectors.
   Every modal on this page is opened by setting element.style.display
   directly, and an inline style already outranks any stylesheet rule -
   so the override did nothing. It was worse than dead weight: the item
   selector opens with display:FLEX (itemSelector.js), which those
   attribute selectors never matched. Anyone later adding !important to
   the hide rule, or switching a modal to class-based opening, would have
   silently stopped the item selector appearing mid-job. The single
   `.modal` rule earlier in this stylesheet is the one that applies. */

/* v3.89 - the Artery card fills a phone held upright: it is the screen
   people are shown, so no scrolling and nothing cut off. Sizes follow
   the visible height (dvh) so a short phone shrinks the photo and QR
   rather than pushing the QR off the bottom. The QR keeps its white
   ground and the photo its white frame in both themes. */
#artery-card-overlay {
    position: fixed; inset: 0; z-index: 100000; background: var(--pt-bg);
    display: flex; justify-content: center; overflow: hidden;
}
.ac-card {
    width: 100%; max-width: 480px; height: 100vh; height: 100dvh; box-sizing: border-box;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: max(10px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom));
    color: var(--pt-text); background: var(--pt-card); border-left: 1px solid var(--pt-line); border-right: 1px solid var(--pt-line);
}
.ac-top { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex: none; }
.ac-brand { font-weight: 800; font-size: 1rem; letter-spacing: 0.5px; color: var(--pt-sos); }
.ac-close { background: var(--pt-raised); color: var(--pt-text); border: none; border-radius: 8px; padding: 8px 14px; min-height: 48px; font: inherit; font-weight: 600; cursor: pointer; }
#artery-card-body { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; }
.ac-group { font-size: clamp(1rem, 2.6dvh, 1.35rem); font-weight: 800; line-height: 1.2; }
.ac-photo { height: clamp(90px, 21dvh, 210px); aspect-ratio: 7 / 9; object-fit: cover; border-radius: 12px; border: 3px solid #FFFFFF; background: var(--pt-raised);
            display: flex; align-items: center; justify-content: center; font-size: clamp(2rem, 7dvh, 4rem); font-weight: 800; color: var(--pt-text-2); }
.ac-name { font-size: clamp(1.3rem, 4dvh, 2rem); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.ac-sub { font-size: clamp(0.9rem, 2.1dvh, 1.1rem); color: var(--pt-text-2); }
.ac-status { color: var(--pt-ok); font-weight: 800; font-size: clamp(0.95rem, 2.3dvh, 1.2rem); }
.ac-clock { font-size: clamp(1.8rem, 6dvh, 3rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; line-height: 1; }
.ac-qr { background: #FFFFFF; border-radius: 12px; padding: 6px; height: clamp(150px, 31dvh, 300px); aspect-ratio: 1 / 1; box-sizing: border-box; }
.ac-qr svg { width: 100%; height: 100%; display: block; }
.ac-note { font-size: clamp(0.78rem, 1.8dvh, 0.95rem); color: var(--pt-muted); margin: 0; }
/* v3.89 - the moving stripe on the Artery card. A screenshot can't move.
   (Its own red and orange, the same in both themes.) */
.artery-card-live {
    width: 100%; height: 8px; border-radius: 4px; flex: none;
    background: linear-gradient(90deg, #b91c1c 0%, #f97316 25%, #b91c1c 50%, #f97316 75%, #b91c1c 100%);
    background-size: 200% 100%;
    animation: artery-card-move 2.4s linear infinite;
}
@keyframes artery-card-move { from { background-position: 0 0; } to { background-position: -200% 0; } }

/* ---- v4.45 - audit U4: no small print ---------------------------------
   Nothing under 14px, reading text 16px, tab labels 14px. Done as one
   block of minimums here rather than in each rule, so it is easy to see
   and to undo. The inline styles in the page and in the scripts' HTML are
   caught by what they say ([style*=...]). The rota grid is left alone:
   U5 replaces it with a simple list for volunteers. */
.pt-kicker, .pt-strip-text small, .pt-chev, .pt-row-label small, .pt-foot, .pt-sheet-note,
.js-tag, .js-verb, .portal-section-title, .job-kicker, .job-label, .help-group-title,
.pt-nav-btn, .job-priority-strip { font-size: 14px; }
.help-text, .portal-card-copy, .pt-explain, .job-note { font-size: 16px; }
.help-text { color: var(--pt-text-2); }
/* a button or box with no size of its own gets the browser's 13.3px */
button, select, input, textarea { font-size: 16px; }
#vehicle-locations h3 { font-size: 16px; }
.pt-explain { margin: 8px 2px 0; line-height: 1.4; color: var(--pt-text-2); text-align: center; }
#portal-logout-wrap .pt-explain { margin-top: 10px; }
body :not(#rota-modal *):is(
    [style*="font-size:11"], [style*="font-size: 11"], [style*="font-size:12"], [style*="font-size: 12"],
    [style*="font-size:13"], [style*="font-size: 13"],
    [style*="font-size:0.5"], [style*="font-size:0.6"], [style*="font-size:0.7"], [style*="font-size:0.8"],
    [style*="font-size: 0.5"], [style*="font-size: 0.6"], [style*="font-size: 0.7"], [style*="font-size: 0.8"],
    [style*="font-size:.5"], [style*="font-size:.6"], [style*="font-size:.7"], [style*="font-size:.8"]
) { font-size: 14px !important; }
/* the red count on a tab or bell stays small: it is a badge, not words */
.pt-badge { font-size: 12px !important; }

/* ---- v4.46 - audit U7: the "?" is easy to press (44px) ----
   Visibly a little bigger (24px, was 17px) with a 10px invisible edge, and
   10px clear of whatever it sits beside, so its edge never lands on a
   neighbouring button. (help.css keeps the alarms' "?" exactly its size;
   the portal has no alarm pop-ups.) */
.help-q, .help-page-rider .help-q { width: 24px; height: 24px; min-width: 24px; min-height: 24px; margin-left: 10px; font-size: 14px; opacity: 0.7; }
.help-q::after, .help-page-rider .help-q::after { inset: -10px; }
.pt-small-btn { min-height: 48px; margin-top: 10px; font-size: 16px; }
/* v4.46 - audit U8: labels above boxes */
/* v4.47 - audit U12: Log hours (and Step back) had tiny date/time pickers
   (about 125x25px). Now full width, 52px tall, big digits, and the picker
   drawn in the theme's own style so it matches. */
#loghours-modal input[type="date"], #loghours-modal input[type="time"], #loghours-modal select,
#availability-modal input[type="date"], #availability-modal select {
    display: block; width: 100%; min-height: 52px; box-sizing: border-box; margin: 4px 0 14px;
    padding: 10px 12px; font-size: 18px; border-radius: 10px; border: 2px solid var(--pt-line);
    background: var(--pt-field); color: var(--pt-text); color-scheme: var(--pt-scheme);
}
#loghours-modal label, #availability-modal label { font-size: 16px !important; font-weight: 700; }
.pt-field-error { margin: 8px 0 0; min-height: 0; font-size: 16px; font-weight: 700; color: var(--pt-red-text); text-align: center; line-height: 1.4; }
.pt-field-error:empty { display: none; }
#rider-pin[aria-invalid="true"] { border-color: var(--pt-sos) !important; box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.35); }
.pt-field-label { display: block; text-align: left; font-size: 16px; font-weight: 700; color: var(--pt-text, #e6edf3); margin: 0 0 6px; }

/* ---- v4.46 - audit U5: the simple shift list (rotasimple.js) ---- */
.rs-h { font-size: 20px; font-weight: 800; margin: 6px 0 10px; color: var(--pt-text, #e6edf3); }
.rs-h:not(:first-child) { margin-top: 24px; }
.rs-empty { font-size: 16px; color: var(--pt-text-2, #c9d1d9); margin: 0 0 8px; }
.rs-step { font-size: 16px; font-weight: 700; margin: 12px 0 8px; color: var(--pt-text, #e6edf3); }
.rs-mine { background: var(--pt-card); border: 2px solid var(--pt-line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.rs-when { font-size: 19px; font-weight: 800; color: var(--pt-text); }
.rs-what { font-size: 16px; color: var(--pt-text-2); margin-top: 4px; }
.rs-cover { font-size: 16px; color: var(--pt-warn); font-weight: 700; margin: 10px 0 0; }
.rs-btn { display: block; width: 100%; min-height: 52px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; text-align: center; box-sizing: border-box; }
.rs-btn-amber { background: var(--pt-warn-tint); color: var(--pt-warn); border: 2px solid var(--pt-warn-line); }
.rs-btn-quiet { background: transparent; color: var(--pt-text); border: 2px solid var(--pt-line-strong); }
.rs-remove { min-height: 48px; font-size: 16px; font-weight: 600; color: var(--pt-text-2); }
.rs-days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rs-day { min-height: 56px; padding: 8px 6px; border-radius: 12px; border: 2px solid var(--pt-line); background: var(--pt-card); color: var(--pt-text); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.rs-day.on { border-color: var(--pt-select); background: var(--pt-select-tint); color: var(--pt-text); }
.rs-blocks { display: grid; gap: 10px; }
.rs-block { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 64px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--pt-line); background: var(--pt-card); color: var(--pt-text); font: inherit; text-align: left; cursor: pointer; }
.rs-block-time { font-size: 20px; font-weight: 800; }
.rs-block-sub { font-size: 16px; color: var(--pt-text-2); }
.rs-block.short { border-color: var(--pt-red-line); }
.rs-block.short .rs-block-sub { color: var(--pt-red-text); font-weight: 700; }
.rs-block.mine { border-color: var(--pt-ok); cursor: default; opacity: 1; }
.rs-block.mine .rs-block-sub { color: var(--pt-ok); font-weight: 700; }
.rs-grid-toggle { margin: 22px 0 4px; }
#rs-back { position: fixed; inset: 0; z-index: 2147482000; background: var(--pt-overlay-strong); display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
#rs-box { width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--pt-card); color: var(--pt-text); border: 1px solid var(--pt-line); border-radius: 18px; padding: 22px 20px 20px; box-sizing: border-box; box-shadow: var(--pt-shadow); }
#rs-title { margin: 0; font-size: 22px; font-weight: 800; }
.rs-box-sub { margin: 4px 0 14px; font-size: 17px; color: var(--pt-text-2); }
.rs-box-q { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.rs-btn-big { min-height: 60px; font-size: 18px; border: 0; color: var(--pt-on-fill); }
.rs-rider { background: var(--pt-go-btn); }
.rs-driver { background: var(--pt-blue-btn); }
.rs-own { background: var(--pt-neutral-btn); }
.rs-veh { background: var(--pt-go-btn); }
.rs-veh-off { margin-top: 10px; padding: 12px 14px; border: 2px dashed var(--pt-line-strong); border-radius: 12px; font-size: 17px; color: var(--pt-muted); }
.rs-veh-off span { display: block; font-size: 15px; margin-top: 2px; }
#rs-box .rs-cancel { margin-top: 22px; }
/* ---- v4.59 - the rota redesign: Book a shift form + Where help is needed ---- */
.rs-form { background: var(--pt-card); border: 2px solid var(--pt-line); border-radius: 14px; padding: 14px; transition: border-color .4s, box-shadow .4s; }
.rs-form.rs-flash { border-color: var(--pt-select); box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.35); }
.rs-flabel { display: block; font-size: 16px; font-weight: 700; color: var(--pt-text); margin: 12px 0 6px; }
.rs-flabel:first-child { margin-top: 0; }
.rs-fdays { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.rs-fday, .rs-frole { min-height: 52px; padding: 8px 6px; border-radius: 12px; border: 2px solid var(--pt-line); background: var(--pt-field); color: var(--pt-text); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.rs-fday.on, .rs-frole.on { border-color: var(--pt-select); background: var(--pt-select-tint); color: var(--pt-text); }
.rs-finput { width: 100%; box-sizing: border-box; min-height: 52px; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--pt-line); background: var(--pt-field); color: var(--pt-text); font: inherit; font-size: 18px; color-scheme: var(--pt-scheme); }
.rs-finput:focus { outline: none; border-color: var(--pt-select); }
.rs-ftimes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rs-froles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rs-fsum { margin: 14px 0 0; font-size: 17px; font-weight: 700; color: var(--pt-ok); }
.rs-fwarn { margin: 14px 0 0; font-size: 16px; font-weight: 700; color: var(--pt-red-text); }
.rs-fgo[disabled] { opacity: .45; cursor: not-allowed; }
.rs-hsub { font-weight: 400; color: var(--pt-text-2); margin-top: -4px; }
.rs-hday { background: var(--pt-card); border: 2px solid var(--pt-line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.rs-hday.urgent { border-color: var(--pt-red-line); }
.rs-hhead { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.rs-hname { font-size: 18px; font-weight: 800; color: var(--pt-text); }
.rs-hurgent { display: inline-block; margin-top: 3px; background: var(--pt-red); color: var(--pt-on-fill); font-size: 13px; font-weight: 800; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; }
.rs-hextra { margin: 2px 0 6px; font-size: 15px; color: var(--pt-warn); }
.rs-hgap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--pt-line); }
.rs-htime { font-size: 18px; font-weight: 800; color: var(--pt-text); min-width: 7.5em; }
.rs-hneed { font-size: 16px; font-weight: 700; color: var(--pt-warn); flex: 1 1 auto; }
.rs-hgap.gap .rs-hneed { color: var(--pt-red-text); }
.rs-hbtn { min-height: 48px; padding: 8px 16px; border-radius: 12px; border: 0; background: var(--pt-go-btn); color: var(--pt-on-fill); font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; }
.rs-hmine { font-size: 15px; color: var(--pt-ok); font-weight: 700; }
.rs-hfine { font-size: 17px; font-weight: 700; color: var(--pt-ok); margin: 0 0 8px; }
.rs-who { margin-top: 22px; border: 2px solid var(--pt-line); border-radius: 14px; padding: 4px 14px 12px; }
.rs-who > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-size: 17px; font-weight: 700; color: var(--pt-text); }
.rs-hday .rp-cap { display: none; }

/* Account → Text size. Everything grows together, buttons included. */
html[data-text="large"] body { zoom: 1.15; }
html[data-text="xl"] body { zoom: 1.3; }
.pt-textsize { cursor: default; }
.ts-btns { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.ts-btn { flex: 1 1 0; min-height: 48px; min-width: 84px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--pt-line, #30363d);
    background: transparent; color: var(--pt-text, #e6edf3); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.ts-btn[aria-pressed="true"] { border-color: var(--pt-select); background: var(--pt-select-tint); }

/* Stage 3: Account -> Display (portaltheme.js): Auto (day and night) /
   Always light / Always dark. Built like Text size, from the same buttons. */
.pt-display { cursor: default; }
.pt-display .ts-btn { min-width: 96px; }
#ptheme-now { display: block; color: var(--pt-text-2); font-size: 14px; margin-top: 2px; }
#ptheme-now:empty { display: none; }

/* =====================================================================
   Stage 3: style.css is shared with the Map view console and paints a few
   things the portal uses in the console's dark colours. In the day theme
   they follow the portal's tokens instead. (At night they stay exactly as
   they were, so these are scoped to the light theme.)
   ===================================================================== */
:root[data-theme="light"] h3 { color: var(--pt-muted); }
:root[data-theme="light"] .card h3 { color: var(--pt-text); }
:root[data-theme="light"] .lbl { color: var(--pt-muted); }
:root[data-theme="light"] .input-std {
    background: var(--pt-field); border-color: var(--pt-line-strong); color: var(--pt-text);
}
:root[data-theme="light"] .input-std:focus { background: var(--pt-field); border-color: var(--pt-focus); }
:root[data-theme="light"] .input-std option { background: var(--pt-field); color: var(--pt-text); }
:root[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
:root[data-theme="light"] textarea {
    background-color: var(--pt-field); color: var(--pt-text); border-color: var(--pt-line-strong);
}
:root[data-theme="light"] .toast {
    background: var(--pt-card); color: var(--pt-text); box-shadow: var(--pt-shadow);
    border-top: 1px solid var(--pt-line); border-right: 1px solid var(--pt-line); border-bottom: 1px solid var(--pt-line);
}
:root[data-theme="light"] .card:hover { background: var(--pt-card); box-shadow: var(--pt-shadow); }
:root[data-theme="light"] .sk-line {
    background: linear-gradient(90deg, rgba(10, 24, 48, 0.06) 25%, rgba(10, 24, 48, 0.12) 37%, rgba(10, 24, 48, 0.06) 63%);
    background-size: 400% 100%;
}
:root[data-theme="light"] .modal { border-color: transparent; box-shadow: none; }
:root[data-theme="light"] .modal-content { box-shadow: var(--pt-shadow); }
:root[data-theme="light"] a:not(.btn):not(.pt-row):not(.pt-tile) { color: var(--pt-info); }

/* =====================================================================
   v4.75 - Job mode (jobmode.js, redesign stage 4). A full-screen layer over
   the portal while a confirmed job is on: above the header (70) and the tab
   bar (80), UNDER the job screen (#job-sheet, 90), the signature and other
   windows (.modal, 100), the SOS / offline banners (6000+), the messages
   button (9000) and the big questions (askbox). Everything is a token, so the
   day and night themes both work.
   ===================================================================== */
#jobmode {
    display: none; position: fixed; inset: 0; z-index: 85;
    background: var(--pt-bg); color: var(--pt-text); overflow-y: auto; -webkit-overflow-scrolling: touch;
}
body.jm-on { overflow: hidden; }
.jm-inner { max-width: 560px; margin: 0 auto; padding: 0 14px 150px; }
.jm-top {
    position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
    margin: 0 -14px 10px; padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    background: var(--pt-nav-bg); border-bottom: 1px solid var(--pt-line);
}
.jm-top .btn { width: auto; margin: 0; min-height: 56px; min-width: 64px; padding: 8px 14px; }
.jm-top-words { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.jm-badge { align-self: flex-start; background: var(--pt-now-fill); color: var(--pt-on-now); font-weight: 800; font-size: 12px; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; }
.jm-sum { font-size: 18px; font-weight: 700; }
.jm-stand { margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; background: var(--pt-warn-tint); border: 1px solid var(--pt-warn-line); color: var(--pt-warn); font-weight: 700; font-size: 15px; }
.jm-sugg { margin: 0 0 10px; font-size: 14px; color: var(--pt-text-2); }
.jm-stop { background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.jm-stop:not(.cur) { background: transparent; border-style: dashed; border-color: var(--pt-line-strong); }
.jm-stop-head { padding: 12px 16px; }
.jm-stop.cur .jm-stop-head { background: var(--pt-raised); }
.jm-stop-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pt-muted); }
.jm-stop.cur .jm-stop-label { color: var(--pt-now); }
.jm-stop-name { font-size: 21px; font-weight: 800; margin-top: 2px; line-height: 1.25; }
.jm-stop:not(.cur) .jm-stop-name { font-size: 18px; color: var(--pt-text-2); }
.jm-w3w { font-size: 15px; font-weight: 700; color: var(--pt-red-text); margin-top: 2px; }
.jm-count { padding: 10px 16px 0; }
.jm-seg { display: flex; gap: 6px; }
.jm-seg i { flex: 1; height: 8px; border-radius: 4px; background: var(--pt-warn); }
.jm-seg i.ok { background: var(--pt-ok); }
.jm-count p { margin: 8px 0 0; font-size: 15px; font-weight: 700; color: var(--pt-warn); }
.jm-nav { display: block; width: auto; margin: 10px 16px 0; text-align: center; text-decoration: none; }
.jm-task { padding: 12px 16px; border-top: 1px solid var(--pt-line); }
.jm-task-head { font-size: 16px; line-height: 1.35; }
.jm-verb { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; vertical-align: 2px; }
.jm-verb.c { background: var(--pt-now-fill); color: var(--pt-on-now); }
.jm-verb.d { background: var(--pt-blue-btn); color: var(--pt-on-fill); }
.jm-urgent { display: inline-block; background: var(--pt-red); color: var(--pt-on-fill); font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 5px; vertical-align: 2px; }
.jm-what { font-size: 15px; margin-top: 3px; color: var(--pt-text); }
.jm-after { font-size: 14px; color: var(--pt-text-2); margin-top: 2px; }
.jm-now { background: var(--pt-raised); }
.jm-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.jm-btns .btn { margin: 0; }
.jm-primary { font-size: 19px; min-height: 60px; font-weight: 800; }
.jm-link { background: none; border: 0; color: var(--pt-info); font: inherit; font-size: 15px; text-decoration: underline; min-height: 44px; padding: 6px; cursor: pointer; align-self: center; }
.jm-done { display: flex; gap: 10px; align-items: center; color: var(--pt-ok); font-size: 15px; }
.jm-alert { background: var(--pt-red-tint); }
.jm-not { margin: 8px 0 0; color: var(--pt-red-text); font-weight: 700; }
.jm-choose { display: block; width: calc(100% - 32px); margin: 4px 16px 14px; }
.jm-offer { background: var(--pt-card); border: 2px solid var(--pt-now); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.jm-offer .jm-stop-label { color: var(--pt-now); }
.jm-offer-ref { font-size: 19px; font-weight: 800; margin: 4px 0 2px; }
.jm-foot { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: 6px; }
.jm-out-btn { color: var(--pt-muted); }
.jm-alldone { text-align: center; padding-top: 60px; }
.jm-done-big { font-size: 64px; color: var(--pt-ok); }
.jm-done-big .ui-icon { width: 64px; height: 64px; }
.jm-alldone h2 { margin: 10px 0 6px; font-size: 24px; }
.jm-alldone p { color: var(--pt-text-2); font-size: 16px; margin: 0 0 22px; }
/* Stepped out ("Show everything"): the way back, clear of the tab bar and the messages button. */
#jobmode-bar {
    display: none; position: fixed; left: 12px; right: 80px; bottom: calc(var(--pt-nav-h) + 10px); z-index: 82;
    align-items: center; gap: 10px; min-height: 58px; padding: 8px 14px; border: 0; border-radius: 14px;
    background: var(--pt-now-fill); color: var(--pt-on-now); font: inherit; text-align: left; cursor: pointer;
    box-shadow: var(--pt-shadow);
}
#jobmode-bar span { display: flex; flex-direction: column; font-size: 17px; }
#jobmode-bar small { font-size: 14px; font-weight: 600; }
body.jm-out { padding-bottom: 80px; }

/* v4.84 (redesign stage 8, item 3): no accidental pull-to-refresh while a job is on
   screen (job mode, the signature sheet). Elsewhere the portal still pulls to refresh. */
#jobmode,
html:has(> body.jm-on),
html:has(> body.js-sheet-open) { overscroll-behavior-y: contain; }

/* v4.85 (redesign stage 8, item 7): gentle movement. A tapped tab slides in (portalshell.js,
   View Transitions); sheets rise from the bottom. Short, never delaying anything; the SOS
   and alert screens are not animated; all off when the phone asks for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    @keyframes pt-vt-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
    @keyframes pt-vt-out { to { opacity: 0; } }
    @keyframes pt-rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
    ::view-transition-old(root) { animation: .16s ease-out both pt-vt-out; }
    ::view-transition-new(root) { animation: .22s ease-out both pt-vt-in; }
    .pt-sheet { animation: pt-rise .22s ease-out; }
}
