/* MGP Contractor Portal — B2B, desktop-first, light-only. Calibrated to MGP.Admin.Portal/DESIGN.md:
   Technicolor Blue #021EFF (primary), Almost Black #2D2D2D (text/nav), Relaxy Tealy #00B794 (success
   only), Illuminated Grey #E8E8E8 (cards/dividers), muted red #D64545 (error), amber #F2A93B (warning
   band). Outfit for headings, Nunito Sans for body. 8px spacing base. */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;600;700&family=Nunito+Sans:wght@400;600;700&display=swap');

:root {
    --blue: #021EFF;
    --blue-dark: #0014BF;
    /* Tenant entry link (DESIGN.md log): the primary action and link colour. Defaults to MyGatePass blue;
       the layouts override it only when a tenant's colour is set. */
    --brand: var(--blue);
    --brand-dark: var(--blue-dark);
    --ink: #2D2D2D;
    --tealy: #00B794;
    --grey: #E8E8E8;
    --red: #D64545;
    --amber: #F2A93B;
    --muted: #6b6b6b;
    --line: #e2e2e2;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Nunito Sans', system-ui, sans-serif;
    color: var(--ink);
    background: #fff;
    line-height: 1.5;
}

h1, h2, h3 { font-family: 'Outfit', sans-serif; font-weight: 700; margin: 0 0 8px; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── App shell ─────────────────────────────────────────────────────────── */
.appbar {
    display: flex; align-items: center; gap: 24px;
    padding: 0 24px; height: 60px;
    background: var(--ink); color: #fff;
    position: sticky; top: 0; z-index: 10;
}
.logo { display: inline-flex; align-items: center; }
.logo img { height: 34px; width: auto; display: block; }
.appbar__nav { display: flex; gap: 4px; margin-left: 8px; }
.appbar__nav a {
    color: #cfcfcf; padding: 8px 12px; border-radius: var(--radius-md); font-weight: 600; font-size: .92rem;
}
.appbar__nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.appbar__nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.appbar__spacer { flex: 1; }
.appbar__user { color: #cfcfcf; font-size: .9rem; }

.page { max-width: 1120px; margin: 0 auto; padding: 32px 24px; }
.page__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.page__head p { color: var(--muted); margin: 4px 0 0; }

/* ── Auth ──────────────────────────────────────────────────────────────── */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
/* Brand logo anchored top-left; the value block sits centred below it; a footer anchors the base — the
   panel reads as intentional at any size. A faint, whitened logo-mark motif gives the solid blue depth
   without a gradient (DESIGN.md: color-block over gradients; the repeated logo-mark surface pattern is
   the brand-sanctioned texture for a login background). */
.auth-hero {
    position: relative; overflow: hidden;
    background: var(--blue); color: #fff; padding: 56px 64px; display: flex; flex-direction: column;
}
.auth-hero::before {
    content: ""; position: absolute; inset: -20%;
    background: url('../img/MGP-Logo-white.png') repeat; background-size: 132px;
    filter: brightness(0) invert(1);            /* recolour the blue brand mark to white */
    opacity: .06; transform: rotate(-8deg); pointer-events: none;
}
.auth-hero > * { position: relative; z-index: 1; }   /* content sits above the motif */
.auth-hero__logo img { height: 60px; width: auto; display: block; }
.auth-hero__body { margin: auto 0; max-width: 34ch; }
.auth-hero h2 { font-size: 2.6rem; line-height: 1.1; color: #fff; margin: 0 0 16px; }
.auth-hero p { opacity: .85; line-height: 1.6; margin: 0; }
.auth-hero__points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.auth-hero__points li { position: relative; padding-left: 30px; line-height: 1.4; font-weight: 600; }
.auth-hero__points li::before {
    content: "✓"; position: absolute; left: 0; top: -1px;
    width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.18);
    display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700;
}
.auth-hero__foot { margin-top: 32px; font-size: .82rem; opacity: .6; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-main__brand { display: none; margin-bottom: 28px; }   /* shown only when the hero is hidden (mobile) */
.auth-main__brand img { height: 46px; width: auto; display: block; }
/* The sign-in language switcher sits on the LIGHT half of the split, so it cannot borrow the app bar's
   light-on-dark button colours. Same width as the card beneath it, and it follows the page direction. */
.auth-main__lang { width: 100%; max-width: 380px; display: flex; justify-content: flex-end; margin-bottom: 12px; }
.auth-main__lang .appbar__langbtn { color: var(--muted); border-color: var(--grey); min-height: 36px; }
.auth-main__lang .appbar__langbtn:hover { color: var(--ink); border-color: var(--ink); }

.auth-card { width: 100%; max-width: 380px; }
.auth-card__title { margin-bottom: 4px; }
.auth-card__sub { color: var(--muted); margin: 0 0 24px; }
.auth-card__foot { margin-top: 20px; color: var(--muted); font-size: .92rem; }

/* ── Cards / grid ──────────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; background: #fff; }
.card h3 { margin-bottom: 4px; }
.card__muted { color: var(--muted); font-size: .9rem; }

/* Checklist */
.checklist { display: grid; gap: 12px; }
.check { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.check__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; }
.check--done .check__dot { background: var(--tealy); border-color: var(--tealy); }
.check__body { flex: 1; }
.check__body strong { font-family: 'Outfit', sans-serif; }
.check__body span { display: block; color: var(--muted); font-size: .9rem; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field[hidden] { display: none; }
.field__label { font-weight: 600; font-size: .9rem; }
.field__hint { color: var(--muted); font-size: .8rem; }
.field__input, select.field__input {
    height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-md);
    font: inherit; color: var(--ink); background: #fff;
    width: 100%; max-width: 100%;
}
/* A grid item's automatic minimum is its MIN-CONTENT width, and a form control's min-content is
   whatever the browser decides: a <select> is as wide as its longest option, and a file input is as
   wide as the browser's own "Choose file / no file selected" chrome, which is longer in some UI
   languages than in English. Either one could push a track past its container, so the upload modal
   overflowed its own box and clipped the Upload button (live QA, 2026-08-07). Opting these tracks
   out of the automatic minimum lets the controls shrink to the space they actually have. */
.stack > *, .grid-2 > *, .field > * { min-width: 0; }
select.field__input { text-overflow: ellipsis; }
.field__input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
textarea.field__input { height: auto; padding: 10px 12px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 18px; border-radius: var(--radius-md); border: 1px solid transparent;
    font: inherit; font-weight: 700; cursor: pointer; min-width: 44px;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: var(--grey); text-decoration: none; }
.btn--block { width: 100%; }
.btn--sm { height: 32px; padding: 0 12px; font-size: .88rem; }
/* A disabled button looks disabled; a busy one (site.js) stays nearly opaque so its spinner reads. */
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.is-busy:disabled { opacity: .9; cursor: progress; }

/* Busy state (site.js) — spinner + disabled while a form submits, so slow actions give feedback and can't
   be double-clicked. currentColor keeps the spinner legible on primary (white) and ghost (ink) buttons. */
.btn-spinner {
    display: inline-block; width: 14px; height: 14px; margin-inline-end: 8px; vertical-align: -2px;
    border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
    animation: btn-spin .6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn.is-busy, button.is-busy { cursor: progress; opacity: .9; }
[aria-busy="true"] { cursor: progress; }

/* ── Banners / pills ───────────────────────────────────────────────────── */
.banner { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 16px; font-size: .92rem; }
.banner--error { background: #fdecec; color: var(--red); border: 1px solid #f6cccc; }
.banner--success { background: #e6f7f2; color: #06795f; border: 1px solid #b7e8dc; }
.banner--warn { background: #fdf1dd; color: #6b4608; border: 1px solid #f2d9a8; border-inline-start: 3px solid var(--amber); }
.banner--warn ul { margin: 6px 0 0; padding-inline-start: 18px; }
.banner--info { background: #eef0ff; color: var(--blue-dark); border: 1px solid #cfd5ff; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.pill--ok { background: #e6f7f2; color: #06795f; }
.pill--warn { background: #fdf1dd; color: #8a5a12; }
.pill--bad { background: #fdecec; color: var(--red); }
.pill--neutral { background: var(--grey); color: var(--ink); }

/* ── Tables / lists ────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table-wrap { overflow-x: auto; }
.import-preview { margin-top: 16px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.table th { font-family: 'Outfit', sans-serif; font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .5px; }
.table tbody tr:hover { background: #fafafa; }
/* PR7 worker picker: not-yet-verified workers are shown but not selectable (design decision 1B). */
.table tbody tr.is-ineligible { opacity: .55; }
.table tbody tr.is-ineligible:hover { background: transparent; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-lg); }
.empty strong { display: block; font-family: 'Outfit', sans-serif; color: var(--ink); margin-bottom: 4px; }

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions .btn { white-space: nowrap; flex: 0 0 auto; }
.section { margin-top: 28px; }
.section__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* Work-order rows (invite inbox) */
.workorder { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.workorder__body { flex: 1; }
.workorder__body strong { font-family: 'Outfit', sans-serif; }
.workorder__body span { display: block; color: var(--muted); font-size: .88rem; }

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-main__brand { display: block; }   /* keep the brand present once the hero is gone */
    .grid-2 { grid-template-columns: 1fr; }
    /* Decision 5A: the 3 links (1A) stay INLINE at every width — contractors upload documents
       from phones; a nav that disappears breaks the primary journey. */
    .appbar__nav { gap: 2px; margin-left: 4px; }
    .appbar__nav a { padding: 12px 10px; font-size: .85rem; min-height: 44px; display: inline-flex; align-items: center; }
    .appbar__user { display: none; }
}

/* ── Readiness strip (Company page at-a-glance status) ─────────────────────── */
/* ── Company page readiness header (redesign D3/D13): one pill, one sentence, at most one primary. ── */
.readiness { padding: 16px 18px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fafafa; }
.readiness__main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.readiness__sentence { flex: 1 1 260px; margin: 0; font-weight: 600; }
.readiness__cta { min-height: 44px; }
.readiness__venues { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .9rem; }
.readiness__venues li { display: flex; align-items: center; gap: 8px; }
.readiness__events { margin-inline-start: auto; }
.dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--grey); flex: 0 0 auto; }
.dot--pill--ok { background: var(--tealy); }
.dot--pill--bad { background: var(--red); }
.dot--pill--warn { background: var(--amber); }

/* ── Destructive button (DESIGN.md muted red) ─────────────────────────────── */
.btn--danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn--danger:hover { background: var(--red); color: #fff; text-decoration: none; }

/* ── Modal (add forms + delete confirm) ───────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,20,30,.45); display: flex;
    align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.modal-overlay[hidden] { display: none; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto; padding: 22px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal__head h3 { margin: 0; font-family: 'Outfit', sans-serif; }
.modal__close { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted);
    cursor: pointer; padding: 0 4px; }
.modal__close:hover { color: var(--ink); }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal p { color: var(--ink); line-height: 1.5; }

@media (max-width: 640px) {
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal { max-width: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; }
    .modal__foot .btn { flex: 1; }
}

/* ── Property list (company profile summary) ──────────────────────────────── */
.proplist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 28px; margin: 0; }
.proplist div { display: flex; flex-direction: column; gap: 2px; }
.proplist dt { font-family: 'Outfit', sans-serif; font-weight: 600; text-transform: uppercase;
    font-size: .7rem; letter-spacing: .5px; color: var(--muted); }
.proplist dd { margin: 0; color: var(--ink); }

/* ── Checkbox field (worker acknowledgement) ──────────────────────────────── */
/* .field is a grid: the check row has to be a flex row of its own, or the box sits on a line above its sentence. */
.field--check { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; }
.field--check input { margin-top: 3px; }
.field--check input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--blue); }

/* ── Worker photo (B2: surfaced from the verified ID) ─────────────────────── */
.worker-photo { display: flex; align-items: center; gap: 12px; }
.worker-photo img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--line); }
/* An author `display:flex` beats the UA [hidden] rule, so the hidden attribute needs its own override. */
.worker-photo[hidden] { display: none; }

/* ── Activity timeline (derived history) ──────────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { display: flex; gap: 14px; padding: 0 0 20px 2px; position: relative; }
.timeline__item:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0;
    width: 2px; background: var(--line); }
.timeline__dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; margin-top: 3px; z-index: 1;
    border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.timeline__dot.dot--ok { background: var(--tealy); }
.timeline__dot.dot--bad { background: var(--red); }
.timeline__dot.dot--warn { background: var(--amber); }
.timeline__dot.dot--neutral { background: var(--grey); }
.timeline__title { font-weight: 600; }
.timeline__time { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }

/* ── Mission-control vocabulary (design pass 2026-08-05; shared: Home, Company, events) ── */
.tasklist { display: grid; gap: 10px; }
.task {
    display: flex; align-items: center; gap: 14px; padding: 14px 18px;
    border: 1px solid var(--line); border-left: 4px solid var(--grey);
    border-radius: var(--radius-lg); background: #fff;
}
.task--doc { border-left-color: var(--amber); }
.task--staff { border-left-color: var(--blue); }
.task--service { border-left-color: var(--amber); }   /* PTW v2: a scheduled service is due */
.task__form { margin: 0; }
.task--done { border-left-color: var(--tealy); }
.task--first { box-shadow: 0 2px 10px rgba(45, 45, 45, .07); }
.task__num {
    font-family: 'Outfit', sans-serif; font-weight: 700; font-size: .85rem;
    width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center; background: var(--ink); color: #fff;
}
.task--first .task__num { background: var(--blue); }
.task__check {
    width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center; background: var(--tealy); color: #fff; font-weight: 700;
}
.task__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.task__body span { color: var(--muted); font-size: .9rem; }

.allclear {
    display: flex; align-items: center; gap: 14px; padding: 18px 20px;
    border: 1px solid rgba(0, 183, 148, .35); background: rgba(0, 183, 148, .07);
    border-radius: var(--radius-lg);
}
.allclear__mark {
    width: 32px; height: 32px; border-radius: 50%; background: var(--tealy); color: #fff;
    display: grid; place-items: center; font-weight: 700; flex: 0 0 auto;
}

.eventgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.eventcard {
    display: flex; align-items: center; gap: 16px; padding: 16px 18px;
    border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff;
    color: inherit; text-decoration: none; transition: border-color .12s;
}
.eventcard:hover { border-color: var(--blue); }
.eventcard__date {
    width: 52px; height: 56px; flex: 0 0 auto; border-radius: var(--radius-md);
    background: rgba(2, 30, 255, .07); color: var(--blue);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-family: 'Outfit', sans-serif; font-weight: 700;
}
.eventcard__day { font-size: 1.35rem; line-height: 1.1; }
.eventcard__month { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.eventcard__body { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eventcard__body strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eventcard__ready { font-size: .85rem; color: var(--muted); }
.eventcard__ready .ok { color: #00795f; font-weight: 600; }
.eventcard__ready .warn { color: #8a5a00; font-weight: 600; }
.eventcard__pills { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 1 auto; min-width: 0; }
/* R2-D2 (2026-11-02): the pills never squeeze the text. The card wraps; when the text cannot keep its 200px, the
   pills drop to their own row under it (indented past the date block), and a long pill wraps inside itself. */
.eventcard { flex-wrap: wrap; }
.eventcard__pills .pill { white-space: normal; text-align: start; }
@container eventcard (max-width: 460px) {
    .eventcard__pills { flex: 1 0 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding-inline-start: 68px; }
}
.eventgrid > .eventcard { container: eventcard / inline-size; }

.costrip {
    display: flex; align-items: center; gap: 14px; padding: 13px 18px; margin-bottom: 8px;
    border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff;
    color: inherit; text-decoration: none; transition: border-color .12s;
}
.costrip:hover { border-color: var(--blue); }
.costrip__facts { flex: 1; display: flex; gap: 8px; color: var(--muted); font-size: .9rem; }
.costrip__go { color: var(--blue); font-weight: 600; font-size: .9rem; }

@media (max-width: 640px) {
    .task { flex-wrap: wrap; }
    .task .btn { margin-inline-start: 40px; }
    .costrip { flex-wrap: wrap; }
    .costrip__facts { flex-basis: 100%; order: 3; }
}


/* ── Work area (decision 1A): shared card vocabulary — the eventcard carries BOTH kinds; the
   type badge is a small uppercase neutral pill (anti-slop spec).

   Work items are full-width LIST ROWS, never grid tiles: a row reads
   [date] [type + title + meta] [status] [action] left-to-right and needs the full content
   width. (.eventgrid's 340px auto-fill columns squeezed each row until titles truncated to a
   single character — fixed 2026-08-07.) ── */
.worklist { display: flex; flex-direction: column; gap: 12px; }
.workbadge { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; align-self: flex-start; }
.worklist .eventcard { flex-wrap: wrap; }
.worklist .eventcard__body { flex: 1 1 260px; }
.eventcard--action { border-inline-start: 3px solid var(--amber); }
.eventcard form { margin: 0; }
/* The row's status + action sit at the end; on narrow widths they wrap as a pair, not apart. */
.worklist .eventcard > .pill { margin-inline-start: auto; }
@media (max-width: 700px) {
    .eventgrid { grid-template-columns: 1fr; }
    .worklist .eventcard > .pill { margin-inline-start: 0; }
}
@media (max-width: 480px) {
    .eventcard .btn { width: 100%; text-align: center; }
    .worklist .eventcard form { width: 100%; }
}

/* ── Contractor permit detail: row link + crew count + status filter + file chips + timeline verified. ── */
/* The date block and title are the link to the issued-permit detail (NOT the whole row — event rows carry
   their own CTA buttons, so a full-row anchor would nest interactive elements). */
a.eventcard__date { text-decoration: none; }
a.eventcard__date:hover { background: rgba(2, 30, 255, .14); }
.eventcard__link {
    font-family: 'Outfit', sans-serif; font-weight: 600; color: var(--ink); text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: flex-start; max-width: 100%;
}
.eventcard__link:hover { color: var(--blue); text-decoration: underline; }
.crewcount { color: var(--muted); font-size: .82rem; font-weight: 600; white-space: nowrap; }

.wo-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.wo-chip {
    font-size: .82rem; font-weight: 600; color: var(--muted); text-decoration: none;
    border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; background: #fff;
}
.wo-chip:hover { border-color: var(--blue); color: var(--blue); }
.wo-chip.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }

.filechips { display: flex; flex-wrap: wrap; gap: 8px; }
.filechip {
    display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600;
    color: var(--ink); text-decoration: none; background: #fafafa;
    border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px;
}
.filechip:hover { border-color: var(--blue); color: var(--blue); }
.filechip__ic { width: 16px; height: 20px; border-radius: 2px; background: rgba(2, 30, 255, .12); flex: 0 0 auto; }

.backlink { color: var(--blue); text-decoration: none; font-weight: 600; font-size: .9rem; }
.backlink:hover { text-decoration: underline; }
.verified { color: var(--tealy); font-weight: 600; white-space: nowrap; }

/* Organiser/staff rows — promoted from per-page <style> blocks (W6 consolidation). */
.org-event__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.org-phases { display: flex; gap: 8px; flex-wrap: wrap; }
.org-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.org-counts { display: flex; gap: 24px; flex-wrap: wrap; }
.org-counts__title { font-size: .95rem; margin: 0 0 8px; }
.org-counts__list { display: flex; gap: 20px; flex-wrap: wrap; margin: 0; }
.org-counts__list dt { color: var(--muted); font-size: .85rem; }
.org-counts__list dd { margin: 0; font-size: 1.4rem; font-weight: 700; }

/* ── PTW v2 (Contractor-A, 2026-09-17): stepper, segments, pick rows, drop zone, closure, reference.
   Logical properties only (the page mirrors to RTL from the layout's dir attribute). ── */
.appbar__lang { margin: 0; }
.appbar__langbtn {
    background: none; border: 1px solid rgba(255,255,255,.25); color: #cfcfcf; border-radius: var(--radius-md);
    padding: 6px 10px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; min-height: 32px;
}
.appbar__langbtn:hover { color: #fff; border-color: #fff; }

/* The reference is the one string every actor quotes: monospace, prominent, selectable. */
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
h1.ref { font-size: 1.5rem; font-weight: 700; }

.stepper { max-width: 680px; margin: 0 auto; }
.stepper__track { display: flex; gap: 6px; }
.stepper__track span { flex: 1; height: 4px; border-radius: 2px; background: var(--grey); transition: background .2s ease-out; }
.stepper__track span.is-done { background: var(--tealy); }
.stepper__track span.is-current { background: var(--blue); }
.stepper__labels { display: flex; justify-content: space-between; list-style: none; margin: 6px 0 0; padding: 0; font-size: .72rem; color: var(--muted); }
.stepper__labels li.is-current { color: var(--blue); font-weight: 700; }
.stepper__head { margin: 16px 0 12px; }
.stepper__head h1 { margin: 0; }
.stepper__meta { color: var(--muted); margin: 4px 0 0; font-size: .92rem; }
.stepper__section { font-size: 1.05rem; margin: 20px 0 4px; }
.stepper__form { padding-block-end: 120px; }

/* US-106: the Checks step, one section per screen. Phone: the section list folds under a one-line
   summary. Desktop (960px+): the list is a side panel next to the section. */
.secnav { margin: 4px 0 8px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.secnav__toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px;
    padding: 8px 12px; background: none; border: 0; font: inherit; font-weight: 600; color: var(--ink); text-align: start; cursor: pointer; }
.secnav__chev { width: 8px; height: 8px; border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease-out; flex: none; }
.secnav.is-open .secnav__chev { transform: rotate(-135deg); }
.secnav__list { display: none; list-style: none; margin: 0; padding: 0 0 6px; border-top: 1px solid var(--line); }
.secnav.is-open .secnav__list { display: block; }
.secnav__item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px;
    padding: 8px 12px; background: none; border: 0; border-inline-start: 3px solid transparent; font: inherit; color: var(--ink); text-align: start; cursor: pointer; }
.secnav__item:hover { background: var(--grey); }
.secnav__item.is-current { border-inline-start-color: var(--blue); color: var(--blue); font-weight: 600; }
.secnav__state { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.secnav__item.is-done .secnav__state { color: var(--tealy); font-weight: 600; }
.secnav__item.is-done .secnav__state::before { content: "\2713"; margin-inline-end: 4px; }
.secflow__default { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.stepper__hint { font-size: .82rem; color: var(--muted); margin: 0 auto 6px; max-width: 680px; min-height: 1.1em; }
.stepper__row .btn:disabled { opacity: .5; cursor: not-allowed; }
@media (min-width: 960px) {
    .stepper:has(.secnav) { max-width: 960px; }
    .secnav { float: inline-start; width: 240px; margin: 20px 0 0; }
    .secnav__toggle { display: none; }
    .secnav__list { display: block; border-top: 0; padding-top: 6px; }
    .stepper:has(.secnav) .ptw-csec { margin-inline-start: 264px; }
}

/* US-102: start from the last permit. The offer is a card above the sections; a copied answer carries a
   small "From last permit" mark until it is touched or its section is confirmed. */
.prefill-offer { border: 1.5px solid var(--blue); border-radius: var(--radius-md); padding: 12px 14px; margin: 4px 0 12px; background: #fff; }
.prefill-offer p { margin: 4px 0 10px; }
.prefill-offer__row { display: flex; flex-wrap: wrap; gap: 8px; }
.prefill-offer__row .btn { min-height: 44px; }
.prefill-tag { display: inline-block; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; background: var(--amber); color: var(--ink); font-size: .72rem; font-weight: 600; vertical-align: middle; }
.ptw-csec__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ptw-csec__head .btn { min-height: 36px; flex: none; }

/* US-108: the site's help text under a question and its note under a section title. Muted, wraps, always
   visible (never tooltip-only, so it works on a phone). */
.q__help, .ptw-csec__desc { margin: 2px 0 6px; font-size: .85rem; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.ptw-csec__desc { margin-top: 0; }

/* US-107: "Not applicable to this job" on a whole section. */
.na-switch { margin: 6px 0 10px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: var(--radius-md); }
.na-switch .field--check { margin: 0; min-height: 36px; }
.na-switch__reason { margin-top: 8px; }
.review-sec__na { margin: 6px 0 0; font-size: .9rem; color: var(--muted); font-style: italic; }

/* US-103: a worker's certificates on the Company page, and a text-style button for small row actions. */
.linkbtn { background: none; border: 0; padding: 4px 0; min-height: 32px; font: inherit; font-size: .85rem; color: var(--blue); cursor: pointer; text-decoration: underline; }
.linkbtn:hover { color: var(--blue-dark); }

/* US-103: questions answered from the crew's certificates. */
.q__linked { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
.competence { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; margin: 10px 0; background: #fff; }
.competence--gap { border-color: var(--red); }
.competence__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.competence__note { margin: 6px 0 0; font-size: .88rem; }
.competence__workers { list-style: none; margin: 8px 0 0; padding: 0; }
.competence__worker { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.competence__status { font-size: .85rem; color: var(--muted); }
.competence__worker--valid .competence__status { color: var(--tealy); font-weight: 600; }
.competence__worker--missing .competence__status, .competence__worker--expired .competence__status { color: var(--red); font-weight: 600; }
.competence__upload { flex-basis: 100%; display: grid; gap: 8px; margin-top: 6px; }
.competence__upload .btn { min-height: 44px; }

/* US-106 Review: answers read back by section, each with an Edit link to it. */
.review-sec { border-top: 1px solid var(--line); padding: 10px 0; }
.review-sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.review-sec__head h3 { margin: 0; font-size: 1rem; }
.review-sec__list { margin: 6px 0 0; }
.review-sec__list > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: .9rem; }
.review-sec__list dt { color: var(--muted); }
.review-sec__list dd { margin: 0; font-weight: 600; text-align: end; overflow-wrap: anywhere; }
.review-sec__list .is-missing dd { color: var(--red); }
.stepper__form .grid-2 { margin-top: 12px; }
.stepper__form .field--check { margin-top: 12px; }

.job { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.job__title { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
.proplist--tight { gap: 8px 20px; }

/* One question, one row (list rows, not cards: decision P4). */
.q { padding: 14px 0; border-bottom: 1px solid var(--grey); }
.q__label { font-size: 1rem; line-height: 1.35; margin-bottom: 8px; }
.q__label .req { color: var(--red); }
.q--collapsed { color: var(--muted); font-size: .85rem; padding: 8px 0; opacity: .8; }
.q--err .seg { border-color: var(--red); }
.q--err .seg .seg__opt + .seg__opt { border-inline-start-color: var(--red); }
.q--err .field__input { border-color: var(--red); }
.q__err { color: var(--red); font-size: .85rem; margin-top: 6px; }
.q__attached { margin: 0 0 8px; font-size: .9rem; }

/* Segmented radio group: Yes | No | N/A. 44px targets, the selected segment fills blue. */
.seg { display: flex; border: 1.5px solid var(--blue); border-radius: var(--radius-md); overflow: hidden; }
.seg__opt { flex: 1; position: relative; }
.seg__opt + .seg__opt { border-inline-start: 1.5px solid var(--blue); }
.seg__opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg__opt span { display: flex; align-items: center; justify-content: center; height: 44px; color: var(--blue); font-weight: 600; font-size: 1rem; }
.seg__opt input:checked + span { background: var(--blue); color: #fff; }
/* US-105: the pick is a filled button AND a check mark, never colour alone. */
.seg__opt input:checked + span::before { content: "\2713"; margin-inline-end: 6px; font-weight: 700; }
/* Choice options are free text: let a long one wrap inside its button rather than overflow at 360px. */
.seg--wrap .seg__opt { min-width: 0; }
.seg--wrap .seg__opt span { height: auto; min-height: 44px; padding: 6px 8px; text-align: center; line-height: 1.25; overflow-wrap: break-word; }
/* Long options: one full-width button per line, label at the start like a list. */
.seg--stack { flex-direction: column; }
.seg--stack .seg__opt + .seg__opt { border-inline-start: 0; border-top: 1.5px solid var(--blue); }
.seg--stack .seg__opt span { justify-content: flex-start; text-align: start; padding: 10px 14px; }
.q--err .seg--stack .seg__opt + .seg__opt { border-top-color: var(--red); }
.seg__opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: -3px; }

/* Worker picker: 44px+ list rows with the checkbox at the inline end. */
.pick { display: flex; flex-direction: column; }
.pick__row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 4px; border-bottom: 1px solid var(--grey); cursor: pointer; }
.pick__row.is-ineligible { opacity: .55; cursor: default; }
.pick__body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick__body .pill { align-self: flex-start; margin-top: 2px; }
.pick__check { width: 24px; height: 24px; flex: 0 0 auto; accent-color: var(--blue); margin-inline-start: auto; }

/* Drop zone: the ONE upload surface (camera on phones through capture="environment"). */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 64px; padding: 14px; border: 1.5px dashed var(--blue); border-radius: var(--radius-md);
    color: var(--blue); font-weight: 600; cursor: pointer; position: relative; margin-top: 8px; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone__file { color: var(--ink); font-weight: 400; font-size: .85rem; }
.dropzone:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Review: grouped proplist with an Edit link per group. */
.review { display: grid; gap: 14px; margin: 0; }
.review div { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--grey); }
.review dt { display: flex; justify-content: space-between; font-family: 'Outfit', sans-serif; font-weight: 600; text-transform: uppercase; font-size: .72rem; letter-spacing: .5px; color: var(--muted); }
.review dt a { text-transform: none; letter-spacing: 0; font-weight: 600; }
.review dd { margin: 0; }
.review__warn { color: #8a5a12; font-weight: 600; }
.review__na { display: block; margin-top: 4px; }

/* Sticky bar: ghost on the inline start, primary on the inline end, 48px, above the keyboard. */
.stepper__bar { position: fixed; inset-inline: 0; bottom: 0; background: #fff; border-top: 1px solid var(--grey);
    padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 20; }
.stepper__saved { font-size: .78rem; color: var(--tealy); min-height: 1.1em; margin-bottom: 6px; max-width: 680px; margin-inline: auto; }
.stepper__row { display: flex; gap: 8px; max-width: 680px; margin-inline: auto; }
.stepper__row .btn { height: 48px; }
.stepper__row .btn--ghost { flex: 1; }
.stepper__row .btn--primary { flex: 2; }
.stepper__exit { display: block; margin: 8px auto 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; min-height: 32px; }

/* Closure page: the job block first, then one upload, then what happens next. */
.closure__crew { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.closure__quote { border-inline-start: 3px solid var(--amber); padding: 8px 12px; background: #fdf6e8; border-radius: var(--radius-md); margin: 12px 0; }
.ticklist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ticklist li { display: flex; gap: 10px; align-items: flex-start; }
.ticklist li::before { content: "\2610"; color: var(--muted); }
.closure__done { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border: 1px solid rgba(0,183,148,.35); background: rgba(0,183,148,.07); border-radius: var(--radius-lg); }

/* Chain timeline reuses .timeline; an extension row is labelled with its reference. */
.timeline__ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }

.page__actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
@media (max-width: 480px) { .page__actions .btn { flex: 1; } }

/* RTL mirrors through logical properties; the few physical rules above are corrected here. */
[dir="rtl"] .table th, [dir="rtl"] .table td { text-align: right; }
[dir="rtl"] .timeline__item:not(:last-child)::before { left: auto; right: 6px; }
[dir="rtl"] .task { border-left: 1px solid var(--line); border-right: 4px solid var(--grey); }
[dir="rtl"] .task--doc { border-right-color: var(--amber); }
[dir="rtl"] .task--service { border-right-color: var(--amber); }
[dir="rtl"] .task--staff { border-right-color: var(--blue); }
[dir="rtl"] .task--done { border-right-color: var(--tealy); }
[dir="rtl"] .appbar__nav { margin-left: 0; margin-right: 8px; }

/* ── Tenant entry link (EA 10): tenant logo on a white plate, "Powered by MyGatePass", scope bar ── */
.brand-plate { display: inline-flex; align-items: center; background: #fff; border-radius: var(--radius-md); padding: 6px 12px; }
.brand-plate img { height: 36px; width: auto; max-width: 200px; display: block; object-fit: contain; }
.auth-hero__logo .brand-plate img { height: 52px; max-width: 260px; }
.logo--tenant { margin-inline-start: 12px; }
.logo--tenant .brand-plate { padding: 3px 8px; }
.logo--tenant .brand-plate img { height: 28px; }
.powered-by { margin: 24px 0 0; font-size: .8rem; color: var(--muted); }
.powered-by--page { text-align: center; padding: 16px; margin: 0; }
.entrybar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 14px; margin-bottom: 16px;
    background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--brand); border-radius: var(--radius-md); }
.entrybar form { margin: 0; margin-inline-start: auto; }

/* EA 22: a document the venue sent back leads the documents card, marked with the warn tint. */
.org-event__row--returned { background: #fdf1dd; border-inline-start: 3px solid #8a5a12; padding-inline: 10px; border-radius: 6px; }


/* ── EA 17: the worker's HSE induction page (/i/{token}, no login). Mobile-first: one column, 44px targets. ── */
.induction-page { background: #f6f6f6; }
.induction-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 0 16px; height: 60px; background: var(--ink);
}
.induction-bar img { height: 30px; width: auto; display: block; }
.induction-main { max-width: 720px; margin: 0 auto; padding: 16px; }
.induction { padding-bottom: 32px; }
.induction__item { padding: 16px; }
.induction__media { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-md); background: #000; display: block; }
.induction__rich { overflow-wrap: anywhere; }
.induction__rich img, .induction__rich video { max-width: 100%; height: auto; }
.induction__ack { align-items: flex-start; min-height: 44px; }
.induction__ack input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 2px; }
.induction .btn--block { height: 48px; }

/* A PDF read in the page: pages drawn by PDF.js in a scrolling box, the reader's place underneath, a teal edge
   once read to the end. Without PDF.js the box hides and "Open in a new tab" becomes the way in. */
.induction-pdf { display: flex; flex-direction: column; gap: 8px; }
.induction-pdf__frame {
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    border: 1px solid var(--grey);
    border-radius: var(--radius-md);
    background: #f6f6f6;
}
.induction-pdf__frame:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.induction-pdf__frame[hidden] { display: none; }
.induction-pdf__page { position: relative; width: 100%; margin: 0 auto 8px; background: #fff; box-shadow: 0 1px 3px rgba(45, 45, 45, .15); }
.induction-pdf__page:last-child { margin-bottom: 0; }
.induction-pdf__page canvas { display: block; width: 100%; height: 100%; }
.induction-pdf__loading { margin: 24px 0; text-align: center; color: var(--muted); }
.induction-pdf__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; font-size: .9rem; }
.induction-pdf__progress { color: var(--muted); font-weight: 600; }
.induction-pdf__open { color: var(--brand); font-weight: 600; }
.induction-pdf.is-read .induction-pdf__frame { border-color: var(--tealy); }
.induction-pdf.is-read .induction-pdf__progress { color: #00795F; }
.induction-pdf.is-read .induction-pdf__progress::before { content: "\2713\00a0"; }
.induction-pdf.is-fallback .induction-pdf__progress { display: none; }
.induction-pdf.is-fallback .induction-pdf__open {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
    border: 1px solid var(--grey); border-radius: var(--radius-md); background: #fff; color: var(--ink); text-decoration: none;
}
.induction__gate { font-weight: 600; }

/* ── 4331 bulk upload of worker ID documents ───────────────────────────── */
.idlimits { margin: 0 0 8px; padding-inline-start: 20px; font-size: .9rem; }
.idproblems { margin: 8px 0 0; padding-inline-start: 20px; color: var(--red); font-size: .88rem; }
.idactions { margin-block: 12px; }
.idbar { display: flex; align-items: center; gap: 12px; margin-block: 12px; }
.idbar__track { flex: 1; height: 8px; border-radius: 4px; background: var(--grey); overflow: hidden; }
.idbar__fill { block-size: 100%; inline-size: 0; background: var(--blue); transition: inline-size .3s ease-out; }
.idbar__label { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.noid-pill { margin-inline-start: 8px; vertical-align: middle; }

/* Review page: one row per DOCUMENT. A table on a desktop, stacked cards on a phone. */
.idreview__bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-block: 16px; }
.idreview__bar .row-actions { align-items: center; }
.idreview__counts { display: flex; flex-wrap: wrap; gap: 8px; }
.idrow__thumb { inline-size: 96px; block-size: 64px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #f7f7f7; object-fit: cover; display: block; }
.idrow__thumb--pdf { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); font-size: .8rem; }
.idrow__thumbs { display: flex; gap: 6px; }
.idrow__mono { font-variant-numeric: tabular-nums; }
.idrow__note { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.idrow__tools { display: flex; flex-direction: column; gap: 8px; min-inline-size: 240px; }
.idrow__tools form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.idrow__tools .field__input { min-block-size: 40px; flex: 1 1 160px; min-inline-size: 0; }
.idrow__create { border: 1px dashed var(--line); border-radius: var(--radius-md); padding: 8px 10px; }
.idrow__create summary { cursor: pointer; color: var(--blue); font-weight: 600; min-block-size: 32px; }
.idrow__create .grid-2 { margin-block: 8px; }
.idrow.is-done { opacity: .6; }
@media (max-width: 760px) {
    .idreview .table thead { display: none; }
    .idreview .table, .idreview .table tbody, .idreview .table tr, .idreview .table td { display: block; inline-size: 100%; }
    .idreview .table tr { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; margin-block-end: 12px; }
    .idreview .table td { border: 0; padding: 6px 0; }
    .idrow__tools { min-inline-size: 0; }
    .idrow__tools .btn { min-block-size: 44px; }
    .idreview__bar .btn { min-block-size: 44px; }
}
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Company page redesign, PR1 (2026-11-01): the "Add workers" split button, its menu, sub-page chrome. ── */
/* A native <details> so the menu opens without JavaScript; mgp-modal.js is not involved. */
.splitbtn { position: relative; display: inline-block; }
.splitbtn > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.splitbtn > summary::-webkit-details-marker { display: none; }
.splitbtn__caret { font-size: .75em; }
.menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 220px; z-index: 40;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px;
    box-shadow: 0 6px 24px rgba(45, 45, 45, .12); display: grid; }
.menu a, .menu button { display: block; width: 100%; text-align: start; padding: 10px 12px; min-height: 44px;
    border: 0; background: none; font: inherit; color: var(--ink); border-radius: var(--radius-sm); text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover, .menu a:focus-visible, .menu button:focus-visible { background: var(--grey); text-decoration: none; outline: none; }
.menu .menu__danger { color: var(--red); }
@media (max-width: 640px) {
    .menu { position: fixed; inset: auto 0 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 10px 10px 18px; min-width: 0; }
    .menu a, .menu button { min-height: 48px; }
}
/* Back links carry a logical arrow: it flips with the document direction, never a literal glyph in copy. */
.backarrow::before { content: "\2190\00a0"; }
[dir="rtl"] .backarrow::before { content: "\2192\00a0"; }
.tabular { font-variant-numeric: tabular-nums; }
.page__actions .btn { min-height: 44px; }

/* ── Company page part 2 (redesign D9/D10/D13): list rows instead of tables. ── */
.crumb { margin: 0 0 6px; font-size: .9rem; }
.section__count { font-family: 'Nunito Sans', system-ui, sans-serif; font-weight: 400; font-size: .9rem; color: var(--muted); margin-inline-start: 10px; }
.rowlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rowlist > li { border-bottom: 1px solid var(--line); }
.docrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 56px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.docrow__text { flex: 1 1 220px; display: flex; flex-direction: column; min-width: 0; }
.docrow__text strong { font-family: 'Outfit', sans-serif; font-weight: 600; }
.docrow__file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docrow__actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.docrow__actions .btn { min-height: 44px; }
.rowmenu__btn { min-width: 44px; justify-content: center; font-size: 1.1rem; line-height: 1; }
.versionrow { display: flex; flex-direction: column; padding: 10px 0; }
.workerrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-height: 56px; padding: 8px 4px; color: inherit; text-decoration: none; }
.workerrow:hover, .workerrow:focus-visible { background: #fafafa; text-decoration: none; }
.workerrow__text { flex: 1 1 200px; display: flex; flex-direction: column; min-width: 0; }
.workerrow__venues { display: flex; flex-wrap: wrap; gap: 4px; }
.workerrow__venuecount { display: none; }
.avatar { inline-size: 36px; block-size: 36px; border-radius: 50%; background: var(--grey); color: var(--ink); flex: 0 0 auto;
    display: grid; place-items: center; font-family: 'Outfit', sans-serif; font-weight: 600; font-size: .85rem; }
.chevron::before { content: "\203A"; font-size: 1.4rem; color: var(--muted); }
[dir="rtl"] .chevron::before { content: "\2039"; }
.rowfilter { margin: 0 0 10px; max-width: 360px; }
.readiness .pill, .docrow .pill, .workerrow .pill { white-space: normal; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 640px) {
    .readiness__cta { inline-size: 100%; justify-content: center; }
    .readiness__events { margin-inline-start: 0; }
    .docrow__text { flex-basis: 100%; }
    .task__body { flex: 1 1 calc(100% - 50px); }
    .workerrow__pill { order: 3; margin-inline-start: 50px; }
    .workerrow__venues { display: none; }
    .workerrow__venuecount { display: inline; order: 4; }
    .page__head { flex-wrap: wrap; }
}
/* Worker page (redesign 2026-11-02, WP-D1..D4): the header avatar carries the photo from the verified ID over the
   initials; the gate area is the .readiness block with one .gaterow per gate check, each with its own action. */
.worker-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar--lg { inline-size: 56px; block-size: 56px; font-size: 1.1rem; position: relative; overflow: hidden; }
.avatar .worker-photo { position: absolute; inset: 0; }
.avatar .worker-photo img { inline-size: 100%; block-size: 100%; border: 0; border-radius: 50%; object-fit: cover; }
.gaterows { list-style: none; margin: 12px 0 0; padding: 6px 0 0; border-top: 1px solid var(--line); display: grid; }
.gaterow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 48px; padding: 4px 0; }
.gaterow__icon { inline-size: 22px; block-size: 22px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff;
    display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff; flex: 0 0 auto; }
.gaterow__icon--ok { background: var(--tealy); border-color: var(--tealy); }
.gaterow__icon--bad { background: var(--red); border-color: var(--red); }
.gaterow__text { flex: 1 1 220px; display: flex; flex-direction: column; min-width: 0; }
.gaterow .btn { min-height: 44px; }
.gaterow .pill { white-space: normal; }
.certs__legacy { margin: 10px 0 0; }
.worker-head .tabular { white-space: nowrap; }
@media (max-width: 640px) {
    .gaterow__text { flex-basis: calc(100% - 40px); }
    .gaterow .btn, .gaterow .pill { margin-inline-start: 34px; }
}

/* ── Event staff (staff page redesign 2026-11-10, DESIGN.md "Event staff") ─────────────────────────────────── */
/* The HSE induction panel: amber edge while someone still needs it, teal once everyone is done. */
.induct { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px;
    border: 1px solid var(--line); border-inline-start: 4px solid var(--amber); border-radius: var(--radius-lg); background: #fffaf1; }
.induct--done { border-inline-start-color: var(--tealy); background: #f3fbf8; }
.induct__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.induct__head h3 { margin: 0; flex: 1 1 auto; }
.induct__sentence { margin: 0; font-weight: 600; }
.induct > .card__muted { margin: 0; }
.induct__progress { appearance: none; -webkit-appearance: none; inline-size: 100%; block-size: 6px; border: 0;
    border-radius: 999px; background: var(--grey); overflow: hidden; }
.induct__progress::-webkit-progress-bar { background: var(--grey); border-radius: 999px; }
.induct__progress::-webkit-progress-value { background: var(--tealy); border-radius: 999px; }
.induct__progress::-moz-progress-bar { background: var(--tealy); border-radius: 999px; }

/* List tools: Select all at the inline start, the filter chips at the inline end. */
.stafftools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.stafftools__all { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; font-size: .92rem; cursor: pointer; }
.stafftools__all[hidden] { display: none; }
.stafftools__all input, .staffrow__check { inline-size: 20px; block-size: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--blue); cursor: pointer; }
.bulkhint { margin: 0; color: var(--muted); font-size: .88rem; }

/* The selection bar: Almost Black, sticks to the bottom of the screen while people are ticked. */
.bulkbar { position: sticky; bottom: 12px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
    padding: 10px 14px; border-radius: var(--radius-lg); background: var(--ink); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.bulkbar[hidden] { display: none; }
.bulkbar__count { font-weight: 700; margin-inline-end: auto; }
.bulkbar .btn--primary { background: #fff; color: var(--ink); }
.bulkbar .btn--primary:hover { background: var(--grey); }
.bulkbar .btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.bulkbar .btn--ghost:hover { background: rgba(255,255,255,.12); }

/* One row per person: tick box, name and lines, ONE status pill (plus the venue's), the ⋯ menu. */
.staffrows { list-style: none; margin: 0; padding: 0; }
.staffrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: 56px; padding: 10px 6px; border-top: 1px solid var(--grey); }
.staffrow.is-selected { background: #eef0ff; }
.staffrow__spacer { inline-size: 20px; flex: 0 0 auto; }
.staffrow__text { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.staffrow__name { font-weight: 700; cursor: pointer; }
.staffrow__meta { color: var(--muted); font-size: .88rem; }
.staffrow__meta--ok { color: #06795f; }
.staffrow__pills { display: flex; flex-wrap: wrap; gap: 6px; }
.staffrow__pills .pill { white-space: normal; }
.staffrow__actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.staffrow .menu form { margin: 0; }
@media (max-width: 640px) {
    .staffrow__pills { order: 3; flex: 1 1 auto; padding-inline-start: 34px; }
    .staffrow__actions { order: 4; }
    .staffrow__text { flex-basis: calc(100% - 40px); }
    .bulkbar { bottom: 8px; }
    .bulkbar .btn { flex: 1 1 auto; min-height: 44px; }
}

/* ── Companies start from the trade licence (2026-11-11) ───────────────────────────────────────────── */
/* The list: one row per company, the whole row opens it; a company with no licence gets its fix beside it. */
.companylist { margin-top: 8px; }
.companyrow { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--grey); }
.companyrow__link { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-height: 64px; padding: 10px 4px;
    color: inherit; text-decoration: none; min-width: 0; }
.companyrow__link:hover, .companyrow__link:focus-visible { background: #fafafa; text-decoration: none; }
.companyrow__text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 12rem; }
.companyrow .pill { white-space: normal; }

/* Upload step: one big drop zone, the first thing on the page. */
.licence-upload { max-width: 640px; }
.dropzone--hero { min-height: 180px; gap: 6px; font-size: 1rem; background: #f7f8ff; }
.dropzone--hero strong { font-size: 1.1rem; }

/* Three steps: a 4px segment track like the permit stepper. */
.licence-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; font-size: .85rem; color: var(--muted); }
.licence-steps li { flex: 1; padding-top: 8px; border-top: 4px solid var(--grey); }
.licence-steps li.is-done { border-top-color: var(--tealy); }
.licence-steps li.is-current { border-top-color: var(--blue); color: var(--ink); font-weight: 600; }

/* Review step: the licence beside the form on desktop, above it on phones. */
.licence-review { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
.licence-review__file { position: sticky; top: 16px; padding: 10px; }
.licence-review__file iframe { width: 100%; height: 70vh; border: 0; border-radius: var(--radius-sm); background: #f4f4f4; }
.licence-review__file img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: var(--radius-sm); background: #f4f4f4; }
.licence-review__name { margin: 8px 0 0; overflow-wrap: anywhere; }
.licence-review__h { font-size: 1rem; margin: 10px 0 0; }
.licence-review__foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 860px) {
    .licence-review { grid-template-columns: 1fr; }
    .licence-review__file { position: static; }
    .licence-review__file iframe { height: 50vh; }
    .licence-review__foot .btn--primary { width: 100%; }
}

/* Beside a field filled from the licence: a quiet tag, or amber "Check this" where the reader was unsure. */
/* Add a worker from their ID (2026-11-11): both sides stacked, and the roster match over the form. */
.idsides img, .idsides iframe { max-height: 36vh; }
.idsides iframe { height: 36vh; }
.idsides > * + * { margin-top: 8px; }
.idmatch { border-inline-start: 4px solid var(--blue); }
.idmatch__text { margin: 0; font-weight: 600; }
.idmatch__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.idmatch__actions form { margin: 0; }

.readtag { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 999px; font-size: .72rem; font-weight: 600;
    color: var(--muted); background: #f0f1f4; vertical-align: middle; }
.readtag--check { color: #7a4b00; background: #fdf0d9; }
/* Documents start from the file (2026-11-14): what else the reader saw, under the form. */
.docfacts { border-top: 1px solid var(--line); padding-top: 10px; }
.docfacts .proplist { margin: 6px 0 4px; }
/* The expiry carries a hint, the issue date does not: keep both boxes on one line. */
.docdates { align-items: start; }
.docdates .field { align-content: start; }
.field--checkthis .field__input, .field--checkthis select { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }

/* Edit profile with a licence on file: the licence-held facts read-only, with the way to change them. */
.licencefacts { padding: 10px 12px; border-radius: var(--radius-md); background: #f7f7f9; }
.licencefacts .proplist { margin: 0 0 6px; }

/* ── Scope of work (redesign 2026-11-13, DESIGN.md "Scope of work") ─────────────────────────────────────────── */
/* One column, four numbered sections, then the confirmation and a save bar that sticks to the bottom of the screen
   while the form is taller than it. Logical properties only (RTL). */
.scope { max-width: 760px; }
.scope-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.scope-head__text { min-width: 0; }
.scope-head h1 { margin: 0 0 4px; }
.scope-head .card__muted { margin: 0; }
.scope-head .pill { margin-top: 6px; white-space: normal; }

.scope-intro { padding: 14px 16px; border: 1px solid var(--line); border-inline-start: 4px solid var(--blue); border-radius: var(--radius-lg);
    background: #f6f7ff; margin-bottom: 16px; display: grid; gap: 4px; }
.scope-intro p { margin: 0; }
.scope-intro__lead { font-weight: 600; }
.scope-intro--warn { border-inline-start-color: var(--amber); background: #fffaf1; }
.scope-intro--done { border-inline-start-color: var(--tealy); background: #f3fbf8; }
.scope-intro__quote { margin: 6px 0; padding: 8px 12px; background: #fff; border-inline-start: 3px solid var(--amber); border-radius: var(--radius-sm);
    white-space: pre-line; overflow-wrap: anywhere; }

.scope-errors ul { margin: 6px 0 0; padding-inline-start: 18px; }
.scope-errors a { color: var(--red); text-decoration: underline; font-weight: 600; }
.scope-errors:focus { outline: 2px solid var(--red); outline-offset: 2px; }

.scope-sec { display: grid; gap: 16px; padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--line); }
.scope-form > .scope-sec:first-child { margin-top: 8px; padding-top: 0; border-top: 0; }
.scope-sec__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.15rem; }
.scope-sec__n { inline-size: 26px; block-size: 26px; border-radius: 50%; background: var(--ink); color: #fff; flex: 0 0 auto;
    display: grid; place-items: center; font-size: .82rem; }
.scope-sec__lede { margin: -8px 0 0; color: var(--muted); font-size: .9rem; }
.scope-opt { font-family: 'Nunito Sans', system-ui, sans-serif; font-weight: 400; font-size: .8rem; color: var(--muted); margin-inline-start: 4px; }

/* A fieldset that looks like the other fields: no browser frame, the legend as the label row. */
.scope-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: block; }
.scope-fieldset > * + * { margin-top: 8px; }
.scope-fieldset > legend { padding: 0; margin-bottom: 6px; display: flex; align-items: baseline; gap: 10px; inline-size: 100%; }
.scope-fieldset:focus { outline: none; }
.scope-count { margin-inline-start: auto; font-weight: 600; font-size: .8rem; color: var(--muted); }

/* Activities: one tickable card each; the whole card is the label. */
.scope-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.scope-act { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 4px 12px; min-height: 56px; padding: 12px 14px;
    border: 1.5px solid var(--line); border-radius: var(--radius-md); background: #fff; cursor: pointer;
    transition: border-color .15s ease-out, background-color .15s ease-out; }
.scope-act:hover { border-color: #bdbdbd; }
.scope-act input { inline-size: 20px; block-size: 20px; margin: 1px 0 0; accent-color: var(--blue); cursor: pointer; }
.scope-act:has(input:checked) { border-color: var(--blue); background: #f3f5ff; }
.scope-act:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.scope-act__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scope-act__name { font-family: 'Outfit', sans-serif; font-weight: 600; overflow-wrap: anywhere; }
.scope-act__desc { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.scope-act__tags { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.scope-act__tags:empty { display: none; }
.scope-act--retired { background: #fafafa; }
.scope-empty { padding: 20px; }

/* The venue's phases, each with a one-tap "Use these dates". */
.scope-phases { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fafafa; }
.scope-phases__lead { margin: 0 0 4px; font-size: .9rem; font-weight: 600; }
.scope-phases__list { list-style: none; margin: 0; padding: 0; }
.scope-phase { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 44px; padding: 4px 0; }
.scope-phase + .scope-phase { border-top: 1px solid var(--line); }
.scope-phase__when { font-size: .92rem; }
.scope-phase__use { margin-inline-start: auto; min-height: 36px; }
.scope-phase__use[hidden] { display: none; }

/* Working periods: one From/To row each; extra rows come from "Add another period" or "Use these dates". */
.window-list { display: grid; gap: 12px; }
.window-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.window-row > * { min-width: 0; }
.window-row__remove { min-height: 40px; }
.window-row__remove[hidden], .window-add[hidden] { display: none; }
.window-add { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

.field--narrow .field__input { max-width: 200px; }
.scope .field { align-content: start; }
.field__error { color: var(--red); font-size: .85rem; font-weight: 600; }
.field--err .field__input { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.scope-fieldset.field--err .scope-act { border-color: #efb9b9; }

.scope-ack { margin-top: 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fafafa; }
.scope-ack.field--err { border-color: var(--red); background: #fdf6f6; }
.scope-ack .field--check { cursor: pointer; font-weight: 600; }
.scope-ack .field--check input { inline-size: 20px; block-size: 20px; }

.scope-bar { position: sticky; bottom: 0; z-index: 10; margin-top: 24px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); }
.scope-bar__row { display: flex; justify-content: flex-end; gap: 8px; }
.scope-bar__row .btn { min-height: 48px; }

/* Read-only: the scope as a list of facts. */
.scope-facts { margin: 0; display: grid; }
.scope-facts > div { display: grid; grid-template-columns: 220px 1fr; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.scope-facts > div:first-child { padding-top: 0; }
.scope-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.scope-facts dt { font-family: 'Outfit', sans-serif; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.scope-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.scope-facts__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.scope-facts__list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scope-facts__text { white-space: pre-line; }

@media (max-width: 640px) {
    .window-row { grid-template-columns: 1fr; }
    .window-row__remove { justify-self: start; }
    .scope-acts { grid-template-columns: 1fr; }
    .scope-phase__use { margin-inline-start: 0; }
    .scope-bar__row .btn--ghost { flex: 1; }
    .scope-bar__row .btn--primary { flex: 2; }
    .scope-facts > div { grid-template-columns: 1fr; }
    .field--narrow .field__input { max-width: none; }
}
