@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/inter-latin-700-normal.woff2") format("woff2"); }
/* Argo-OT. Cool concrete base, navy for structure, high-vis amber only where something needs a person. */

:root {
  --bg: #eceff2;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --ink: #16202b;
  --muted: #5b6674;
  --line: #d4dae1;
  /* 0.14.0: the organization's color (Organization panel), set by app.js as --org-color; Navy when not set. */
  --brand: var(--org-color, #1d3a5c);
  --brand-dark: color-mix(in srgb, var(--brand) 78%, #000);
  --brand-ink: #ffffff;
  --signal: #f2ad00;
  --signal-ink: #2a1f00;
  --focus: #2b6cdf;

  --st-pending: #a86a00;
  --st-open: #2a62c4;
  --st-filling: #2a62c4;
  --st-filled: #1f7a4a;
  --st-unfilled: #b8381f;
  --st-completed: #66717e;
  --st-cancelled: #98a1ab;

  --radius-s: 6px;
  --radius-m: 10px;
  --shadow: 0 1px 0 rgba(22, 32, 43, .06), 0 1px 3px rgba(22, 32, 43, .06);

  /* 0.14.0 (Nick Nov 15): Inter for everyone, bundled from npm (@fontsource/inter, public/fonts), no Google. */
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-cond: Inter, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161c; --surface: #19212a; --surface-2: #1f2832; --ink: #e8edf2; --muted: #9aa6b3; --line: #2d3946;
    --brand: var(--org-color-dark, #8fb3dc); --brand-ink: #0d1620; --signal: #f2b51c; --signal-ink: #1f1600; --focus: #7aa7ff;
    --st-pending: #e3a43a; --st-open: #7aa7ff; --st-filling: #7aa7ff; --st-filled: #58c08a; --st-unfilled: #f0785f;
    --st-completed: #8c97a3; --st-cancelled: #66717d;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11161c; --surface: #19212a; --surface-2: #1f2832; --ink: #e8edf2; --muted: #9aa6b3; --line: #2d3946;
  --brand: var(--org-color-dark, #8fb3dc); --brand-ink: #0d1620; --signal: #f2b51c; --signal-ink: #1f1600; --focus: #7aa7ff;
  --st-pending: #e3a43a; --st-open: #7aa7ff; --st-filling: #7aa7ff; --st-filled: #58c08a; --st-unfilled: #f0785f;
  --st-completed: #8c97a3; --st-cancelled: #66717d;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); font-feature-settings: "tnum" 1;
}
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */

.demo-bar {
  background: var(--signal); color: var(--signal-ink); font-size: 13px; font-weight: 600;
  padding: 6px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.demo-bar .who { display: flex; gap: 12px; align-items: center; flex-wrap: nowrap; }
.demo-bar .signed-in { opacity: .85; white-space: nowrap; }
.demo-bar form.inline { margin: 0; display: inline; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; white-space: nowrap; }
.demo-bar select { background: rgba(255,255,255,.6); border: 1px solid rgba(0,0,0,.25); border-radius: var(--radius-s); padding: 3px 6px; font-weight: 600; max-width: 100%; }

/* v0.7.0: the yellow bar stays at the top on desktop; the side menu is the window height minus the bar (--bar-h, set by core.js),
   so the CBA link at its bottom shows without scrolling (Nick, Nov 10). */
.demo-bar { position: sticky; top: 0; z-index: 30; }
.demo-bar.prod { background: var(--surface); color: inherit; border-bottom: 1px solid var(--line); font-weight: 500; } /* 0.17.0: production: no demo note, quiet bar with Viewing as and Sign out */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - var(--bar-h, 34px)); align-items: start; }
.side {
  background: var(--brand); color: var(--brand-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: var(--bar-h, 34px); height: calc(100vh - var(--bar-h, 34px));
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.brand-mark { width: 42px; height: 42px; flex: none; display: block; }
/* 0.12.0 (Nick): the side menu shows the O and T alone, as tall as the two name lines; the icon rail keeps the square. */
.brand-mark-wide { height: 36px; width: auto; aspect-ratio: 53 / 32; flex: none; display: block; }
.side .brand .brand-mark { display: none; }
.side-ver { display: block; font-size: 12px; opacity: .7; margin-top: 6px; }
.brand-name { font: 700 20px/1 var(--font-cond); letter-spacing: .01em; }
.brand-sub { font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one line, even with a fallback font (the logo takes room) */
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-s);
  color: inherit; text-decoration: none; font-weight: 600; font-size: 14.5px; opacity: .86;
}
.nav a:hover { background: rgba(255,255,255,.08); opacity: 1; }
.nav a[aria-current="page"] { background: rgba(255,255,255,.14); opacity: 1; }
.nav .count { margin-left: auto; background: var(--signal); color: var(--signal-ink); border-radius: 999px; font-size: 12px; padding: 0 7px; font-weight: 700; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; font-size: 12px; padding: 8px; white-space: nowrap; }
.side-foot a { color: inherit; opacity: .8; text-decoration: underline; text-underline-offset: 2px; }
.side-foot a:hover { opacity: 1; }
.brand-ver { font: 600 13px var(--font); opacity: .7; margin-left: 2px; letter-spacing: 0; }

main { padding: 28px 32px 80px; max-width: 1180px; width: 100%; }
.page-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }

.tabbar { display: none; }

@media (max-width: 640px) {
  .demo-bar { padding: 6px 16px; position: static; }
  .demo-bar > span:first-child { display: none; }
  .demo-bar .who { width: 100%; }
  .demo-bar label { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; white-space: nowrap; }
  .demo-bar .signed-in { display: none; }
  .demo-bar select { flex: 1; min-width: 0; }
  .shell { display: block; }
  .side { display: none; }
  main { padding: 18px 16px 96px; }
  h1 { font-size: 22px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar .tab-more { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; position: relative; }
  .tabbar a[aria-current="page"], .tabbar .tab-more[aria-current="page"] { color: var(--ink); }
  .tabbar .tab-more { background: none; border: 0; font-family: inherit; cursor: pointer; }
  .tabbar a span:not(.count), .tabbar .tab-more span:not(.count) { white-space: nowrap; letter-spacing: -0.01em; }
  .tabbar a, .tabbar .tab-more { padding-left: 0; padding-right: 0; min-width: 0; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .count { position: absolute; top: 2px; left: 55%; background: var(--signal); color: var(--signal-ink); border-radius: 999px; font-size: 10px; padding: 0 5px; font-weight: 700; }
}

/* ---------- building blocks ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 14px;
  border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.signal { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.btn.danger { color: var(--st-unfilled); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow); }
.panel-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-body { padding: 16px; }
.stack { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
/* 0.11.0 (Nick): on a computer the "Who gets offered" list stays in view while the post form scrolls, since each
   choice changes it. It scrolls inside itself if it is taller than the window. Phones keep it below the form. */
@media (min-width: 981px) {
  #preview { position: sticky; top: calc(var(--bar-h, 34px) + 16px); max-height: calc(100vh - var(--bar-h, 34px) - 32px); overflow-y: auto; }
}

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-pending_approval { color: var(--st-pending); }
.st-open, .st-filling { color: var(--st-filling); }
.st-filled { color: var(--st-filled); }
.st-unfilled { color: var(--st-unfilled); }
.st-completed { color: var(--st-completed); }
.st-cancelled { color: var(--st-cancelled); }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.warn { background: color-mix(in srgb, var(--signal) 22%, transparent); border-color: color-mix(in srgb, var(--signal) 60%, transparent); color: var(--ink); }
.tag.bad { color: var(--st-unfilled); border-color: color-mix(in srgb, var(--st-unfilled) 40%, transparent); }

/* Job ticket: the time block is the thing you read first. */
.tickets { display: grid; gap: 10px; }
.ticket {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--stripe, var(--line));
  border-radius: var(--radius-m); padding: 12px 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
a.ticket:hover { border-color: var(--muted); border-left-color: var(--stripe); }
.ticket.s-pending_approval { --stripe: var(--st-pending); }
.ticket.s-open, .ticket.s-filling { --stripe: var(--st-filling); }
.ticket.s-filled { --stripe: var(--st-filled); }
.ticket.s-unfilled { --stripe: var(--st-unfilled); }
.ticket.s-completed { --stripe: var(--st-completed); }
.ticket.s-cancelled { --stripe: var(--st-cancelled); opacity: .75; }
.when { font-family: var(--font-cond); line-height: 1; }
.when .d { font-size: 15px; font-weight: 600; color: var(--muted); }
.when .n { font-size: 30px; font-weight: 700; }
.when .t { font-size: 14px; font-weight: 600; margin-top: 3px; color: var(--muted); }
.ticket-main { min-width: 0; }
.ticket-title { font-weight: 700; font-size: 15.5px; }
.ticket-meta { color: var(--muted); font-size: 13px; display: flex; gap: 4px 12px; flex-wrap: wrap; margin-top: 2px; }
.ticket-side { text-align: right; display: grid; gap: 4px; justify-items: end; }
@media (max-width: 560px) {
  .ticket { grid-template-columns: 64px 1fr; }
  .ticket-side { grid-column: 1 / -1; justify-items: start; text-align: left; display: flex; gap: 8px; flex-wrap: wrap; }
  .when .n { font-size: 26px; }
}

.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

.callout { border: 1px solid color-mix(in srgb, var(--signal) 65%, transparent); background: color-mix(in srgb, var(--signal) 14%, var(--surface)); border-radius: var(--radius-m); padding: 14px 16px; display: grid; gap: 10px; }
.callout.bad { border-color: color-mix(in srgb, var(--st-unfilled) 60%, transparent); background: color-mix(in srgb, var(--st-unfilled) 10%, var(--surface)); }
.callout.info { border-color: var(--line); background: var(--surface-2); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Forms */
.field { display: grid; gap: 5px; align-content: start; } /* keep label, box, hint at the top when a neighbour in the row is taller */
.field > label, .field > .label { font-weight: 600; font-size: 13.5px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], select, textarea {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
}
textarea { min-height: 72px; resize: vertical; }
input[type=date], input[type=time] { padding-left: 8px; padding-right: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.span-6 { grid-column: span 6; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; } .span-2 { grid-column: span 2; }
@media (max-width: 640px) { .span-4, .span-3, .span-2 { grid-column: span 6; } }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }

.modes { display: grid; gap: 8px; }
.mode { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; background: var(--surface); }
.mode:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.mode:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.mode input { margin-top: 3px; }
.mode strong { display: block; }
.mode span { font-size: 13px; color: var(--muted); }

.error { color: var(--st-unfilled); font-weight: 600; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: min(520px, calc(100vw - 32px));
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-m); font-weight: 600; font-size: 14px;
}
@media (max-width: 640px) { .toast { bottom: 84px; } }
.toast.bad { background: var(--st-unfilled); color: #fff; }

dialog { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(10, 16, 24, .45); }
dialog form { padding: 18px; display: grid; gap: 14px; }

/* Who's next page (was Lists): the rotation pointer is the one bold element. */
.roster { list-style: none; margin: 0; padding: 0; }
.roster li { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); position: relative; }
.roster li:last-child { border-bottom: 0; }
.roster .seat { font: 700 22px/1 var(--font-cond); color: var(--muted); text-align: center; }
.roster li.next { background: color-mix(in srgb, var(--signal) 13%, var(--surface)); }
.roster li.next::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--signal); }
.roster li.next .seat { color: var(--ink); }
.roster li.out { opacity: .6; }
.roster .who strong { display: block; }
.roster .nums { display: flex; gap: 16px; font-size: 13px; color: var(--muted); text-align: right; }
.roster .nums b { display: block; font: 700 17px/1.1 var(--font-cond); color: var(--ink); }
.next-flag { font-size: 12px; font-weight: 700; color: var(--signal-ink); background: var(--signal); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
@media (max-width: 560px) { .roster li { grid-template-columns: 32px 1fr; } .roster .nums { grid-column: 2; justify-content: flex-start; text-align: left; } }

/* Offer order on a job */
.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ladder li:last-child { border-bottom: 0; }
.ladder .pos { font: 700 16px var(--font-cond); color: var(--muted); }
.ans { font-size: 12.5px; font-weight: 700; padding: 1px 8px; border-radius: 4px; white-space: nowrap; }
.ans-queued { color: var(--muted); background: var(--surface-2); }
.ans-sent { color: var(--signal-ink); background: var(--signal); }
.ans-accepted, .ans-awarded { color: #fff; background: var(--st-filled); }
.ans-declined, .ans-expired { color: var(--st-unfilled); background: color-mix(in srgb, var(--st-unfilled) 12%, transparent); }
.ans-not_awarded, .ans-withdrawn { color: var(--muted); background: var(--surface-2); }

/* Timeline log */
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--muted); font-size: 12.5px; }
@media (max-width: 560px) { .log li { grid-template-columns: 1fr; gap: 2px; } }

/* Calendar */
.cal-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cal-bar .title { font: 700 22px var(--font-cond); margin: 0 6px; min-width: 170px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.cal-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.cal-filters select { width: auto; min-height: 36px; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--line); gap: 1px; }
.month .dow { background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; }
.month .day { background: var(--surface); min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.month .day.other { background: var(--surface-2); }
.month .day .num { font: 600 15px var(--font-cond); color: var(--muted); }
/* 0.12.0 (Nick): the day whose list is open below gets a navy outline (today keeps its yellow number). */
.month .day.picked { outline: 3px solid var(--brand); outline-offset: -3px; background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.month .day.today .num { color: var(--signal-ink); background: var(--signal); border-radius: 4px; padding: 0 5px; align-self: flex-start; }
.chip { display: block; font-size: 12px; line-height: 1.3; padding: 2px 6px; border-radius: 4px; text-decoration: none; color: var(--ink); background: var(--surface-2); border-left: 3px solid var(--stripe, var(--line)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.s-pending_approval { --stripe: var(--st-pending); } .chip.s-open, .chip.s-filling { --stripe: var(--st-filling); }
.chip.s-filled { --stripe: var(--st-filled); } .chip.s-unfilled { --stripe: var(--st-unfilled); }
.chip.s-completed { --stripe: var(--st-completed); } .chip.s-cancelled { --stripe: var(--st-cancelled); text-decoration: line-through; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week .col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); min-height: 260px; display: flex; flex-direction: column; }
.week .col-head { padding: 8px 10px; border-bottom: 1px solid var(--line); font-family: var(--font-cond); }
.week .col-head .n { font-size: 24px; font-weight: 700; line-height: 1; }
.week .col-head .d { font-size: 14px; color: var(--muted); font-weight: 600; }
.week .col.today .col-head { background: color-mix(in srgb, var(--signal) 18%, var(--surface)); }
.week .col-body { padding: 8px; display: grid; gap: 6px; align-content: start; }
.wjob { display: block; text-decoration: none; color: inherit; font-size: 13px; padding: 6px 8px; border-radius: var(--radius-s); background: var(--surface-2); border-left: 4px solid var(--stripe, var(--line)); }
.wjob b { display: block; font: 700 14px var(--font-cond); }
.wjob.s-pending_approval { --stripe: var(--st-pending); } .wjob.s-open, .wjob.s-filling { --stripe: var(--st-filling); }
.wjob.s-filled { --stripe: var(--st-filled); } .wjob.s-unfilled { --stripe: var(--st-unfilled); }
.wjob.s-completed { --stripe: var(--st-completed); } .wjob.s-cancelled { --stripe: var(--st-cancelled); opacity: .7; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 640px) {
  .week { grid-template-columns: minmax(0, 1fr); }
  .week .col { min-height: 0; }
  .week .col-head { display: flex; gap: 8px; align-items: baseline; }
  .month .day { min-height: 64px; padding: 4px; }
  .month .chip { font-size: 0; padding: 0; height: 6px; border-left: 0; background: var(--stripe); border-radius: 3px; }
  .cal-filters { margin-left: 0; width: 100%; }
  .cal-filters select { flex: 1; }
}
.daylist { margin-top: 14px; }

/* Stat line */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.stats > div { background: var(--surface); padding: 12px 14px; }
.stats b { display: block; font: 700 28px/1 var(--font-cond); }
.stats span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Offer card for employees */
.offer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow); }
.offer-top { padding: 14px 16px; display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; }
.offer-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.offer-actions button { min-height: 52px; border: 0; background: var(--surface); font-weight: 700; font-size: 16px; cursor: pointer; }
.offer-actions button + button { border-left: 1px solid var(--line); }
.offer-actions .yes { color: var(--st-filled); }
.offer-actions .no { color: var(--st-unfilled); }
.offer-note { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); background: var(--surface-2); }

/* Rules page */
.rule { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.rule:last-child { border-bottom: 0; }
.rule .src { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 700px) { .rule { grid-template-columns: minmax(0, 1fr); } }

/* Messages */
.msg { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.msg:last-child { border-bottom: 0; }
.msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.msg-body { font-size: 14px; overflow-wrap: anywhere; }
.chan { font-size: 11.5px; font-weight: 700; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line); }
.chan.sms { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* Text status (0.9.0) */
.tstat { font-size: 11.5px; font-weight: 600; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line); }
.tstat.delivered, .tstat.sent { color: var(--st-filled); border-color: currentColor; }
.tstat.failed { color: var(--st-unfilled); border-color: currentColor; }

/* PIN screen */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate .panel { width: min(380px, 100%); }

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .18s ease-out; }
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }
}

.demo-bar label { display: flex; gap: 8px; align-items: center; white-space: nowrap; }

/* Employees */
.row-off td { opacity: .55; }
.emp-table td a { color: inherit; text-decoration: none; }
.emp-table td a:hover strong { text-decoration: underline; }
.skill-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--surface); font-size: 14px; }
.pick:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); font-weight: 600; }
.pick input { width: 16px; height: 16px; margin: 0; }
.skill-list li { grid-template-columns: 40px 1fr auto; }
.skill-list .who strong { display: inline; }
.skill-list .who .small { display: block; }
@media (max-width: 560px) { .skill-list li { grid-template-columns: 32px 1fr; } .skill-list .btn-row { grid-column: 2; } }

/* New version banner */
.update-bar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; gap: 12px; align-items: center;
  background: var(--ink); color: var(--bg); padding: 8px 10px 8px 16px; border-radius: var(--radius-m); font-weight: 600; font-size: 14px;
  max-width: calc(100vw - 32px); box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand > div:last-child { min-width: 0; }
.side .brand { gap: 8px; padding-left: 4px; padding-right: 4px; }
.side .brand-name { font-size: 18px; }
.side .brand-ver { font-size: 11px; }

/* Grid children must be allowed to shrink, or a wide table pushes the page sideways on phones. */
.stack > *, .grid-2 > * { min-width: 0; }
@media (max-width: 640px) {
  /* Employees on a phone: name, classification, status. The rest is one tap away. */
  .emp-table th:nth-child(3), .emp-table td:nth-child(3),
  .emp-table th:nth-child(4), .emp-table td:nth-child(4),
  .emp-table th:nth-child(5), .emp-table td:nth-child(5),
  .emp-table th:nth-child(7), .emp-table td:nth-child(7) { display: none; }
}

select.locked { background: var(--surface-2); pointer-events: none; }
.sub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sub-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Reports */
.linknum { border: 0; background: none; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-variant-numeric: tabular-nums; }
.row-now td { background: color-mix(in srgb, var(--signal) 10%, transparent); }
dialog .table-wrap { max-height: 60vh; overflow: auto; }

/* Printing: just the page content */
@media print {
  .demo-bar, .side, .tabbar, .no-print, .toast, .update-bar, .btn { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 12px; }
  .panel, .stats > div { box-shadow: none; border-color: #bbb; }
  .linknum { color: #000; text-decoration: none; }
  a { color: #000; text-decoration: none; }
}

/* Half screen (Bill: the calendar next to other systems). Between phone and full desktop the menu becomes an icon rail. */
@media (min-width: 641px) and (max-width: 1100px) {
  .shell { grid-template-columns: 60px 1fr; }
  .side { padding: 12px 8px; align-items: center; }
  .side .brand { padding: 4px 0 14px; justify-content: center; }
  .side .brand > div:last-child, .side .nav a span:not(.count), .side-foot { display: none; }
  .side .brand .brand-mark { display: block; width: 40px; height: 40px; }
  .side .brand .brand-mark-wide { display: none; }
  .side .nav { width: 100%; }
  .side .nav a { justify-content: center; padding: 10px 0; position: relative; }
  .side .nav .count { position: absolute; top: 2px; right: 2px; margin: 0; font-size: 10px; padding: 0 5px; }
  main { padding: 20px 20px 60px; }
  .week { gap: 4px; }
  .week .col-head { padding: 6px; }
  .week .col-body { padding: 4px; gap: 4px; }
  .wjob { font-size: 12px; padding: 4px 5px; border-left-width: 3px; }
  .wjob b { font-size: 13px; }
  .cal-bar .title { min-width: 0; font-size: 19px; }
  .cal-filters { margin-left: 0; }
}

/* Week view with hourly rows, like Outlook (Nick, Nov 5).
   One scroll box: day names stay at the top, hours stay at the left.
   A job block runs from its start minute to its end minute; overlapping jobs share the column. */
.tgrid {
  --hour: 44px; --gutter: 56px; position: relative;
  display: grid; grid-template-columns: var(--gutter) repeat(7, minmax(0, 1fr)); grid-template-rows: auto calc(var(--hour) * 24);
  max-height: min(70vh, 720px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface);
  overscroll-behavior: contain;
}
.tg-corner { position: sticky; top: 0; left: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.tg-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line);
  padding: 6px 8px; font-family: var(--font-cond); white-space: nowrap; }
.tg-head .d { font-size: 14px; color: var(--muted); font-weight: 600; }
.tg-head .n { font-size: 20px; font-weight: 700; }
.tg-head.today { background: color-mix(in srgb, var(--signal) 22%, var(--surface)); }
.tg-hours { position: sticky; left: 0; z-index: 2; background: var(--surface); grid-row: 2; grid-column: 1; }
.tg-hour { height: var(--hour); font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.tg-day { grid-row: 2; position: relative; border-left: 1px solid var(--line);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour); }
.tg-day.today { background-color: color-mix(in srgb, var(--signal) 6%, transparent); }
.tg-now { position: absolute; left: 0; right: 0; top: calc(var(--at) / 60 * var(--hour)); border-top: 2px solid var(--st-unfilled); z-index: 1; }
.tjob {
  position: absolute; z-index: 1; overflow: hidden; text-decoration: none; color: var(--ink);
  top: calc(var(--start) / 60 * var(--hour)); height: max(22px, calc((var(--end) - var(--start)) / 60 * var(--hour) - 2px));
  left: calc(var(--lane) / var(--lanes) * 100% + 2px); width: calc(100% / var(--lanes) - 4px);
  background: color-mix(in srgb, var(--stripe, var(--line)) 16%, var(--surface)); border-left: 4px solid var(--stripe, var(--line));
  border-radius: 4px; padding: 3px 6px; font-size: 12px; line-height: 1.25; box-shadow: 0 0 0 1px var(--surface);
}
.tjob:hover, .tjob:focus-visible { z-index: 2; box-shadow: 0 0 0 2px var(--brand); }
.tjob b { display: block; font: 700 12px var(--font-cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tjob .t { display: block; font-weight: 600; }
.tjob .w { display: block; color: var(--muted); }
.tjob.cont { border-top: 2px dashed var(--stripe, var(--line)); border-top-left-radius: 0; border-top-right-radius: 0; }
.tjob.goes-on { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.tjob.s-pending_approval { --stripe: var(--st-pending); } .tjob.s-open, .tjob.s-filling { --stripe: var(--st-filling); }
.tjob.s-filled { --stripe: var(--st-filled); } .tjob.s-unfilled { --stripe: var(--st-unfilled); }
.tjob.s-completed { --stripe: var(--st-completed); } .tjob.s-cancelled { --stripe: var(--st-cancelled); opacity: .7; text-decoration: line-through; }
/* "More below" markers on the week view (Nick, Nov 10): drawn over the grid, one per day with hidden jobs. */
.tg-wrap { position: relative; }
.tg-marks { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.tg-more {
  position: absolute; pointer-events: auto; height: 28px; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--brand); color: #fff; font-family: inherit; font-size: 12px; font-weight: 600; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 6px rgba(0,0,0,.25); opacity: .95;
}
.tg-more:hover, .tg-more:focus-visible { opacity: 1; outline: 2px solid var(--signal); outline-offset: 1px; }
.tg-more span { font-size: 10px; margin-right: 4px; }
.cal-filters { margin-bottom: 14px; }

/* Rules page (v0.6.2): CBA text under a rule, Yes / No buttons, start and end time on one row. */
/* v0.7.0: the CBA text under a rule opens with a ? button (Nick, Nov 10). */
.q-btn { width: 20px; height: 20px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--brand); background: var(--surface); color: var(--brand);
  font: 700 12px/1 var(--font); cursor: pointer; vertical-align: 1px; padding: 0; }
.q-btn[aria-expanded="true"] { background: var(--brand); color: var(--brand-ink); }
.q-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cba-q { margin: 8px 0 2px; padding: 8px 12px; border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: 13px; max-width: 70ch; }
.cba-q p { margin: 0 0 4px; font-style: italic; }
.cba-q a { font-size: 12px; font-weight: 600; }
.time-pair { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.time-pair input { min-width: 0; width: 8.5em; }
.close-btns { margin-top: 8px; }
.org-tz { margin: 2px 0 0; font-weight: 600; }
/* 0.12.0: the skills fieldset on the post form, and the "Who gets offered" card tinted (Nick: it matters more and more). */
.skill-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.skill-field legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.skill-field .skill-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-field .limit-pick { margin-top: 8px; font-weight: 600; }
/* 0.12.0 (Nick, on the test copy): "Who gets offered" has the form's background, a dark title and a colored edge that
   shows the state of the post: red (it won't work as posted), yellow (read the note), green (nothing to read).
   Grey edge while the form is not filled in enough to tell. */
#preview { --st-edge: var(--muted); border: 2px solid color-mix(in srgb, var(--st-edge) 55%, var(--line)); border-top: 6px solid var(--st-edge); }
#preview .panel-head h2 { color: var(--brand); }
#preview.st-red { --st-edge: var(--st-unfilled); }
#preview.st-yellow { --st-edge: var(--signal); }
#preview.st-green { --st-edge: var(--st-filled); }
.left-out { color: var(--ink); }
.skill-until { margin-top: 10px; display: grid; gap: 6px; }
/* 0.12.0: Settings tabs (supervisors) and the employee's info list. */
.set-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 18px; }
.set-tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.set-tabs a:hover { color: var(--ink); }
.set-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.set-tabs .count { background: var(--signal); color: var(--signal-ink); border-radius: 999px; font-size: 12px; padding: 0 7px; }
.info-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 600; }
.panel-sep { border-top: 1px solid var(--line); }
.until-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.until-row input { width: auto; }
.close-info { font-weight: 600; color: var(--ink); }
.seg.yn button { min-width: 56px; }
.seg.yn button:disabled { opacity: .55; cursor: not-allowed; }
.who-pick { border: 0; padding: 0; margin: 0; }
.who-pick .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.print-only { display: none; }

/* Phone: one day fills the width. Swipe sideways for the next day; the hours stay put. */
@media (max-width: 640px) {
  .tgrid { --gutter: 44px; grid-template-columns: var(--gutter) repeat(7, calc(100vw - 32px - 2px - var(--gutter)));
    scroll-snap-type: x mandatory; scroll-padding-left: var(--gutter); max-height: 68vh; }
  .tg-head, .tg-day { scroll-snap-align: start; }
}

/* Print the calendar on one landscape page: all 24 hours, smaller rows. */
@page cal { size: letter landscape; margin: 0.4in; }
@media print {
  .print-only { display: block; }
  .print-title { font-weight: 600; margin: 0 0 6px; }
  .cal-bar, .cal-filters, .legend { display: none !important; }
  main:has(.cal-print) .page-head { display: none !important; }
  .cal-print { page: cal; }
  .tg-day { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tgrid { --hour: 20px; max-height: none; overflow: visible; grid-template-columns: 46px repeat(7, minmax(0, 1fr)); }
  .tg-hour { font-size: 8px; white-space: nowrap; transform: translateY(-5px); }
  .tg-head, .tg-corner, .tg-hours { position: static; }
  .tg-now { display: none; }
  .tjob { font-size: 8px; padding: 1px 3px; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tjob b { font-size: 8px; } .tjob .w { display: none; }
  .month .day { min-height: 70px; break-inside: avoid; }
  .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.filt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.filt-grid .who-pick { grid-column: 1 / -1; }
@media (max-width: 640px) { .filt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.install-card { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.side-install { display: block; background: none; border: 1px solid rgba(255,255,255,.35); color: inherit; border-radius: var(--radius-s); padding: 4px 8px; margin-bottom: 8px; font: inherit; cursor: pointer; }
.side-install:hover { background: rgba(255,255,255,.08); }
ol.steps { padding-left: 20px; display: grid; gap: 6px; }
.row-bad td { background: color-mix(in srgb, var(--st-unfilled) 8%, transparent); }
.small.warn { color: var(--ink); background: color-mix(in srgb, var(--signal) 18%, transparent); border-radius: 4px; padding: 1px 4px; margin-top: 2px; }

/* Job record: printable, plain */
.rec { display: grid; gap: 18px; }
.rec-head { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.rec-title { font-size: 24px; margin: 2px 0; }
.rec-meta { line-height: 1.6; }
.rec-sec h2 { font-size: 17px; margin: 0 0 6px; }
.rec-sec h3 { font-size: 14px; margin: 12px 0 4px; }
.rec-table { width: 100%; font-size: 13px; }
.rec-table th, .rec-table td { padding: 4px 6px; }
.rec-list { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; }
.rec-when { font-variant-numeric: tabular-nums; color: var(--muted); }
@media print {
  .rec { box-shadow: none; border: 0; padding: 0; }
  .rec-sec { break-inside: auto; }
  .rec-table tr { break-inside: avoid; }
  .rec-rules { break-before: page; }
}
.rec-rules .rec-table { table-layout: fixed; }
.rec-rules .rec-table td:nth-child(1) { width: 34%; }
.rec-rules .rec-table td:nth-child(2) { width: 20%; }

/* Text messages opt-in (My overtime). The consent words sit right next to the box people tick. */
.sms-form { display: grid; gap: 12px; }
.check.consent { max-width: 680px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2, transparent); }
.check.consent input { width: 22px; height: 22px; flex: 0 0 22px; margin-top: 2px; }
.check.consent span { font-size: 14px; line-height: 1.5; }
.sms-panel .btn-row { align-items: center; }

/* v0.7.0: System check page and banner. */
.sys-banner { margin-bottom: 16px; }
#sysTable #secExp { max-width: 180px; }
#sysTable .check span { white-space: nowrap; }
/* On a phone each check is a card, not a wide table row. */
@media (max-width: 640px) {
  #sysTable thead { display: none; }
  #sysTable, #sysTable tbody, #sysTable tr, #sysTable td { display: block; width: 100%; }
  #sysTable tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  #sysTable td { padding: 2px 0; border: 0; }
}
.test-badge { background: #b42318; color: #fff; padding: 1px 8px; border-radius: 4px; margin-right: 6px; letter-spacing: .02em; }

/* Approve screen: who gets offered (0.10.0) */
.pending-list { margin: 12px 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.pending-list h3 { margin: 0 0 4px; font-size: 15px; }
.pending-list ol { margin: 8px 0 0; padding-left: 22px; }
.pending-list details { margin-top: 8px; }
.pending-list details ul { margin: 6px 0 0; padding-left: 18px; }

/* Jobs waiting for approval, top of Today (0.10.0) */
.approve-box { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: flex-start; margin: 0 0 16px; padding: 14px 16px;
  background: color-mix(in srgb, var(--signal) 22%, var(--surface)); border: 2px solid var(--signal); border-radius: var(--radius-m); }
.approve-box > div { flex: 1 1 260px; }
.approve-box p { margin: 4px 0 0; }
.approve-box ul { list-style: none; margin: 0; padding: 0; flex: 1 1 320px; display: grid; gap: 8px; }

/* CBA tips (0.10.0): "CBA II §2" in any text opens the CBA's words */
.cba-ref { font: inherit; color: var(--brand); background: none; border: 0; padding: 0; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.cba-ref:hover { text-decoration-style: solid; }
.cba-ref:focus-visible { outline: 2px solid var(--focus, var(--signal)); outline-offset: 2px; border-radius: 2px; }
.cba-quote { margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--line); background: var(--surface-2); font-size: 14px; line-height: 1.5; }
#dlg h2 + .cba-quote { margin-top: 12px; }

/* How the list works (0.10.0) */
.help .panel-body > p, .help .panel-body li, .help dd { line-height: 1.55; max-width: 72ch; }
.help .panel-body ul { padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.help h3 { margin: 16px 0 8px; font-size: 15px; }
.help-table { border-collapse: collapse; width: 100%; max-width: 760px; font-size: 14px; }
.help-table th, .help-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.help-table td.why { color: var(--muted); }
.help-dl dt { font-weight: 600; margin-top: 12px; }
.help-dl dt:first-child { margin-top: 0; }
.help-dl dd { margin: 4px 0 0; }
.side-foot a + a { margin-left: 0; display: block; margin-top: 4px; }
.help .panel-body > * + * { margin-top: 10px; }
.help .panel-body > p { margin-bottom: 0; }
.list-filter { max-width: 280px; margin: 0; flex: 0 1 280px; }
/* 0.13.0 (Nick): the Group filter and the two buttons on one row, filter left, buttons right; they wrap on a phone. */
.list-tools { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.list-tools-btns { margin-left: auto; }

/* 0.13.0: sortable table headings (app.js sortTables). The button looks like the heading text. */
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; }
.th-sort:focus-visible { outline: 2px solid var(--focus, #2563eb); outline-offset: 2px; border-radius: 3px; }
.sort-arrow { font-size: 0.75em; opacity: 0.55; }
th[aria-sort="ascending"] .sort-arrow, th[aria-sort="descending"] .sort-arrow { opacity: 1; }
th.num .th-sort { justify-content: flex-end; }

/* 0.13.0 (Nick): the time off list and the form to add one are clearly apart: a heavier line, a title and a light gray area for what is entered, on top; the list below. */
.to-add { border-bottom: 2px solid var(--line); padding: 4px 0 6px; background: var(--surface-2); }
/* 0.13.0 (Nick): the form on top, the list of time off already entered below it, with its own title. */
.to-list-title { margin: 18px 16px 6px; font-size: 1rem; }
.to-add-title { margin: 14px 16px 0; font-size: 1rem; }
.to-add #toForm { padding-top: 10px; }

/* 0.13.0 (Nick, phone check): "More" on the phone menu opens a sheet that slides up (Messages, Reports for supervisors). */
.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border: 0; border-radius: 16px 16px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); color: var(--ink); box-shadow: 0 -8px 30px rgb(0 0 0 / 0.2); }
.sheet::backdrop { background: rgb(0 0 0 / 0.35); }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 10px; }
.sheet-nav { display: grid; gap: 4px; }
.sheet-nav a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 17px; position: relative; }
.sheet-nav a[aria-current="page"] { background: var(--surface-2); }
.sheet-nav svg { width: 24px; height: 24px; }
.sheet-nav .count { margin-left: auto; background: var(--signal); color: var(--signal-ink); border-radius: 999px; font-size: 12px; padding: 1px 8px; font-weight: 700; }
.sheet-close { width: 100%; min-height: 48px; margin-top: 10px; }
@media (prefers-reduced-motion: no-preference) { .sheet[open] { animation: sheet-up 0.18s ease-out; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

/* 0.13.0 (Nick, phone check): on a phone a "cards-sm" table is one card per row, each value under its heading
   (data-label, set by labelCells in app.js). Buttons wrap inside the card instead of going past the screen edge. */
@media (max-width: 640px) {
  table.cards-sm, table.cards-sm tbody, table.cards-sm tr, table.cards-sm td { display: block; width: 100%; }
  table.cards-sm { min-width: 0 !important; }
  table.cards-sm thead { display: none; } /* each cell shows its heading (data-label); a hidden-but-there head still stuck out past the edge */
  table.cards-sm tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.cards-sm td { border: 0; padding: 3px 0; text-align: left !important; white-space: normal !important; }
  table.cards-sm td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
  table.cards-sm td:first-child[data-label]::before { display: none; }
  table.cards-sm td:empty { display: none; }
  table.cards-sm td .btn { min-height: 44px; margin: 4px 6px 0 0; }
  table.cards-sm input, table.cards-sm select { width: 100%; min-height: 44px; font-size: 16px; padding: 8px 12px; border-radius: 8px; }
  table.cards-sm td:first-child { font-weight: 700; }
}

/* 0.13.0 (Nick, phone check): the post form's status bar on narrow screens (the card is not beside the form there). */
.preview-mini { display: none; }
@media (max-width: 980px) {
  .preview-mini { --st-edge: var(--muted); display: flex; align-items: center; gap: 10px; position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 19;
    min-height: 48px; padding: 8px 14px; border: 1px solid var(--line); border-left: 6px solid var(--st-edge); border-radius: 10px;
    background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; text-align: left; box-shadow: 0 6px 20px rgb(0 0 0 / 0.15); cursor: pointer; }
  .preview-mini.hide, .preview-mini.in-view { display: none; }
  .preview-mini.st-red { --st-edge: var(--st-unfilled); }
  .preview-mini.st-yellow { --st-edge: var(--signal); }
  .preview-mini.st-green { --st-edge: var(--st-filled); }
  .preview-mini .mini-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--st-edge); flex: none; }
  .preview-mini > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .preview-mini .mini-go { color: var(--muted); font-size: 13px; white-space: nowrap; }
}
@media (max-width: 640px) { .preview-mini { bottom: calc(70px + env(safe-area-inset-bottom)); } }
@media print { .preview-mini { display: none !important; } }

/* 0.14.0: the Organization color field. */
.color-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.color-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.color-row select { flex: 0 1 240px; }
.color-row input[type=color] { width: 56px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.color-swatch { display: grid; place-items: center; width: 56px; height: 44px; border-radius: 8px; color: #fff; font-weight: 700; }

/* 0.14.0: the phone top bar and the "you" sheet. Wider screens keep the side menu and the demo bar. */
.phone-top { display: none; }
@media (max-width: 640px) {
  .demo-bar { display: none; }
  .phone-top { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 25; height: 56px; padding: 0 6px 0 14px;
    background: var(--brand); color: var(--brand-ink); }
  .phone-top .brand-mark-wide { height: 24px; color: var(--brand-ink); }
  .pt-title { flex: 1; min-width: 0; font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pt-back { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -8px; color: var(--brand-ink); }
  .pt-back svg { width: 24px; height: 24px; }
  .pt-test { font-size: 11px; }
  .pt-me { width: 44px; height: 44px; border: 0; background: none; padding: 0; display: grid; place-items: center; cursor: pointer; }
  .pt-me span { width: 32px; height: 32px; border-radius: 50%; background: var(--signal); color: var(--signal-ink); display: grid; place-items: center; font: 700 13px var(--font); }
  main[data-top] .page-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .install-card { display: none; }
  main { padding-top: 14px; }
}
.me-who { display: flex; flex-direction: column; margin: 0 0 12px; }
.me-viewas { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-weight: 600; }
.me-viewas select { min-height: 48px; font-size: 16px; }

/* 0.14.0 (phone first): touch targets 44 px or more on phones; fields 48 px; buttons 44 to 48 px. Links inside
   a sentence stay as they are (they are text); links standing alone in a panel head or a row get a 44 px tap area. */
@media (max-width: 640px) {
  .btn, .btn.small { min-height: 44px; padding: 8px 16px; font-size: 15px; }
  .btn.primary, .btn.signal { min-height: 48px; }
  input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=hidden]), select, textarea { min-height: 48px; font-size: 16px; }
  .panel-head a, .btn-row > a:not(.btn), .page-head a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
  .seg button, .cal-bar .btn { min-height: 44px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
}

/* 0.14.0: status chips and job cards in the status colors (light values; dark mode tints). */
:root {
  --chip-pending-bg: #FBF0D8; --chip-pending: #8A5600;
  --chip-open-bg: #E5EDF7; --chip-open: #28589F;
  --chip-filled-bg: #E6F2E9; --chip-filled: #1F6B43;
  --chip-unfilled-bg: #F8E4E4; --chip-unfilled: #A13B2A;
  --chip-done-bg: #EFF0F2; --chip-done: #46515E;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chip-pending-bg: #3a2c10; --chip-pending: #f0c060; --chip-open-bg: #1c2c45; --chip-open: #9cc0f5;
    --chip-filled-bg: #163222; --chip-filled: #7fd3a4; --chip-unfilled-bg: #3d1c17; --chip-unfilled: #f6a08f;
    --chip-done-bg: #262f39; --chip-done: #b4bec9;
  }
}
.status.chip { padding: 3px 10px 3px 8px; border-radius: 999px; line-height: 18px; gap: 5px; }
.status.chip::before { display: none; }
.status.chip svg { width: 14px; height: 14px; flex: none; }
.status.chip.st-pending_approval, .ticket.s-pending_approval .when { background: var(--chip-pending-bg); color: var(--chip-pending); }
.status.chip.st-open, .status.chip.st-filling, .ticket.s-open .when, .ticket.s-filling .when { background: var(--chip-open-bg); color: var(--chip-open); }
.status.chip.st-filled, .ticket.s-filled .when { background: var(--chip-filled-bg); color: var(--chip-filled); }
.status.chip.st-unfilled, .ticket.s-unfilled .when { background: var(--chip-unfilled-bg); color: var(--chip-unfilled); }
.status.chip.st-completed, .status.chip.st-cancelled, .ticket.s-completed .when, .ticket.s-cancelled .when { background: var(--chip-done-bg); color: var(--chip-done); }
.ticket { border-left-width: 1px; border-radius: 12px; }
.ticket .when { border-radius: 8px; padding: 8px 4px; text-align: center; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.ticket .when .d, .ticket .when .t { color: inherit; }
@media (max-width: 560px) {
  .ticket { grid-template-columns: 58px 1fr; gap: 12px; padding: 12px; }
  .ticket .when .n { font-size: 22px; }
  .ticket .when .d, .ticket .when .t { font-size: 12px; }
  .ticket-title { font-size: 16px; }
}

/* 0.14.0 (Today): each job waiting for approval is a row with one clear button; on a phone the button is
   full width. The Post overtime button in the page head is left to the bottom menu on a phone. */
.approve-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.approve-what { flex: 1 1 240px; min-width: 0; }
@media (max-width: 640px) {
  .approve-go { width: 100%; }
  main[data-top] .page-head .btn.primary[href="#/new"] { display: none; }
}

/* 0.14.0 (Post overtime on a phone): date and people, start and end side by side; four skills, then Show all. */
.skill-more { display: none; }
@media (max-width: 640px) {
  .form-grid .ph-half { grid-column: span 3; }
  .skill-picks.short .pick:nth-child(n+5):not(:has(input:checked)) { display: none; }
  .skill-more { display: inline-flex; align-items: center; min-height: 44px; }
  .skill-picks .pick { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
}
.skill-more { color: var(--brand); font-weight: 600; }

/* 0.14.0: the job page's bottom bar (phone only). */
.job-bar { display: none; }
@media (max-width: 640px) {
  .job-bar:not([hidden]) { display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 18;
    padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--line); }
  .job-bar .btn { min-height: 48px; }
  .job-bar #jobMain { flex: 1; }
  body.has-jobbar main { padding-bottom: 170px; }
  body.has-jobbar .job-acts, body.has-jobbar main .callout .btn.signal { display: none; }
  .sheet-nav a.danger { color: var(--st-unfilled); }
}

/* 0.14.0: Settings on a phone: one drop-down instead of six tabs. */
.set-pick { display: none; }
@media (max-width: 640px) {
  .set-tabs { display: none; }
  .set-pick { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
}

.emp-find { flex: 1 1 220px; max-width: 320px; }
@media (max-width: 640px) { .emp-tools .emp-find { max-width: none; flex-basis: 100%; } }
.msg-day { margin: 0; padding: 10px 16px 4px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.msg-day:first-child { border-top: 0; }
.msg-more { width: 100%; }

/* 0.14.0: Reports on a phone: the two dates side by side with "to" between, Show full width, group full width. */
@media (max-width: 640px) {
  .r-custom { display: grid !important; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; width: 100%; }
  .r-custom input[type=date] { width: 100% !important; min-width: 0; }
  .r-custom .btn { grid-column: 1 / -1; }
  .r-cls { width: 100% !important; margin-left: 0 !important; }
}
.to-add { border-radius: var(--radius-m) var(--radius-m) 0 0; }

.ticket { border-left-color: var(--line); }
a.ticket:hover { border-left-color: var(--muted); }
#meSheet form { margin: 0; }
@media (max-width: 640px) { .page-back { display: none !important; } }

/* 0.15.0: Rules groups open and close (the page was very long on a phone). */
details.rule-group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
details.rule-group > summary::-webkit-details-marker { display: none; }
details.rule-group > summary h2::before { content: '▸'; display: inline-block; width: 1.1em; transition: transform .15s; color: var(--muted); }
details.rule-group[open] > summary h2::before { transform: rotate(90deg); }
#workTypes td .btn { min-height: 36px; }

/* 0.16.0: the manuals (public/js/manual.js). On screen a readable column; in print a document: a title page,
   each chapter on a new page, steps and pictures never split, no menus or buttons. */
.side-help { display: block; margin-bottom: 8px; }
.m-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.m-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); color: inherit; text-decoration: none; min-height: 44px; }
.m-card:hover { border-color: var(--brand); }
.m-card strong { color: var(--brand); font-size: 16px; }
.manual { max-width: 760px; line-height: 1.55; }
.manual h2 { font-size: 20px; margin: 28px 0 10px; }
.manual h3 { font-size: 16px; margin: 18px 0 6px; }
.m-toc { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 16px; background: var(--surface); }
.m-toc ol { margin: 0; padding-left: 20px; }
.m-toc a { display: inline-block; padding: 6px 0; min-height: 32px; }
.m-steps, .m-list { padding-left: 22px; }
.m-steps li, .m-list li { margin: 6px 0; }
.m-steps li::marker { font-weight: 700; color: var(--brand); }
.m-note { border-left: 4px solid var(--brand); background: var(--surface); padding: 8px 12px; border-radius: 4px; }
.m-fig { margin: 14px 0; max-width: 300px; }
.m-fig.wide { max-width: 100%; }
.m-fig img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; display: block; }
.m-fig figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.quick .q-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.quick .q-qr { margin: 0; text-align: center; font-size: 12px; }
.quick .q-qr img { display: block; width: 132px; height: 132px; margin: 0 auto 4px; background: #fff; }
.quick .q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; }
.quick .q-grid h2 { font-size: 16px; margin: 10px 0 4px; }
.quick .q-grid p { margin: 0; }
.quick .q-foot { margin-top: 12px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; }
.m-title-org { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) { .quick .q-head { flex-direction: column-reverse; } .quick .q-grid { grid-template-columns: 1fr; } }

@media print {
  body.printing-manual { font-family: Inter, system-ui, sans-serif; font-size: 11pt; color: #000; }
  body.printing-manual .phone-top, body.printing-manual .page-head, body.printing-manual .sys-banner, body.printing-manual .m-toc { display: none !important; }
  body.printing-manual .print-only { display: block; }
  body.printing-manual main { padding: 0 !important; margin: 0 !important; }
  body.printing-manual .manual { max-width: none; line-height: 1.45; }
  .manual .m-title { break-after: page; padding-top: 30mm; }
  .manual .m-title h1 { font-size: 30pt; margin: 6mm 0 2mm; color: var(--brand); }
  .manual .m-title h2 { font-size: 20pt; margin: 0 0 8mm; }
  .manual .m-title .m-title-ver { font-size: 13pt; font-weight: 700; margin: 10mm 0 4mm; }
  .manual .m-toc-print { font-size: 12pt; line-height: 1.8; }
  .manual .m-ch { break-before: page; }
  .manual .m-ch h2 { font-size: 17pt; color: var(--brand); margin-top: 2mm; }
  .manual .m-stamp { font-size: 8pt; color: #555; margin: 0 0 2mm; border-bottom: 1px solid #ccc; padding-bottom: 1mm; }
  .manual h3, .manual h2 { break-after: avoid; }
  .manual .m-steps li, .manual .m-list li, .manual .m-note, .manual .m-fig { break-inside: avoid; }
  .manual .m-fig { max-width: 62mm; }
  .manual .m-note { background: none; border-left-color: #000; }
  .manual a { color: #000; text-decoration: none; }
  .manual .no-print { display: none !important; }
  /* The quick start: one Letter page. */
  .manual.quick { font-size: 10.5pt; }
  .manual.quick .q-qr img { width: 38mm; height: 38mm; }
  .manual.quick .q-grid { gap: 2mm 8mm; }
  .manual.quick .m-fig { max-width: 50mm; margin: 4mm auto 0; }
}
