/* Northfield Ambulance design system — colors drawn from the department patch:
   deep navy (border/lettering), fire-engine red (banners/flag), cream field,
   autumn gold + Star-of-Life blue as accents. Civic, bold, trustworthy. */
:root {
  --navy: #0b2545;        /* primary brand — topbar, headings */
  --navy-700: #123a63;
  --red: #c1272d;         /* fire-engine red — primary actions, alerts */
  --red-700: #a11f24;
  --star-blue: #2b6cb0;   /* Star of Life blue — links, info */
  --gold: #d99a00;        /* autumn accent — highlights, warnings */
  --green: #2f7d4f;       /* success / compliant */
  --cream: #e7edf5;       /* page background — light blue-gray (patch navy tint) */
  --surface: #ffffff;
  --ink: #16232e;
  --muted: #5f6b74;
  --line: #cdd6e2;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(11, 37, 69, 0.12);
  --shadow-lg: 0 6px 22px rgba(11, 37, 69, 0.16);
  --tap: 46px; /* min touch target */
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.app-loading { padding: 2rem; color: var(--muted); }

/* ---- Top bar: navy with a red accent underline, echoing the patch banner ---- */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  border-bottom: 4px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .page-title { flex-basis: 100%; text-align: center; font-size: 1.55rem; font-weight: 800; color: #fff; margin: 0.15rem 0 0; letter-spacing: 0.01em; }
.topbar .brand-logo { height: 40px; width: 40px; border-radius: 10px; background: #fff; padding: 2px; object-fit: contain; flex: 0 0 auto; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.topbar .brand { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.01em; }
.topbar .brand small { display: block; font-size: 0.7rem; font-weight: 500; opacity: 0.8; letter-spacing: 0.14em; text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.topbar .link { color: #fff; opacity: 0.85; font-size: 0.9rem; text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.6rem 0.5rem; margin: -0.6rem -0.5rem; }
.topbar .link:hover { opacity: 1; }

/* ---- Layout ---- */
#app { min-height: 100vh; }
.container { max-width: 720px; margin: 0 auto; padding: 1rem; }
@media (min-width: 640px) { .container { padding: 1.5rem; } }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  margin: 0 0 1rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.card h1 { margin: 0 0 0.35rem; font-size: 1.35rem; color: var(--navy); }
.card.center-logo { text-align: center; }
.card.center-logo h1, .card.center-logo p { text-align: center; }
.login-logo { display: block; width: 148px; height: auto; margin: 0.25rem auto 0.9rem; }
.card h2 { margin: 0 0 0.75rem; font-size: 1.1rem; color: var(--navy); }
.card p { margin: 0.4rem 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---- Buttons ---- */
button, .btn {
  min-height: var(--tap);
  padding: 0.65rem 1.15rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  width: 100%;
}
button:hover, .btn:hover { background: var(--red-700); }
button:active, .btn:active { transform: translateY(1px); }
button[disabled], .btn[disabled] { background: #a9b2bc; cursor: not-allowed; }
.btn-navy { background: var(--navy); } .btn-navy:hover { background: var(--navy-700); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-ghost:hover { background: rgba(11,37,69,0.06); }
.btn-inline { width: auto; display: inline-flex; align-items: center; justify-content: center; }

/* ---- Forms ---- */
label.field { display: block; margin: 0.9rem 0; font-weight: 600; color: var(--navy); }
label.field input, label.field select, label.field textarea {
  display: block; width: 100%; margin-top: 0.4rem; min-height: var(--tap);
  padding: 0.55rem 0.8rem; border: 1.5px solid var(--line); border-radius: var(--radius);
  font-size: 1rem; background: #fff; color: var(--ink);
}
label.field textarea { font-family: inherit; resize: vertical; }
label.field input:focus, label.field select:focus, label.field textarea:focus { outline: none; border-color: var(--star-blue); box-shadow: 0 0 0 3px rgba(43,108,176,0.15); }
.error-msg { color: var(--red-700); font-weight: 600; margin: 0.5rem 0 0; }
.success-msg { color: var(--green); font-weight: 600; margin: 0.5rem 0 0; }
.hint { font-size: 0.85rem; color: var(--muted); font-weight: 400; }

/* ---- SMS consent block ---- */
.consent { display: flex; gap: 0.6rem; align-items: flex-start; margin: 1rem 0;
  padding: 0.9rem; background: #f1f5f9; border-radius: var(--radius); border: 1px solid var(--line); }
.consent input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--star-blue); }
.consent .disclosure { font-size: 0.9rem; color: var(--ink); }

.dlg-msg { margin: 0.35rem 0 0.9rem; line-height: 1.5; color: var(--ink); }

/* ---- Swap mode banner + swap rows ---- */
.swapbar { background: rgba(217,154,0,0.14); border: 1px solid rgba(217,154,0,0.45); border-radius: 10px;
  padding: 0.55rem 0.8rem; font-size: 0.9rem; color: var(--navy); display: flex; align-items: center;
  gap: 0.45rem; flex-wrap: wrap; margin-top: 0.6rem; }
.swapbar em { font-style: normal; font-weight: 700; }
.swap-entry .pos { line-height: 1.45; }

/* ---- Badges / status ---- */
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.badge-ok { background: rgba(47,125,79,0.15); color: var(--green); }
.badge-warn { background: rgba(217,154,0,0.18); color: #8a6200; }
.badge-red { background: rgba(193,39,45,0.13); color: var(--red-700); }
.badge-run { background: rgba(43,108,176,0.14); color: var(--star-blue); flex: 0 0 auto; }
.badge-muted { background: #eceef1; color: var(--muted); }
/* Crew-chief marker on a run's crew line — the member the report ladder chases (open Q#3). */
.badge-cc { background: rgba(11,37,69,0.12); color: var(--navy, #0b2545); padding: 0.02rem 0.35rem; font-size: 0.66rem; letter-spacing: 0.03em; vertical-align: middle; }

/* ---- Timecard table ---- */
.tc-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 480px; }
.tc-table th, .tc-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); text-align: right; }
.tc-table th:first-child, .tc-table td:first-child { text-align: left; }
.tc-table thead th { background: #f4f7fb; color: var(--navy); font-weight: 700; font-size: 0.78rem; }

/* ---- Payroll (officer roster + member detail — pay engine v2) ---- */
.tc-table tr.pr-row { cursor: pointer; }
.tc-table tr.pr-row:hover td { background: #eef3f8; }
.tc-table tr.pr-row td { min-height: var(--tap); }

/* ---- Meter (hours to compliance) ---- */
.meter { height: 12px; background: #e7e2d6; border-radius: 999px; overflow: hidden; margin: 0.5rem 0; }
.meter > span { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.meter.under > span { background: var(--gold); }

/* ---- Simple bottom nav for the member app ---- */
.tabbar { position: sticky; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); z-index: 20;
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar a { flex: 1; min-width: 0; text-align: center; padding: 0.6rem 0.15rem; color: var(--muted); text-decoration: none; font-size: 0.78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabbar a.active { color: var(--red); }
.tabbar a .ico { display: block; font-size: 1.2rem; line-height: 1.3; }

/* ---- Availability calendar ---- */
.month-nav { display: flex; align-items: center; gap: 0.5rem; }
.month-nav .title { flex: 1; text-align: center; font-weight: 800; color: var(--navy); font-size: 1.5rem; letter-spacing: 0.01em; }
.month-nav button { width: auto; padding: 0.4rem 0.9rem; font-size: 1.3rem; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.7rem; }
.cal-toolbar button { width: auto; padding: 0.5rem 0.9rem; }
.cal-toolbar .count { color: var(--muted); font-size: 0.85rem; }
.tb-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-dow { background: var(--navy); color: #fff; text-align: center; font-size: 0.68rem; font-weight: 700; padding: 0.35rem 0; text-transform: uppercase; letter-spacing: 0.04em; }
.cal-cell { background: #fff; min-height: 78px; padding: 3px 4px 5px; font-size: 0.75rem; cursor: pointer; overflow: hidden; }
.cal-cell.other { background: #dbe3ee; cursor: default; }
.cal-cell.weekend { background: #f7f0dc; } /* tan weekend — stands apart from the blue page background */
.cal-cell.today .cal-num { background: var(--red); color: #fff; border-radius: 999px; padding: 0 6px; }
.cal-cell:hover:not(.other) { background: #eef3f8; }
.cal-num { font-weight: 700; color: var(--navy); display: inline-block; }
.cal-pill { display: block; margin-top: 2px; color: #fff; border-radius: 5px; padding: 1px 4px; font-size: 0.64rem; font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-pill:hover { filter: brightness(1.15); }

.compliance { border-radius: var(--radius); padding: 0.8rem 1rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem; font-weight: 600; }
.compliance.ok { background: rgba(47,125,79,0.14); color: var(--green); }
.compliance.under { background: rgba(217,154,0,0.18); color: #8a6200; }

/* ---- Modal (day detail + add) ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(11,37,69,0.55); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.modal { background: #fff; border-radius: var(--radius); padding: 1.1rem 1.25rem 1.25rem; width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { margin: 0; font-size: 1.15rem; color: var(--navy); }
.modal h3 { margin: 0.6rem 0 0.2rem; color: var(--navy); font-size: 1rem; }
.modal .x { width: auto; min-height: auto; background: transparent; color: var(--muted); font-size: 1.1rem; padding: 0.2rem 0.4rem; }
.modal hr { border: 0; border-top: 1px solid var(--line); margin: 0.9rem 0 0.4rem; }
.row2 { display: flex; gap: 0.75rem; } .row2 > * { flex: 1; }
.modal-actions { display: flex; gap: 0.6rem; margin-top: 0.9rem; } .modal-actions > * { flex: 1; }
.day-list { margin: 0.5rem 0; }
.day-entry { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.day-entry .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.day-entry .when { font-weight: 700; color: var(--ink); }
.day-entry .pos { color: var(--muted); flex: 1; }
.day-entry .rm { width: auto; min-height: auto; background: transparent; color: var(--red); padding: 0.2rem 0.4rem; font-size: 0.9rem; }
.day-entry.clickable { cursor: pointer; border-radius: 8px; padding-left: 0.3rem; padding-right: 0.3rem; }
.day-entry.clickable:hover { background: #eef3f8; }
.day-entry .chev { color: var(--muted); font-size: 1.1rem; font-weight: 700; }
.day-entry .claim { width: auto; min-height: 34px; padding: 0.3rem 0.9rem; font-size: 0.85rem; }
.day-entry .drop-btn, .day-entry .btn-ghost { width: auto; min-height: 32px; padding: 0.25rem 0.7rem; font-size: 0.8rem; }
.day-entry .drop-btn { background: transparent; color: var(--red-700); border: 1.5px solid var(--red); }
.day-entry .drop-btn:hover { background: rgba(193,39,45,0.08); }
.modal .btn-danger { width: 100%; margin-top: 0.7rem; background: transparent; color: var(--red-700); border: 1.5px solid var(--red); }
.modal .btn-danger:hover { background: rgba(193,39,45,0.08); }

/* ---- Schedule views (RA-style Day/Week grids) ---- */
.sched-controls { display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.6rem; }
.seg { display: inline-flex; border: 1.5px solid var(--navy); border-radius: 999px; overflow: hidden; }
.seg button { width: auto; min-height: 36px; background: #fff; color: var(--navy); border-radius: 0; padding: 0.3rem 0.95rem; font-size: 0.88rem; }
.seg button.active { background: var(--navy); color: #fff; }
.sched-title { font-size: 1.25rem !important; }

.ra { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; box-shadow: var(--shadow); }
.ra-head { background: var(--navy); color: #fff; font-weight: 700; text-align: center; padding: 0.35rem 0.5rem; font-size: 0.95rem; }
.ra-row { display: flex; border-top: 1px solid var(--line); min-height: 50px; }
.ra-hours-row { min-height: 22px; background: #f4f7fb; }
.ra-label { flex: 0 0 110px; padding: 0.35rem 0.5rem; font-weight: 700; font-size: 0.8rem; color: var(--navy); background: #f4f7fb; border-right: 1px solid var(--line); display: flex; align-items: center; }
.ra-lane { position: relative; flex: 1;
  background: repeating-linear-gradient(to right, transparent 0, transparent calc(25% - 1px), #e3e9f1 calc(25% - 1px), #e3e9f1 25%); }
.ra-hours { position: relative; flex: 1; display: flex; }
.ra-hours span { flex: 1; font-size: 0.62rem; color: var(--muted); padding: 2px 0 0 3px; border-left: 1px solid #e3e9f1; }
.ra-hours span:first-child { border-left: 0; }
.ra-span { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; color: #fff; font-size: 0.68rem; font-weight: 700;
  padding: 1px 5px; overflow: hidden; white-space: nowrap; cursor: pointer; line-height: 1.25; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.ra-span small { display: block; font-weight: 500; font-size: 0.6rem; opacity: 0.9; }
.ra-span.open { background: #fff; color: var(--red-700); border: 2px dashed var(--red); }
.ra-span.opendraft { background: #fff; color: var(--muted); border: 2px dashed var(--line); cursor: default; }
.ra-span.draft { opacity: 0.75; outline: 2px dashed var(--gold); }
.ra-span:hover { filter: brightness(1.12); }

.wk-grid { display: grid; grid-template-columns: 110px repeat(7, 1fr); }
.wk-corner, .wk-dh { background: #f4f7fb; font-weight: 700; font-size: 0.72rem; color: var(--navy); padding: 0.3rem 0.35rem; border-bottom: 1px solid var(--line); text-align: center; }
.wk-corner { text-align: left; }
.wk-dh.wknd { background: #f7f0dc; }
.wk-label { padding: 0.35rem 0.5rem; font-weight: 700; font-size: 0.75rem; color: var(--navy); background: #f4f7fb; border-top: 1px solid var(--line); }
.wk-cell { border-top: 1px solid var(--line); border-left: 1px solid #edf1f6; padding: 2px; min-height: 34px; }
.wk-cell.wknd { background: #fbf7ea; }
.wk-item { color: #fff; border-radius: 4px; font-size: 0.62rem; font-weight: 600; padding: 1px 4px; margin: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.wk-item.open { background: #fff; color: var(--red-700); border: 1.5px dashed var(--red); }
.wk-item.opendraft { background: #fff; color: var(--muted); border: 1.5px dashed var(--line); cursor: default; }
.wk-item.draft { opacity: 0.75; outline: 1.5px dashed var(--gold); }
.mo-sum { font-size: 0.62rem; margin-top: 2px; display: flex; flex-direction: column; gap: 1px; }
.mo-sum .f { color: var(--green); font-weight: 700; }
.mo-sum .o { color: var(--red-700); font-weight: 700; }
@media (max-width: 700px) {
  .ra-label, .wk-label { flex-basis: 78px; font-size: 0.66rem; padding: 0.25rem 0.3rem; }
  .wk-grid { grid-template-columns: 78px repeat(7, 1fr); }
  .ra-span .nm { font-size: 0.6rem; }
}

/* ---- Officer manual builder: tappable spans, contested markers, seat editor, contests ---- */
.officer-grid .ra-span.opendraft, .officer-grid .wk-item.opendraft { cursor: pointer; }
/* Contested seats get a solid gold ring + a small ⚔ (defined after .draft so it wins the outline). */
.ra-span.contested, .wk-item.contested { outline: 2px solid var(--gold); outline-offset: 1px; }
.ra-span.contested .nm::after, .wk-item.contested::after { content: ' ⚔'; }

.se-meta { margin: 0.3rem 0 0.6rem; color: var(--muted); line-height: 1.7; }
.se-occupant { font-weight: 800; color: var(--navy); font-size: 1.05rem; margin-bottom: 0.5rem; }
.se-occupant.open { color: var(--red-700); }
.elig-list { max-height: 45vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.elig-list > .muted { padding: 0.6rem 0.8rem; }
.elig-item { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; width: 100%;
  min-height: 44px; background: #fff; color: var(--ink); border-radius: 0; border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.8rem; font-weight: 600; text-align: left; }
.elig-item:last-child { border-bottom: 0; }
.elig-item:hover { background: #eef3f8; }
.elig-item .sub { color: var(--muted); font-size: 0.8rem; font-weight: 500; white-space: nowrap; }
.elig-item .hrs { color: var(--muted); font-weight: 500; }
.elig-item .ot-flag { color: #8a6200; background: rgba(217,154,0,0.18); border-radius: 999px;
  padding: 0.05rem 0.45rem; font-size: 0.72rem; font-weight: 700; }

/* ---- Event attendance ---- */
.att-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.att-name { font-weight: 600; flex: 1 1 160px; min-width: 0; }
.att-controls { display: flex; align-items: center; gap: 0.4rem; flex: 0 0 auto; }
.att-controls select.att-status { min-height: 38px; padding: 0.2rem 0.4rem; border: 1.5px solid var(--line); border-radius: 8px; width: auto; }
.att-controls input.att-min { min-height: 38px; width: 64px; padding: 0.2rem 0.4rem; border: 1.5px solid var(--line); border-radius: 8px; }
.att-controls .att-save { min-height: 38px; padding: 0.3rem 0.7rem; font-size: 0.85rem; }

/* ---- Admin roster ---- */
.admin-row.admin-dimmed { opacity: 0.55; }
.admin-row .btn-ghost, .admin-row .btn-danger { width: auto; min-height: 36px; padding: 0.3rem 0.8rem; font-size: 0.85rem; flex: 0 0 auto; }

/* ---- member status control (HR lifecycle: Active / On Leave / Suspended / Terminated) ---- */
.hr-state-list { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.6rem 0; }
.hr-state-opt { display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.7rem; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.hr-state-opt input { width: 20px; height: 20px; flex: 0 0 auto; }
.hr-state-opt > span:first-of-type { font-weight: 700; }
.hr-state-opt.hr-state-gated { background: #fbfafc; }
.hr-chief-note { margin-left: auto; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); background: #eceef1; padding: 0.1rem 0.5rem; border-radius: 999px; }
.hr-chief-hint { margin: 0.2rem 0 0.6rem; }
.hr-warn { margin: 0.5rem 0 0; padding: 0.55rem 0.7rem; border-radius: 10px; background: rgba(193,39,45,0.1); color: var(--red-700); font-size: 0.85rem; font-weight: 600; }
.hr-reason-field textarea { width: 100%; min-height: 44px; padding: 0.45rem 0.6rem; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; }

.contest-entry { padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.contest-entry .when { font-weight: 700; color: var(--ink); margin-right: 0.4rem; }
.contest-entry .pos { color: var(--muted); }
.c-people { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.45rem; }
.c-pick { min-height: 40px; font-size: 0.88rem; }
.c-pick.occ { border-color: var(--gold); }

/* ---- Profile ---- */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.role-grid .role-val { font-weight: 700; color: var(--ink); }
.pin-input { letter-spacing: 6px; text-align: center; }

/* ---- Events (colored type badges match the GAS Events.html palette) ---- */
.ev-card { padding: 1rem 1.1rem 1.05rem; }
.ev-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ev-count { margin-left: auto; font-size: 0.85rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ev-badge { display: inline-block; padding: 0.12rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; background: #f3f4f6; color: #374151; }
.ev-badge.NUEMS { background: #dbeafe; color: #1e40af; }
.ev-badge.Standby { background: #fee2e2; color: #991b1b; }
.ev-badge.Meeting { background: #e0e7ff; color: #3730a3; }
.ev-badge.Union { background: #fef9c3; color: #854d0e; }
.ev-badge.Training { background: #dcfce7; color: #166534; }
.ev-badge.Social { background: #fce7f3; color: #9d174d; }
.ev-badge.Other { background: #f3f4f6; color: #374151; }
.ev-title { margin: 0.5rem 0 0.1rem !important; font-size: 1.15rem !important; }
.ev-meta { color: var(--muted); font-size: 0.92rem; line-height: 1.6; margin: 0.2rem 0 0.3rem !important; }
.ev-details { margin: 0.15rem 0 0.3rem !important; font-size: 0.92rem; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ev-foot { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.55rem; }
.ev-rsvp button { min-height: 44px; min-width: 62px; font-weight: 700; }
.ev-rsvp button[disabled] { color: var(--muted); background: #f4f7fb; cursor: not-allowed; }
.ev-rsvp button.active.r-yes { background: var(--green); color: #fff; }
.ev-rsvp button.active.r-maybe { background: var(--gold); color: #fff; }
.ev-rsvp button.active.r-no { background: var(--red); color: #fff; }
.ev-you { font-size: 0.88rem; font-weight: 700; }
.ev-you.yes { color: var(--green); }
.ev-you.maybe { color: #8a6200; }
.ev-you.no { color: var(--red-700); }
.ev-roster-link { margin-left: auto; color: var(--star-blue); font-weight: 700; font-size: 0.9rem;
  text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.ev-roster-link:hover { text-decoration: underline; }
.ev-admin { display: flex; gap: 0.5rem; margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid var(--line); }
.ev-admin button { min-height: 40px; font-size: 0.88rem; }
.ev-bkt { margin: 0.8rem 0 0.3rem !important; font-size: 0.95rem !important; }
.ev-bkt .n { color: var(--muted); font-weight: 600; }
.ev-bkt.yes { color: var(--green) !important; }
.ev-bkt.maybe { color: #8a6200 !important; }
.ev-bkt.no { color: var(--red-700) !important; }
.ev-names { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ev-name { background: #f1f5f9; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.2rem 0.7rem; font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.ev-none { margin: 0.1rem 0 !important; font-size: 0.85rem; }

/* Events surfaced on the published schedule (day/week views). Compact chips, tap-through to the
   shared event detail/RSVP modal. Empty days get no chrome (rendered only when events exist). */
.ev-strip { margin-top: 0.6rem; }
.ev-strip-head { margin: 0 0 0.4rem !important; font-size: 0.9rem !important; color: var(--navy); }
.ev-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ev-chip { width: auto; display: inline-flex; align-items: center; gap: 0.35rem; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; padding: 0.3rem 0.55rem; font-size: 0.8rem;
  font-weight: 600; color: var(--ink); cursor: pointer; min-height: 34px; text-align: left; }
.ev-chip:hover { background: #eef3f8; }
.ev-chip .ev-chip-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12rem; }
.ev-chip .ev-chip-t { color: var(--muted); font-weight: 700; font-size: 0.72rem; }
.ev-chip .ev-chip-tag { background: #dbeafe; color: #1e40af; font-size: 0.62rem; font-weight: 800;
  letter-spacing: 0.03em; text-transform: uppercase; border-radius: 999px; padding: 0.05rem 0.4rem; }
.ev-chip.nuems { border-color: #93c5fd; }
/* Week view "Events this week" band: chips stack inside each day cell. */
.ev-wk-cell { display: flex; flex-direction: column; gap: 3px; }
.ev-wk-cell .ev-chip { width: 100%; font-size: 0.68rem; padding: 0.2rem 0.35rem; min-height: 28px; }
.ev-wk-cell .ev-chip .ev-chip-nm { max-width: none; }

/* ---- Notification bell + inbox ---- */
.bell-btn { position: relative; width: auto; min-height: 44px; min-width: 44px; background: transparent;
  color: #fff; padding: 0.3rem; font-size: 1.25rem; line-height: 1; flex: 0 0 auto; }
.bell-btn:hover { background: rgba(255,255,255,0.12); }
.bell-badge { position: absolute; top: 0; right: 0; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 0.65rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--navy); }
.notif-row { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.65rem 0.2rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif-row:last-child { border-bottom: 0; }
.notif-row:hover { background: #eef3f8; }
.notif-row.unread { background: rgba(43,108,176,0.07); }
.notif-row .notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--star-blue); margin-top: 6px; flex: 0 0 auto; visibility: hidden; }
.notif-row.unread .notif-dot { visibility: visible; }
.notif-row .notif-body { flex: 1; min-width: 0; }
.notif-row .notif-title { font-weight: 700; color: var(--ink); }
.notif-row.unread .notif-title { color: var(--navy); }
.notif-row .notif-text { color: var(--muted); font-size: 0.9rem; margin-top: 0.15rem; }
.notif-row .notif-time { color: var(--muted); font-size: 0.75rem; white-space: nowrap; flex: 0 0 auto; margin-top: 0.1rem; }

/* ---- Quiet hours / prefs ---- */
.qh-row { display: flex; gap: 0.75rem; }
.qh-row > * { flex: 1; }
.pref-toggle { display: flex; align-items: center; gap: 0.55rem; font-weight: 600; margin: 0.9rem 0; }
.pref-toggle input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--star-blue); }

/* ---- Transfers ---- */
.xfer-row { padding: 0.7rem 0.2rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.xfer-row:last-child { border-bottom: 0; }
.xfer-row:hover { background: #eef3f8; }
.xfer-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.xfer-chip { display: inline-block; padding: 0.12rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.xfer-chip.open { background: rgba(193,39,45,0.13); color: var(--red-700); }
.xfer-chip.notifying { background: rgba(217,154,0,0.18); color: #8a6200; }
.xfer-chip.pending_confirm { background: rgba(43,108,176,0.14); color: var(--star-blue); }
.xfer-chip.accepted { background: rgba(47,125,79,0.15); color: var(--green); }
.xfer-chip.declined, .xfer-chip.cancelled { background: #eceef1; color: var(--muted); }
.xfer-chip.now { background: var(--red); color: #fff; }
.xfer-loc { color: var(--ink); font-size: 0.92rem; }
.xfer-loc .arrow { color: var(--muted); margin: 0 0.3rem; }
.xfer-meta { color: var(--muted); font-size: 0.82rem; margin-top: 0.2rem; }
.seat-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem; margin: 0.6rem 0; }
.seat-card h4 { margin: 0 0 0.3rem; color: var(--navy); font-size: 0.95rem; }
.seat-filled { font-weight: 700; color: var(--ink); }
.seat-open { color: var(--red-700); font-weight: 700; }
.seat-accept-btn { margin-top: 0.5rem; min-height: 52px; font-size: 1.05rem; }
.xfer-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; margin: 0.5rem 0; }
.xfer-detail-grid .lbl { font-size: 0.78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.xfer-detail-grid .val { color: var(--ink); }
.fac-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.fac-row:last-child { border-bottom: 0; }

/* ---- Utility ---- */
.stack > * + * { margin-top: 0.75rem; }
.row { display: flex; gap: 0.75rem; align-items: center; }
.row > * { flex: 1; }

/* ---- Run-log filter bar ---- */
.run-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.6rem; }
.run-filters select { min-height: 40px; padding: 0.3rem 0.6rem; border: 1.5px solid var(--line); border-radius: 8px; width: auto; font-size: 0.85rem; background: #fff; color: var(--ink); }
.run-filters .pref-toggle { margin: 0; font-size: 0.85rem; white-space: nowrap; }
.badge-draft { background: rgba(217,154,0,0.18); color: #8a6200; }

/* ---- Signature pad + coverage list ---- */
.sig-pad-wrap { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 0.5rem; background: #fbfcfe; }
.sig-pad-wrap canvas { display: block; width: 100%; height: 160px; touch-action: none; background: #fff; border-radius: 8px; cursor: crosshair; }
.sig-preview { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 0.8rem; background: #fbfcfe; border: 1px solid var(--line); border-radius: var(--radius); }
.sig-preview img { max-height: 90px; max-width: 100%; background: #fff; border-radius: 6px; padding: 0.4rem; border: 1px solid var(--line); }
.sig-cov-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.sig-cov-row:last-child { border-bottom: 0; }

/* ---- Rules admin (closed periods / seat windows / config) ---- */
.rule-row { padding: 0.55rem 0.2rem; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.rule-row:last-child { border-bottom: 0; }
.rule-row.rule-inactive { opacity: 0.55; }
.rule-row .rule-main { flex: 1; min-width: 0; font-size: 0.9rem; line-height: 1.5; }
.rule-row .rule-btns { display: flex; gap: 0.4rem; flex: 0 0 auto; }
.rule-row .rule-btns button { width: auto; min-height: 34px; padding: 0.25rem 0.7rem; font-size: 0.8rem; }
.config-row { display: grid; grid-template-columns: 1fr; gap: 0.25rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.config-row:last-child { border-bottom: 0; }
.config-row label.field { margin: 0; }
.config-row .hint { margin-top: 0.15rem; }

/* ---- Checks (rig/bag/equipment) — readiness board ---- */
.status-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; }
.status-chip.green { background: rgba(47,125,79,0.15); color: var(--green); }
.status-chip.yellow { background: rgba(217,154,0,0.18); color: #8a6200; }
.status-chip.gray { background: #eceef1; color: var(--muted); }
.status-chip.red { background: rgba(193,39,45,0.13); color: var(--red-700); }
.status-chip.unchecked { background: #eceef1; color: var(--muted); }
.readi-row { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; padding: 0.75rem 0.2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.readi-row:last-child { border-bottom: 0; }
.readi-main { flex: 1; min-width: 160px; }
.readi-main .rn { font-weight: 700; color: var(--navy); font-size: 1rem; }
.readi-main .rm { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.readi-actions { display: flex; gap: 0.5rem; align-items: center; flex: 0 0 auto; }
.readi-actions button { width: auto; min-height: 44px; padding: 0.4rem 1rem; font-size: 0.9rem; }
.readi-actions button.join { background: var(--gold); }
.readi-actions button.join:hover { background: #b98400; }
.exp-bucket { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.exp-bucket:last-child { border-bottom: 0; }
.exp-bucket h4 { margin: 0 0 0.35rem; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.exp-item { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.3rem 0; font-size: 0.9rem; }
.exp-item .en { color: var(--ink); font-weight: 600; }
.exp-item .ed { font-weight: 700; white-space: nowrap; }
.exp-item .ed.overdue { color: var(--red-700); }
.exp-item .ed.soon { color: #8a6200; }

/* ---- Checks — the run screen ---- */
.run-sticky { position: sticky; top: 0; z-index: 15; background: var(--cream); padding: 0.6rem 0 0.5rem; margin: -1rem -1rem 0.75rem; padding-left: 1rem; padding-right: 1rem; }
.run-progress-wrap { display: flex; align-items: center; gap: 0.7rem; }
.run-progress-bar { flex: 1; height: 14px; background: #dbe3ee; border-radius: 999px; overflow: hidden; }
.run-progress-bar > span { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width 0.2s ease; }
.run-progress-label { font-weight: 800; color: var(--navy); font-size: 0.9rem; white-space: nowrap; }
.run-next-btn { width: auto; margin-top: 0.55rem; min-height: 44px; padding: 0.4rem 1rem; font-size: 0.92rem; background: var(--star-blue); }
.run-next-btn:hover { background: #235e97; }
.run-participants { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.run-chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.78rem; font-weight: 600; color: var(--navy); }
.run-strip { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
.run-strip button.comp-chip { width: auto; min-height: 32px; padding: 0.2rem 0.65rem; font-size: 0.76rem; font-weight: 700; border-radius: 999px; color: #fff; }
.run-strip button.comp-chip.green { background: var(--green); }
.run-strip button.comp-chip.yellow { background: var(--gold); color: #4a3800; }
.run-strip button.comp-chip.gray { background: var(--muted); }
.run-strip button.comp-chip.red { background: var(--red); }

.run-mileage { display: flex; gap: 0.6rem; align-items: flex-end; }
.run-mileage label.field { flex: 1; margin: 0.4rem 0; }

.run-submit-card { position: sticky; bottom: 64px; z-index: 14; }
.run-submit-btn { min-height: 56px; font-size: 1.1rem; }
.run-blockers { margin: 0.5rem 0 0; }
.run-blocker-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.6rem; background: rgba(193,39,45,0.08); border: 1px solid rgba(193,39,45,0.3); border-radius: 8px; margin-top: 0.4rem; cursor: pointer; }
.run-blocker-row:hover { background: rgba(193,39,45,0.14); }
.run-blocker-row .txt { color: var(--red-700); font-weight: 600; font-size: 0.9rem; }
.run-blocker-row .chev { color: var(--red-700); font-weight: 700; }

.run-complete-card { text-align: center; padding: 2rem 1.25rem; }
.run-complete-card .big-check { font-size: 3rem; line-height: 1; }
.run-complete-card h1 { color: var(--green); }

.comp-section { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 0.75rem; box-shadow: var(--shadow); scroll-margin-top: 190px; overflow: hidden; }
.comp-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.9rem; cursor: pointer; border-left: 6px solid var(--line); }
.comp-head.green { border-left-color: var(--green); background: rgba(47,125,79,0.06); }
.comp-head.yellow { border-left-color: var(--gold); background: rgba(217,154,0,0.08); }
.comp-head.gray { border-left-color: var(--line); background: rgba(95,107,116,0.05); }
.comp-head.red { border-left-color: var(--red); background: rgba(193,39,45,0.06); }
.comp-head .cn { flex: 1; font-weight: 800; color: var(--navy); font-size: 1rem; }
.comp-head .cprog { color: var(--muted); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.comp-head .cchev { color: var(--muted); font-size: 1.2rem; transition: transform 0.15s ease; }
.comp-section.collapsed .comp-head .cchev { transform: rotate(-90deg); }
.comp-body { padding: 0 0.6rem 0.6rem; }
.comp-section.collapsed .comp-body { display: none; }
.comp-toolbar { display: flex; justify-content: flex-end; padding: 0.5rem 0.3rem 0.2rem; }
.comp-toolbar button.check-all-btn { width: auto; min-height: 40px; padding: 0.35rem 0.9rem; font-size: 0.85rem; background: var(--green); }
.comp-toolbar button.check-all-btn:hover { background: #245f3c; }

.chk-sep { padding: 0.55rem 0.3rem 0.2rem; color: var(--muted); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; border-top: 1px solid var(--line); margin-top: 0.3rem; }
.chk-sep:first-child { border-top: 0; margin-top: 0; }

.chk-item { padding: 0.6rem 0.3rem; border-top: 1px solid var(--line); scroll-margin-top: 190px; }
.chk-item:first-child { border-top: 0; }
.chk-item-top { display: flex; align-items: center; gap: 0.5rem; }
.chk-item-label { flex: 1; font-weight: 600; color: var(--ink); font-size: 0.95rem; line-height: 1.35; }
.chk-item-label .mand { color: var(--red-700); font-weight: 800; }
.chk-note-btn { width: auto; min-height: 36px; min-width: 36px; padding: 0.2rem; background: transparent; color: var(--muted); font-size: 1.05rem; flex: 0 0 auto; }
.chk-note-btn.has-note { color: var(--star-blue); }
.chk-note-text { font-size: 0.82rem; color: var(--muted); margin: 0.25rem 0 0; font-style: italic; }

.chk-triad { display: flex; gap: 0.45rem; margin-top: 0.5rem; }
.chk-triad button { flex: 1; min-height: 52px; font-size: 0.95rem; font-weight: 800; border-radius: 10px; background: #eef1f5; color: var(--muted); border: 2px solid transparent; }
.chk-triad button.ok-btn.sel { background: rgba(47,125,79,0.16); color: var(--green); border-color: var(--green); }
.chk-triad button.flag-btn.sel { background: rgba(217,154,0,0.2); color: #8a6200; border-color: var(--gold); }
.chk-triad button.fail-btn.sel { background: rgba(193,39,45,0.16); color: var(--red-700); border-color: var(--red); }
.chk-item.answered .chk-item-label { color: var(--ink); }
.chk-item.updated-remote { animation: chk-flash 1.2s ease; }
@keyframes chk-flash { 0% { background: rgba(43,108,176,0.18); } 100% { background: transparent; } }

.chk-date-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.5rem; flex-wrap: wrap; }
.chk-date-val { font-weight: 700; color: var(--navy); font-size: 0.95rem; }
.chk-date-val.none { color: var(--muted); font-weight: 500; font-style: italic; }
.chk-date-val.expiring { color: var(--red-700); }
/* A carried-forward suggestion that hasn't been confirmed this run yet. Neutral when the date is still
   far out (a gentle "from last check" cue), but LOUD (amber/red) when it's expiring soon or already
   expired — so an out-of-date carry can never be reflexively one-tap-confirmed. */
.chk-date-val.carried { color: #8a6200; font-weight: 700; }
.chk-date-val.carried::before { content: '↩ '; opacity: 0.7; }
.chk-date-val.expired { color: var(--red-700); font-weight: 800; }
.chk-item.is-carried { background: rgba(43,108,176,0.04); }
.chk-item.is-carried.loud { background: rgba(193,39,45,0.06); border-left: 4px solid var(--red); padding-left: 0.5rem; }
.date-confirm-btn { width: auto; min-height: 42px; padding: 0.3rem 0.9rem; font-size: 0.85rem; font-weight: 800; background: var(--green); color: #fff; border-radius: 8px; }
.date-confirm-btn:hover { background: #245f3c; }
.date-confirm-btn.loud { background: var(--red); }
.date-confirm-btn.loud:hover { background: var(--red-700); }
.comp-toolbar-note { color: var(--muted); font-size: 0.72rem; font-style: italic; align-self: center; margin-right: auto; }
.chk-date-btns { display: flex; gap: 0.4rem; }
.chk-date-btns button { width: auto; min-height: 42px; padding: 0.3rem 0.85rem; font-size: 0.85rem; }
/* Visually hidden but still focusable/clickable (needed for input.showPicker()/click() to reliably
   open the native date picker on iPad Safari — a zero-size or pointer-events:none input often won't). */
.chk-date-input { position: absolute; opacity: 0; width: 28px; height: 28px; margin-left: -28px; }

.seal-card { border: 1.5px dashed var(--gold); border-radius: var(--radius); padding: 0.75rem 0.9rem; margin: 0.5rem 0.3rem 0.7rem; background: rgba(217,154,0,0.06); }
.seal-card h4 { margin: 0 0 0.4rem; color: var(--navy); font-size: 0.92rem; }
.seal-prev { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.seal-prev strong { color: var(--ink); }
.seal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.seal-actions button { width: auto; min-height: 46px; padding: 0.4rem 0.9rem; font-size: 0.88rem; }
.seal-actions button.intact-btn { background: var(--green); }
.seal-actions button.intact-btn:hover { background: #245f3c; }
.seal-actions button.intact-btn.sel { outline: 3px solid rgba(47,125,79,0.4); }
.seal-status { margin-top: 0.5rem; font-weight: 700; font-size: 0.88rem; }
.seal-status.ok { color: var(--green); }
.seal-status.broken { color: var(--red-700); }
.seal-new-form { margin-top: 0.6rem; display: none; }
.seal-new-form.open { display: block; }
.seal-new-form label.field { margin: 0.5rem 0; }

/* ---- Voice + AI colleague (checks run screen) ---- */
.voice-settings-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.6rem; padding-top: 0.55rem; border-top: 1px solid var(--line); }
.voice-toggle { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.85rem; color: var(--navy); cursor: pointer; white-space: nowrap; }
.voice-toggle input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--star-blue); margin: 0; }
.voice-engine-picker { margin-left: auto; }
.voice-engine-picker select { min-height: 38px; padding: 0.25rem 0.5rem; border: 1.5px solid var(--line); border-radius: 8px; font-size: 0.82rem; background: #fff; color: var(--ink); width: auto; }

.voice-unsupported-card { margin-top: 0.6rem; }

.voice-mic-row { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin: 0.7rem 0; }
.voice-mic-btn {
  width: 72px; height: 72px; min-height: 56px; border-radius: 50%; font-size: 1.8rem;
  background: var(--star-blue); box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center; padding: 0;
}
.voice-mic-btn:hover { background: #235e97; }
.voice-mic-btn.listening { background: var(--red); animation: voice-pulse 1.1s ease-in-out infinite; }
@keyframes voice-pulse {
  0% { box-shadow: 0 0 0 0 rgba(193,39,45,0.55); }
  70% { box-shadow: 0 0 0 18px rgba(193,39,45,0); }
  100% { box-shadow: 0 0 0 0 rgba(193,39,45,0); }
}
.voice-transcript-chip { background: rgba(11,37,69,0.06); border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.88rem; font-style: italic; color: var(--navy); max-width: 100%; text-align: center; }

.voice-candidates-card, .ai-confirm-card { border: 1.5px solid var(--star-blue); background: rgba(43,108,176,0.05); }
.voice-candidates-card h4, .ai-confirm-card h4 { margin: 0 0 0.6rem; color: var(--navy); font-size: 0.98rem; }
.voice-candidate-list { display: flex; flex-direction: column; gap: 0.6rem; }
.voice-candidate-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.voice-candidate-row:last-child { border-bottom: 0; }
.voice-candidate-row .vc-label { font-weight: 700; color: var(--ink); flex: 1 1 140px; }
.voice-candidate-row .vc-triad { margin: 0; flex: 0 0 auto; }
.voice-candidate-row .vc-triad button { min-height: 44px; padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.voice-candidate-row button.btn-inline { min-height: 44px; }
#voiceCandidatesCancel { margin-top: 0.7rem; }

.ai-action-list { display: flex; flex-direction: column; gap: 0.75rem; }
.ai-action-row { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.7rem; background: #fff; }
.ai-echo { font-weight: 600; color: var(--ink); line-height: 1.4; }
.ai-confidence { margin-top: 0.2rem; }
.ai-seal-field { margin: 0.5rem 0; }
.ai-seal-field input { border-color: var(--gold); }
.ai-action-btns { display: flex; gap: 0.5rem; margin-top: 0.55rem; }
.ai-action-btns button { min-height: 44px; font-size: 0.88rem; }
.ai-confirm-actions { display: flex; gap: 0.6rem; margin-top: 0.85rem; }
.ai-confirm-actions button { min-height: 48px; }

/* ---- Run-log voice dictation (2026-07-06 — narrative text field, push-to-talk + confirm-insert) ---- */
.dict-field-row { display: flex; align-items: flex-start; gap: 0.5rem; }
.dict-field-row textarea { flex: 1 1 auto; }
.dict-mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; flex: 0 0 auto; }
.dict-mic-btn {
  width: 44px; height: 44px; min-height: 44px; border-radius: 50%; font-size: 1.15rem;
  background: var(--star-blue); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; padding: 0;
}
.dict-mic-btn:hover { background: #235e97; }
.dict-mic-btn.listening { background: var(--red); animation: voice-pulse 1.1s ease-in-out infinite; }
.dict-interim-chip { background: rgba(11,37,69,0.06); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.76rem; font-style: italic; color: var(--navy); max-width: 140px; text-align: center; }
.dict-hint-unsupported { display: block; margin-top: 0.3rem; }

.dict-confirm-strip { border: 1.5px solid var(--star-blue); background: rgba(43,108,176,0.05); margin-top: 0.6rem; }
.dict-confirm-strip h4 { margin: 0 0 0.6rem; color: var(--navy); font-size: 0.95rem; }
.dict-compare-text { border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.65rem; background: #fff; font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; }
.dict-compare { display: flex; flex-direction: column; gap: 0.6rem; }
.dict-compare-label { font-weight: 700; font-size: 0.78rem; color: var(--navy); margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.02em; }
.dict-provider-error { margin-top: 0.5rem; }
.dict-confirm-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.dict-confirm-actions button { min-height: 44px; font-size: 0.85rem; flex: 1 1 auto; }

/* ---- Toasts (voice/AI read-back affordance) ---- */
.toast-host { position: fixed; left: 0; right: 0; bottom: 76px; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; z-index: 60; pointer-events: none; padding: 0 0.8rem; }
.toast { background: var(--navy); color: #fff; padding: 0.55rem 1rem; border-radius: 999px; font-size: 0.88rem; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease; max-width: min(92vw, 420px); text-align: center; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-warn { background: #8a6200; }
.toast-err { background: var(--red-700); }
.toast-ok { background: var(--green); }

/* ---- Narcotics module (§9) — kit board, seal/audit/swap/waste flows, DEA history ---- */
.narc-alert-banner { border: 1.5px solid var(--red); background: rgba(193,39,45,0.08); color: var(--red-700); }
.narc-alert-banner strong { font-size: 1.02rem; }
.narc-kit-list { display: flex; flex-direction: column; gap: 0.9rem; }
.narc-kit-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.85rem 0.95rem; background: #fbfcfe; }
.narc-kit-card.narc-discrepancy { border-color: var(--red); background: rgba(193,39,45,0.06); }
.narc-kit-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.narc-kit-name { font-weight: 800; color: var(--navy); font-size: 1.05rem; }
.narc-kit-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.narc-kit-meta { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.narc-kit-contents { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
.narc-kit-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.narc-kit-actions button { flex: 1 1 auto; min-height: 46px; font-size: 0.85rem; }

/* Discrepancy preview — must read as loud/urgent, and must be impossible to miss before submit
   (safety-critical design goal: reporting a mismatch is easier than fudging it). */
.narc-discrepancy-preview { display: none; border: 1.5px solid var(--red); background: rgba(193,39,45,0.1); color: var(--red-700); border-radius: var(--radius); padding: 0.7rem 0.9rem; margin-top: 0.8rem; font-weight: 600; }
.narc-discrepancy-preview:not([hidden]) { display: block; }

.narc-scope-note { border: 1.5px solid var(--gold); background: rgba(217,154,0,0.08); }
.narc-scope-note strong { color: var(--navy); }

.narc-count-list { display: flex; flex-direction: column; gap: 0.8rem; margin: 0.6rem 0; }
.narc-count-row { border: 1px solid var(--line); border-radius: 10px; padding: 0.65rem 0.8rem; background: #fbfcfe; }
.narc-count-drug { font-weight: 700; color: var(--navy); }
.narc-count-row label.field { margin: 0.5rem 0 0; }

.narc-hist-filters .run-filters input[type="date"] { min-height: 40px; padding: 0.3rem 0.6rem; border: 1.5px solid var(--line); border-radius: 8px; width: auto; font-size: 0.85rem; }
.narc-hist-row.narc-hist-flagged { background: rgba(193,39,45,0.06); border-radius: 8px; padding-left: 0.4rem; padding-right: 0.4rem; }

/* ---- Drag-and-drop schedule builder (desktop beta) --------------------------------------------
   Base styles (toolbar toggle, roster, tray, drag rings). The PANEL is display:none here and only
   floats beside the grid at >=1024px (see the desktop media block) — so on phone/tablet the panel
   never appears and the tap flow is completely untouched. */
.dnd-toggle { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; font-weight: 600; color: var(--navy); cursor: pointer; user-select: none; }
.dnd-toggle input { width: auto; min-height: 0; margin: 0; }
.dnd-beta { display: inline-block; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 0.02rem 0.34rem; }

/* The panel is hidden by default; the desktop block turns it on. Kept in the DOM either way so
   toggling doesn't fight the render. */
.dnd-panel { display: none; }

/* Drag affordances (safe at all widths — these classes are only ever added when DnD is active,
   which is gated to desktop in JS). */
.dnd-draggable { cursor: grab; }
.dnd-draggable:active { cursor: grabbing; }
.dnd-dragging { opacity: 0.5; }
/* Valid target: green ring. Invalid: red, dimmed. Rings sit inside the cell so they don't shift layout. */
.dnd-ok { outline: 2px solid var(--green); outline-offset: -2px; box-shadow: 0 0 0 3px rgba(47,125,79,0.25); }
.dnd-no { outline: 2px dashed var(--red); outline-offset: -2px; opacity: 0.55; cursor: no-drop; }

/* ============================================================================
   RESPONSIVE — TABLET (>=768px) & DESKTOP (>=1024px)
   Progressive enhancement. The audited phone layout (<768px) is the base and is
   left untouched: the bottom .tabbar, single-column cards, and all touch-target
   sizes below stay exactly as shipped. These blocks only ADD desktop/tablet
   affordances the desktop UX audit (walkthrough-tablet-desktop.md) called for:
   a real max-width, a left sidebar in place of a stretched full-width tabbar,
   two-column where it earns its keep, readable form-control widths (the 630px-
   input problem), denser tables, and visible keyboard focus rings.
   ============================================================================ */

/* The sidebar is always in the DOM but display:none until desktop, so it never
   affects the phone/tablet layout. .app-shell is a passthrough on phones. */
.sidebar { display: none; }
.app-shell { display: block; }

/* ---- Keyboard ergonomics: visible focus rings on interactive surfaces (all widths).
   :focus-visible only fires for keyboard/AT navigation, never on mouse/touch, so this
   adds no visual change for the audited touch flows. Palette-consistent (Star-of-Life blue). */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
.tabbar a:focus-visible, .seg button:focus-visible {
  outline: 3px solid var(--star-blue);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Fields already draw a blue focus box-shadow; keep that AND add the ring so it's uniform. */
label.field input:focus-visible, label.field select:focus-visible, label.field textarea:focus-visible {
  outline: 3px solid var(--star-blue); outline-offset: 1px;
}

/* ---- FORM-CONTROL WIDTH FIX (applies >=768px, tablet + desktop) ----
   The audit's T4: a 5-char "First Name" rendered in a 630px input. Cap free-standing
   form controls at a readable measure; leave full-width controls that live inside a
   deliberately-sized container (modals ~440px, seg switchers, calendar toolbars) alone. */
@media (min-width: 768px) {
  label.field input, label.field select, label.field textarea { max-width: 26rem; }
  label.field textarea { max-width: 40rem; } /* narrative fields can be wider */
  /* Inputs that are half of a .row2 / .qh-row / .row pairing shouldn't be capped —
     they're already constrained by their flex parent. */
  .row2 label.field input, .row2 label.field select,
  .qh-row label.field input, .qh-row label.field select,
  .row label.field input, .row label.field select { max-width: none; }
  /* PIN entry stays its own narrow centered field. */
  .pin-input { max-width: 12rem; }
}

/* ---- TABLET (768–1023px): keep the bottom tabbar (cheapest correct choice at this
   width — a sidebar would eat too much of a ~800px canvas), widen the content container,
   and let a few naturally-paired screens go two-column. ---- */
@media (min-width: 768px) {
  .container { max-width: 860px; }
}

/* ---- DESKTOP (>=1024px): left sidebar replaces the stretched bottom tabbar,
   content gets a sane centered max-width, two-column where it earns it. ---- */
@media (min-width: 1024px) {
  /* Hide the full-width bottom tabbar; the sidebar takes over navigation. */
  .tabbar { display: none; }

  /* Two-track grid: fixed sidebar + fluid content. The topbar stays full-width above. */
  .app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; }

  .sidebar {
    display: block;
    position: sticky; top: 0; align-self: start;
    height: calc(100vh - 0px);
    background: #fff; border-right: 1px solid var(--line);
    padding: 0.6rem 0.5rem 1.5rem; overflow-y: auto;
  }
  .sb-brand { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.6rem 0.9rem; color: var(--navy); font-weight: 800; font-size: 1.02rem; line-height: 1.1; }
  .sb-brand .sb-logo { width: 34px; height: 34px; border-radius: 8px; background: #fff; padding: 1px; object-fit: contain; box-shadow: 0 1px 2px rgba(11,37,69,0.2); flex: 0 0 auto; }
  .sb-brand small { display: block; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.14em; color: var(--muted); }
  .sb-cat {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.7rem; margin: 0.1rem 0; border-radius: 10px;
    color: var(--navy); text-decoration: none; font-weight: 700; font-size: 0.98rem;
  }
  .sb-cat .ico { font-size: 1.15rem; line-height: 1; }
  .sb-cat:hover { background: #eef3f8; }
  .sb-cat.active { background: rgba(193,39,45,0.1); color: var(--red-700); }
  .sb-subs { margin: 0.1rem 0 0.4rem 0.4rem; border-left: 2px solid var(--line); padding-left: 0.35rem; display: flex; flex-direction: column; }
  .sb-sub {
    display: block; padding: 0.42rem 0.75rem; margin: 1px 0; border-radius: 8px;
    color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.9rem;
  }
  .sb-sub:hover { background: #eef3f8; color: var(--navy); }
  .sb-sub.active { background: var(--navy); color: #fff; }

  /* Content: readable centered column. Denser than phone since it's a mouse. */
  .container { max-width: 940px; padding: 1.5rem 2rem; }

  /* Two-column HOME: welcome banner spans the top, then Next-shift / This-month / inbox
     flow into a two-column masonry-ish grid. Pure CSS via data-view — render fn untouched.
     The welcome card and the iOS nudge card (first two children) span both columns. */
  main[data-view="home"] {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; align-content: start;
  }
  main[data-view="home"] > .card:first-child { grid-column: 1 / -1; }
  main[data-view="home"] > #iosInstallCard { grid-column: 1 / -1; }
  main[data-view="home"] > #unreadCard { grid-column: 1 / -1; }
  /* .stack adds margin-top between siblings; in the grid that double-spaces rows. Neutralize
     the top-margin the grid gap now owns, keep card bottom rhythm via the card's own margin. */
  main[data-view="home"].stack > * + * { margin-top: 0; }

  /* NOTIFICATIONS inbox: cap line length for readability (audit: "readable line lengths"),
     don't let rows run the full 940px. */
  main[data-view="notifications"] .card { max-width: 720px; margin-left: auto; margin-right: auto; }

  /* TABLES breathe + get slightly denser (mouse target, not finger). Timecard/payroll/reports. */
  .tc-table { font-size: 0.9rem; }
  .tc-table th, .tc-table td { padding: 0.4rem 0.7rem; }

  /* Availability calendar pills can afford a touch more height/legibility on desktop. */
  .cal-cell { min-height: 96px; }

  /* Officer coverage-gap drill-in ("…and N more" expand-in-place) — give the expanded gap
     list a tidy two-column flow at desktop width so 68 gaps don't become an endless column. */
  main[data-view="officer"] .sig-cov-row { break-inside: avoid; }

  /* ---- Drag-and-drop desktop layout: when the build console has DnD on, float the roster/tray
     panel as a sticky right rail and let the existing cards flow in the left content column. The
     panel is the LAST child (appended by renderOfficerBuild), so it grid-places into column 2 and
     spans all rows. Only active when .dnd-on is present, so the officer view is unchanged when the
     beta is toggled off. ---- */
  main[data-view="officer"].dnd-on {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 216px;
    gap: 0 1.1rem;
    align-items: start;
  }
  main[data-view="officer"].dnd-on > .card,
  main[data-view="officer"].dnd-on > .ra,
  main[data-view="officer"].dnd-on > .cal { grid-column: 1; }
  .dnd-panel {
    display: block;
    grid-column: 2; grid-row: 1 / 999;
    position: sticky; top: 1rem; align-self: start;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 0.8rem; box-shadow: var(--shadow);
  }
  .dnd-panel-head { font-weight: 800; color: var(--navy); font-size: 0.95rem; display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.6rem; }
  .dnd-roster { display: flex; flex-direction: column; gap: 0.35rem; max-height: 46vh; overflow-y: auto; }
  .dnd-roster-item {
    display: flex; align-items: center; padding: 0.42rem 0.6rem;
    background: #f4f7fb; border: 1px solid var(--line); border-radius: 8px;
    font-size: 0.86rem; font-weight: 600; color: var(--navy); cursor: grab;
  }
  .dnd-roster-item:hover { background: #eaf1f9; border-color: var(--star-blue); }
  .dnd-roster-item:active { cursor: grabbing; }
  .dnd-tray {
    margin-top: 0.8rem; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.2rem; text-align: center; padding: 0.9rem 0.6rem;
    border: 2px dashed var(--line); border-radius: 10px; color: var(--muted);
    font-size: 0.78rem; font-weight: 700; line-height: 1.2;
  }
  .dnd-tray-ico { font-size: 1.2rem; }
  .dnd-tray.dnd-tray-over { border-color: var(--red); background: rgba(193,39,45,0.08); color: var(--red-700); }
}

/* Wide desktop (>=1400px): let the officer/reports screens use more of the space, since
   dense tabular data is exactly what the Chief persona lives in. Content-screens stay capped. */
@media (min-width: 1400px) {
  main[data-view="officer"], main[data-view="timecard"] { max-width: 1180px; }
}

/* ---- Custom Report Builder (2026-07-06) ----
   Tight checkbox lists (column picker, group-by picker) reuse .pref-toggle's checkbox look but need
   much less vertical rhythm than a single-column settings form, since they flow several-per-row. */
.rb-col-list, .rb-group-list { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; }
.rb-col-list label, .rb-group-list label { margin: 0; }
label.rb-check { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.9rem; margin: 0; white-space: nowrap; }
label.rb-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--star-blue); }

/* Column-order chips: small pill with inline ‹ › reorder buttons (buttons-not-drag per the build note
   — cheap, works with keyboard/tap, no HTML5 drag-and-drop browser inconsistencies to chase). */
.rb-order-chip { display: inline-flex; align-items: center; gap: 0.3rem; }
.rb-order-chip button { min-height: 22px; padding: 0 0.3rem; line-height: 1; }
.rb-order-chip button:disabled { opacity: 0.35; cursor: default; }

/* Aggregate / filter / sort rows: a .row2-like flow but with a trailing small remove button. On
   phones these stack full-width (the base .row2 already does that below 768px via flex-wrap? — no,
   .row2 doesn't wrap by default, so give this its own wrapping row). */
.rb-rule-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; margin-bottom: 0.6rem; }
.rb-rule-row > label.field { flex: 1 1 160px; min-width: 140px; margin: 0; }
.rb-rule-row .rb-del { flex: 0 0 auto; min-height: 40px; }

/* Results table: same dense .tc-table look as Timecard/Payroll, but the builder's tables can have many
   columns (any source × any column selection), so force a horizontal scroll container rather than
   letting the page itself scroll sideways (the house rule — html/body overflow-x is hidden globally). */
.rr-table-wrap { overflow-x: auto; }

@media (min-width: 1024px) {
  /* Officer is a mouse/desktop-heavy screen per the build brief — the builder's rule rows can afford
     a fixed-ish multi-column layout instead of phone's full-width stack. (Avoids :has() for broader
     browser support — every field gets the same comfortable fixed-ish basis.) */
  .rb-rule-row > label.field { flex: 1 1 220px; }
  /* Sticky header on the results table so a long scrolled report keeps its column labels in view —
     dense-table desktop treatment matching the build brief ("tables can be dense"). */
  .rr-table thead th { position: sticky; top: 0; z-index: 1; }
}

/* ---- Messages (in-app messaging + web push, migration 025) ---- */
.notif-row.msg-urgent { border-left: 3px solid var(--red); padding-left: 0.4rem; }
.notif-row.msg-urgent .notif-title { color: var(--red); }
.msg-meta { color: var(--muted); font-size: 0.75rem; margin-top: 0.2rem; }
.push-card { display: flex; align-items: center; gap: 0.75rem; justify-content: space-between; }
.push-card > div { min-width: 0; }
.field-check { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; }
.field-check input { width: auto; min-height: 0; }
.row-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.row-actions input[type="text"] { flex: 1; min-width: 140px; }
.plain-list { list-style: none; padding: 0; margin: 0.3rem 0 0.8rem; }
.plain-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.grp-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.grp-actions { display: flex; gap: 0.4rem; flex: 0 0 auto; }
.grp-picker { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 0.6rem; margin-bottom: 0.6rem; }

/* ---- Report turn-in controls (inside a clickable run row) ---- */
.turnin-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.45rem; }
.turnin-controls .turnin-box { margin: 0; font-size: 0.82rem; white-space: nowrap; }
.turnin-controls .badge { flex: 0 0 auto; }
.turnin-controls .turnin-extend { min-height: 32px; padding: 0.2rem 0.6rem; font-size: 0.78rem; }

/* ---- Build-warnings banner (amber, dismissible; sits atop the builder result) ---- */
.build-warn-banner { position: relative; background: rgba(217,154,0,0.14); border: 1px solid rgba(217,154,0,0.5);
  color: #6b4e00; font-size: 0.9rem; }
.build-warn-banner strong { color: #8a6200; }
.build-warn-x { position: absolute; top: 0.5rem; right: 0.5rem; width: auto; min-height: auto;
  background: transparent; color: #8a6200; padding: 0.15rem 0.4rem; font-size: 0.95rem; }
.build-warn-x:hover { background: rgba(217,154,0,0.2); }

/* ---- Equipment ---- */
.equip-row .badge { margin-left: 0.35rem; }
.eq-val, .eq-vcheck { min-height: 34px; padding: 0.25rem 0.7rem; font-size: 0.8rem; }
.equip-val-row .tb-btns { display: flex; gap: 0.35rem; flex: 0 0 auto; flex-wrap: wrap; }
#equipImportBox { width: 100%; resize: vertical; }

/* ---- QA review queue (Officer > QA) ---- */
.qa-tabs { flex-wrap: wrap; }
.qa-item-head { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.qa-item-meta { margin: 0.2rem 0; font-size: 0.9rem; line-height: 1.5; color: var(--ink); }
.qa-findings { margin: 0.3rem 0 0; }
.qa-close { margin-top: 0.6rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.qa-close .field { margin: 0 0 0.5rem; }
.qa-close-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.qa-close-btns button { width: auto; }
.qa-rule-toggle { margin: 0; }

/* ---- Chief digest preview (Officer > Digest) ---- */
.digest-section h3 { color: var(--navy); }
.digest-lines { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.digest-lines li { margin: 0.2rem 0; font-size: 0.9rem; line-height: 1.5; }

/* ---- NUEMS RSVP mirroring courtesy note ---- */
.ev-nuems-note { color: var(--muted); font-weight: 600; }

/* ---- Shift help — "who could take my shift?" (Chief §19, src/api/shiftHelp.ts) ---- */
/* Candidate pick-list inside the Find-coverage modal */
.sh-cand-list { margin: 0.4rem 0 0.2rem; }
.sh-cand {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.4rem; border-bottom: 1px solid var(--line); cursor: pointer;
}
.sh-cand:last-child { border-bottom: 0; }
.sh-cand.asked { cursor: default; opacity: 0.85; }
.sh-cand input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--star-blue); flex: 0 0 auto; }
.sh-cand-name { font-weight: 600; color: var(--navy); }
.sh-cand-meta { display: block; font-weight: 400; font-size: 0.82rem; color: var(--muted); }
.sh-pill {
  margin-left: auto; font-size: 0.75rem; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.12rem 0.55rem; white-space: nowrap;
}
/* Invitee inbox cards + asker's own asks (both on Home) */
.sh-invite, .sh-ask {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.6rem 0; border-bottom: 1px solid var(--line);
}
.sh-invite:last-child, .sh-ask:last-child { border-bottom: 0; }
.sh-invite-text, .sh-ask-text { flex: 1 1 60%; line-height: 1.4; color: var(--navy); }
.sh-invite-actions { display: flex; gap: 0.45rem; flex: 0 0 auto; }
.sh-ask.filled .sh-ask-text strong { color: var(--star-blue); }

/* ---- Maintenance: "Report a problem" (member) + Chief queue (officer) — src/api/maintenance.ts ---- */
.maint-row { padding: 0.6rem 0; border-bottom: 1px solid var(--line, #e6e8eb); }
.maint-row:last-child { border-bottom: 0; }
.maint-row-head { display: flex; align-items: center; gap: 0.5rem; justify-content: space-between; }
.maint-row-head strong { color: var(--navy); }
.maint-row-meta { margin: 0.2rem 0; font-size: 0.85rem; }
.maint-row-desc { margin: 0.25rem 0 0; line-height: 1.4; }
/* Chief queue cards */
.maint-card-head { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.maint-card-head strong { color: var(--navy); font-size: 1.05rem; }
/* SAFETY requests pinned to the top get a red left rail so they read as urgent at a glance. */
.maint-safety { border-left: 5px solid var(--red, #c1272d); }
.maint-workreport { margin: 0.6rem 0; padding: 0.6rem 0.7rem; background: #f5f7f9; border-radius: 10px; }
.maint-wr-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.maint-wr-text { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; line-height: 1.45; color: var(--navy); }
.maint-actions { margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px dashed var(--line, #e6e8eb); }
.maint-actions-head { display: flex; margin-bottom: 0.4rem; }
.maint-actions-head .hr-chief-note { margin-left: auto; }
.maint-notes-field { margin: 0.2rem 0 0.5rem; }
.maint-btn-row { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.maint-dup-row { display: flex; gap: 0.45rem; align-items: flex-end; flex-wrap: wrap; margin-top: 0.55rem; }
.maint-dup-row .field { flex: 1 1 60%; margin: 0; }
.maint-action-err { margin: 0.4rem 0 0; }
.maint-timeline-box { margin-top: 0.5rem; }
.maint-events { list-style: none; margin: 0; padding: 0; }
.maint-events li { padding: 0.35rem 0; border-bottom: 1px solid var(--line, #e6e8eb); font-size: 0.85rem; }
.maint-events li:last-child { border-bottom: 0; }
.maint-ev-action { font-weight: 700; color: var(--navy); }
.maint-closed { margin-top: 0.4rem; }
.maint-closed summary { cursor: pointer; padding: 0.5rem 0; font-weight: 600; color: var(--muted); }

/* ---- Orientation + Forms UI (ui-wave-6) ---- */
.badge-navy { background: rgba(11,37,69,0.12); color: var(--navy, #0b2545); }
.orient-progress { margin: 0.5rem 0; }
.orient-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.orient-enroll-card .modal-actions { margin-top: 0.5rem; }
.orient-banner { background: rgba(217,154,0,0.10); border-left: 4px solid var(--warn, #d99a00); }
.orient-banner p { margin: 0; font-weight: 600; }
.orient-banner-done { background: rgba(47,125,79,0.10); border-left-color: var(--green, #2f7d4f); }
.orient-section-title { margin: 0 0 0.5rem; color: var(--navy); }
.orient-step { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line, #e6e8eb); }
.orient-step:last-child { border-bottom: 0; }
.orient-step-main { display: flex; gap: 0.55rem; align-items: flex-start; flex: 1; }
.orient-check { font-weight: 800; color: var(--green, #2f7d4f); font-size: 1.1rem; line-height: 1.2; }
.orient-check-open { color: var(--muted, #6b7280); }
.orient-step-placeholder { opacity: 0.7; }
.orient-ph-badge { margin-left: 0.3rem; }
.orient-signer { margin-top: 0.2rem; }
.orient-sign-sheet { max-width: 26rem; }
.orient-dash-row { padding: 0.55rem 0; border-bottom: 1px solid var(--line, #e6e8eb); }
.orient-dash-row:last-child { border-bottom: 0; }
.orient-bless-row { display: flex; flex-direction: column; gap: 0.4rem; }
.orient-bless-controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.orient-awaiting-card { border-left: 4px solid var(--warn, #d99a00); }
.orient-admin-step { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line, #e6e8eb); }
.orient-admin-step:last-child { border-bottom: 0; }
.orient-admin-inactive { opacity: 0.55; }
.orient-admin-step-btns { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.orient-add-step { margin-top: 0.5rem; }
.form-policy { white-space: pre-wrap; background: #f7f8fa; border-radius: 8px; padding: 0.6rem 0.7rem; margin: 0.4rem 0; font-size: 0.9rem; }
.form-initials-field { max-width: 8rem; }
.forms-overdue { border-left: 3px solid var(--red-700, #a11); }
.forms-out-list { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.forms-out-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; flex-wrap: wrap; }
.forms-overdue-name > span:first-child { color: var(--red-700, #a11); font-weight: 700; }
.forms-member-list { max-height: 16rem; overflow-y: auto; margin-top: 0.3rem; }
.forms-member-opt { padding: 0.15rem 0; }
.form-tpl-section { border: 1px solid var(--line, #e6e8eb); border-radius: 10px; padding: 0.6rem; margin-bottom: 0.6rem; }
.form-tpl-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.form-tpl-section-btns { display: flex; gap: 0.25rem; }
.form-tpl-add-btns { display: flex; gap: 0.4rem; margin: 0.4rem 0; flex-wrap: wrap; }
.form-tpl-modal, .forms-assign-modal { max-width: 34rem; }

/* ---- "Ask the app" card (askAi.ts) — plain-language, read-only Q&A on Home ---- */
.ask-card .ask-sub { margin: 0.15rem 0 0.7rem; }
.ask-row { display: flex; gap: 0.5rem; align-items: stretch; }
.ask-input {
  flex: 1 1 auto; min-width: 0; padding: 0.6rem 0.75rem; font-size: 1rem;
  border: 1.5px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fff;
}
.ask-input:focus { outline: none; border-color: var(--star-blue); box-shadow: 0 0 0 3px rgba(43,108,176,0.15); }
.ask-send { flex: 0 0 auto; width: auto; padding: 0.5rem 1.1rem; min-height: var(--tap); }
.ask-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.ask-chip {
  width: auto; background: rgba(43,108,176,0.10); color: var(--star-blue); border: 1px solid rgba(43,108,176,0.25);
  border-radius: 999px; padding: 0.35rem 0.75rem; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  min-height: 0; line-height: 1.2;
}
.ask-chip:hover { background: rgba(43,108,176,0.18); }
.ask-answer { margin-top: 0.8rem; }
.ask-answer.thinking { opacity: 0.75; }
.ask-bubble {
  margin: 0; padding: 0.75rem 0.9rem; background: var(--cream); border-radius: var(--radius);
  border: 1px solid var(--line); font-size: 1rem; line-height: 1.4;
}
.ask-provider { margin: 0.35rem 0 0; font-size: 0.78rem; }
.ask-note { margin: 0.6rem 0 0; font-style: italic; }

.print-only { display: none; }
@media print {
  .tabbar, .topbar, .sidebar, .no-print, .narc-hist-filters { display: none !important; }
  .app-shell { display: block !important; } /* collapse the desktop grid so print flows single-column */
  .print-only { display: block !important; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  body { background: #fff; }
}
