/*
 * accident.css — the Accident / Injury Report pages (v0.50.0, Flagler edition), over app.css and rm.css.
 * NO TENANT COLOUR OR NAME IS WRITTEN HERE. [I20] Brand colours come from the custom properties app.css sets from /api/config
 * (--primary, --accent, --ink, --line, --card, --bg). The severity colours are fixed on purpose: red to grey means the same thing in
 * every district. Sizes are rem on screen and pt in print (FONT_UNIT).
 */

.is-empty { color: var(--ink-soft); font-style: italic; font-weight: 400; }
.rp-muted { color: var(--ink-soft); }

/* ---------------------------------------------------------------- the form (accf)
 * The original Apps Script form engine's styles (JS_FormEngine.html, AccForm v1.0.0), v0.58.0. The tokens (--grey-*, --brand-blue*) are
 * defined for app pages in orig.css; --brand-blue is the Appearance colour, not a colour written here. */
* ===================================================================== */
.accf { display: flex; flex-direction: column; gap: 18px; }
.accf [hidden] { display: none !important; }
.accf-reqnote { margin: 0; font-size: 0.78125rem; color: var(--grey-500); }
.accf-req { color: var(--danger); font-weight: 700; margin-left: 3px; }

/* Sections */
.accf-sec { background: var(--bg-surface, #fff); border: 1px solid var(--grey-200); border-radius: 12px; padding: 18px 20px 20px; box-shadow: var(--shadow-sm); }
.accf-sec-head { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--grey-100); }
.accf-sec-num { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-blue); color: #fff; font-size: 0.8125rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.accf-sec-title { margin: 3px 0 0; font-size: 1rem; font-weight: 700; line-height: 1.35; color: var(--brand-blue); letter-spacing: -0.005em; }
.accf-sec-help { margin: 4px 0 0; font-size: 0.8125rem; color: var(--grey-600); }

/* Rows + fields */
.accf-row { display: flex; gap: 16px; align-items: flex-start; }
.accf-row + .accf-row { margin-top: 18px; }
.accf-row > .accf-field { flex: 1 1 0; min-width: 0; }
.accf-label { display: block; margin: 0 0 6px; font-size: 0.875rem; font-weight: 600; line-height: 1.4; color: var(--grey-900); }
.accf-help { margin: -2px 0 8px; font-size: 0.78125rem; line-height: 1.45; color: var(--grey-500); }
.accf-help--after { margin: 8px 0 0; }
.accf-err { margin: 6px 0 0; font-size: 0.78125rem; font-weight: 600; color: var(--danger); }
.accf-rec-note { margin: 6px 0 0; font-size: 0.78125rem; color: var(--warning); }

/* Native controls (CSS_Core provides the base look + focus ring) */
.accf input[type="text"], .accf input[type="tel"], .accf input[type="date"], .accf select, .accf textarea {
  min-height: 42px; padding: 9px 12px; font-size: 0.9375rem; border-radius: 8px; border: 1px solid var(--grey-300); background-color: #fff;
}
.accf textarea { min-height: 104px; line-height: 1.5; resize: vertical; }
.accf select { cursor: pointer; }
.accf input::placeholder, .accf textarea::placeholder { color: var(--grey-400); }
.accf-inline { display: flex; gap: 8px; align-items: center; }
.accf-inline > input { flex: 1 1 auto; min-width: 0; }
.accf .accf-mini { flex: 0 0 auto; min-height: 42px; padding: 0 12px; background: #fff; color: var(--brand-blue); border: 1px solid var(--grey-300); border-radius: 8px; font-size: 0.8125rem; font-weight: 600; }
.accf .accf-mini:hover:not(:disabled) { background: var(--brand-blue-50); border-color: var(--brand-blue); color: var(--brand-blue); }

/* Pills / cards for choice, yes-no, multiselect and the certification */
.accf-opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.accf-opts--tight { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.accf-opts--wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.accf-yn { grid-template-columns: repeat(2, minmax(0, 160px)); }
.accf-opt { position: relative; display: block; margin: 0; }
.accf-opt-in { position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.accf-opt-box { display: flex; align-items: center; gap: 10px; height: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--grey-300); border-radius: 10px; background: #fff; color: var(--grey-700); font-size: 0.875rem; line-height: 1.35; transition: border-color .12s, background-color .12s, box-shadow .12s; }
.accf-opt:hover .accf-opt-box { border-color: var(--grey-400); background: var(--grey-50); }
.accf-opt-in:checked + .accf-opt-box { border-color: var(--brand-blue); background: var(--brand-blue-50); color: var(--brand-blue-700); font-weight: 600; box-shadow: inset 0 0 0 1px var(--brand-blue); }
.accf-opt-in:focus-visible + .accf-opt-box { outline: 3px solid color-mix(in srgb, var(--brand-blue) 35%, transparent); outline-offset: 2px; }
.accf-mark { position: relative; flex: 0 0 18px; width: 18px; height: 18px; border: 2px solid var(--grey-400); border-radius: 50%; background: #fff; transition: background-color .12s, border-color .12s; }
.accf-opt--cb .accf-mark { border-radius: 5px; }
.accf-opt-in:checked + .accf-opt-box .accf-mark { border-color: var(--brand-blue); background: var(--brand-blue); }
.accf-mark:after { content: ""; position: absolute; display: none; }
.accf-opt-in:checked + .accf-opt-box .accf-mark:after { display: block; }
.accf-opt--radio .accf-mark:after { left: 3px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.accf-opt--cb .accf-mark:after { left: 4px; top: 0; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.accf-yn .accf-opt-box { justify-content: center; font-size: 0.9375rem; font-weight: 600; }
.accf-opt--rec .accf-opt-box { border-style: dashed; font-style: italic; }
.accf-stmt { margin: 8px 0 0; font-size: 0.78125rem; color: var(--grey-600); }
.accf-stmt b { color: var(--grey-900); font-weight: 600; }
.accf-ack .accf-opt-box { align-items: flex-start; padding: 14px 16px; background: var(--grey-50); color: var(--grey-900); font-size: 0.875rem; line-height: 1.5; }
.accf-ack .accf-mark { margin-top: 1px; }
.accf-ack .accf-opt-in:checked + .accf-opt-box { background: var(--success-bg); border-color: var(--success); color: #05603a; box-shadow: inset 0 0 0 1px var(--success); }
.accf-ack .accf-opt-in:checked + .accf-opt-box .accf-mark { background: var(--success); border-color: var(--success); }

/* Follow-up questions sit directly under the question that reveals them */
.accf-follow { margin-top: 12px; padding: 14px 16px 16px; border-left: 3px solid var(--brand-blue); border-radius: 0 10px 10px 0; background: #f4f8fb; animation: accfIn .2s ease-out; }
@keyframes accfIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Missing required answer */
.accf-field.is-invalid > .accf-label { color: var(--danger); }
.accf-field.is-invalid > input, .accf-field.is-invalid > select, .accf-field.is-invalid > textarea,
.accf-field.is-invalid > .accf-inline > input, .accf-field.is-invalid > .accf-time > select, .accf-field.is-invalid > .accf-lk-wrap > input {
  border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg);
}
.accf-field.is-invalid > .accf-opts .accf-opt-box, .accf-field.is-invalid > .accf-opt .accf-opt-box { border-color: #f97066; }

/* Time picker */
.accf-time { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.accf .accf-time select { width: auto; min-width: 76px; flex: 0 0 auto; }
.accf-colon { font-weight: 700; color: var(--grey-500); }

/* Staff-directory lookup */
.accf-lk-wrap { position: relative; }
.accf-lk { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; max-height: 320px; overflow-y: auto; padding: 4px; background: #fff; border: 1px solid var(--grey-300); border-radius: 10px; box-shadow: 0 12px 28px rgba(16, 24, 40, .14); }
.accf-lk-opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.accf-lk-opt:hover, .accf-lk-opt.is-active { background: var(--brand-blue-50); }
.accf-lk-main { display: flex; flex-direction: column; min-width: 0; }
.accf-lk-main b { font-size: 0.875rem; color: var(--grey-900); }
.accf-lk-main small { font-size: 0.75rem; color: var(--grey-500); }
.accf-lk-mail { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.71875rem; color: var(--grey-500); }
.accf-lk-msg { display: flex; align-items: center; gap: 8px; padding: 10px; font-size: 0.8125rem; color: var(--grey-500); }
.accf-linked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; padding: 7px 10px; border-radius: 8px; background: var(--success-bg); color: var(--success); font-size: 0.78125rem; }
.accf-linked.is-self { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.accf .accf-link-btn { min-height: 0; padding: 2px 4px; background: transparent; border: 0; color: inherit; font-size: 0.78125rem; font-weight: 600; text-decoration: underline; }
.accf .accf-link-btn:hover:not(:disabled) { background: transparent; border: 0; color: var(--grey-900); }

/* Uploads */
.accf-file-in { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; overflow: hidden; clip: rect(0, 0, 0, 0); }
.accf-drop { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 2px dashed var(--grey-300); border-radius: 12px; background: var(--grey-50); cursor: pointer; transition: background-color .12s, border-color .12s; }
.accf-drop:hover, .accf-drop.is-hover { border-color: var(--brand-blue); background: var(--brand-blue-50); }
.accf-drop.is-hover { border-style: solid; }
.accf-file-in:focus-visible + .accf-drop { outline: 3px solid color-mix(in srgb, var(--brand-blue) 35%, transparent); outline-offset: 2px; }
.accf-drop-ic { font-size: 1.5rem; line-height: 1; }
.accf-drop-tx { font-size: 0.84375rem; color: var(--grey-700); }
.accf-drop-tx b { color: var(--brand-blue); }
.accf-drop-tx small { display: block; margin-top: 2px; font-size: 0.75rem; color: var(--grey-500); }
.accf-files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.accf-files:empty { display: none; }
.accf-files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--grey-200); border-radius: 8px; background: #fff; font-size: 0.8125rem; }
.accf-files li.is-pending { background: var(--grey-50); color: var(--grey-500); }
.accf-files li.is-err { border-color: #fda29b; background: var(--danger-bg); color: var(--danger); }
.accf-files a, .accf-file-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.accf-file-size { font-size: 0.75rem; color: var(--grey-500); white-space: nowrap; }
.accf .accf-file-rm { flex: 0 0 auto; padding: 3px 10px; background: #fff; border: 1px solid var(--grey-300); border-radius: 6px; color: var(--grey-700); font-size: 0.75rem; }
.accf .accf-file-rm:hover:not(:disabled) { background: var(--danger-bg); border-color: #fda29b; color: var(--danger); }
.accf-spin { display: inline-block; flex: 0 0 14px; width: 14px; height: 14px; border: 2px solid var(--grey-300); border-top-color: var(--brand-blue); border-radius: 50%; animation: accfSpin .7s linear infinite; }
@keyframes accfSpin { to { transform: rotate(360deg); } }

/* Repeatable people list (type 'people' — e.g. witnesses): one card per person, "Add" button */
.accf-people { display: flex; flex-direction: column; gap: 10px; }
.accf-person { border: 1px solid var(--grey-200); border-radius: 10px; padding: 12px 14px 14px; background: #fff; }
.accf-person-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.accf-person-n { font-size: 0.78125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--grey-600); }
.accf-person-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; }
.accf-pf { display: flex; flex-direction: column; min-width: 0; }
.accf-pf > label { margin: 0 0 4px; font-size: 0.8125rem; font-weight: 600; color: var(--grey-800, #1d2939); }
.accf-pf > input, .accf-pf > select { width: 100%; }
.accf .accf-person-rm { min-height: 0; padding: 4px 10px; background: #fff; border: 1px solid var(--grey-300); border-radius: 6px; color: var(--grey-700); font-size: 0.78125rem; font-weight: 600; }
.accf .accf-person-rm:hover:not(:disabled) { background: var(--danger-bg); border-color: #fda29b; color: var(--danger); }
.accf .accf-people-add { align-self: flex-start; margin-top: 10px; }
.accf-field.is-invalid .accf-person.is-bad { border-color: #f97066; box-shadow: 0 0 0 3px var(--danger-bg); }

@media (max-width: 720px) {
  .accf { gap: 14px; }
  .accf-sec { padding: 14px 14px 16px; border-radius: 10px; }
  .accf-row { flex-direction: column; align-items: stretch; gap: 18px; }
  .accf-opts, .accf-opts--tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accf-opts--wide { grid-template-columns: 1fr; }
  .accf-yn { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accf input[type="text"], .accf input[type="tel"], .accf input[type="date"], .accf select, .accf textarea { font-size: 1rem; }
  .accf-follow { padding: 12px 12px 14px; }
  .accf-person-grid { grid-template-columns: 1fr; }
  .accf .accf-people-add { align-self: stretch; }
  .accf-lk-mail { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .accf *, .accf *:after { animation: none !important; transition: none !important; }
}

/* The new-report page (the form card) is drawn by orig.css, in the original app's own card. */

/* ---------------------------------------------------------------- the dashboard */
.sev-hospital { --sev: #d92d20; --sev-ink: #b42318; --sev-bg: #fef3f2; }
.sev-doctor { --sev: #ef6820; --sev-ink: #b93815; --sev-bg: #fef6ee; }
.sev-home { --sev: #eaaa08; --sev-ink: #854a0e; --sev-bg: #fefbe8; }
.sev-nurse { --sev: #2e90fa; --sev-ink: #175cd3; --sev-bg: #eff8ff; }
.sev-remained { --sev: #12b76a; --sev-ink: #027a48; --sev-bg: #ecfdf3; }
.sev-report { --sev: #98a2b3; --sev-ink: #475467; --sev-bg: #f2f4f7; }
.sev-none { --sev: #d0d5dd; --sev-ink: #667085; --sev-bg: #f9fafb; }
.acc-sev { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.65rem 0.2rem 0.5rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; background: var(--sev-bg, #f2f4f7); color: var(--sev-ink, #475467); border: 1px solid var(--sev, #d0d5dd); }
.acc-sev::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--sev, #98a2b3); flex: 0 0 0.5rem; }
.acc-badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); }
.acc-badge--import { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.acc-badge--type { background: var(--info-bg); color: var(--ink); border-color: var(--info-line); }
.acc-badge--edited { background: #f4f3ff; color: #5925dc; border-color: #d9d6fe; }
.acc-badge--test { background: var(--warn-bg); color: #6b4a10; border-color: var(--warn-line); }
.acc-locraw { display: inline-block; margin-left: 0.3rem; padding: 0 0.4rem; border-radius: 0.25rem; background: var(--warn-bg); color: #6b4a10; font-size: 0.7rem; font-weight: 600; }

.acc-toggle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; padding: 0.3rem; background: var(--bg); border: 1px solid var(--line); border-radius: 0.75rem; margin: 0.5rem 0; }
.acc-toggle__btn { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem; min-height: 3.25rem; padding: 0.6rem 0.9rem; border: 1px solid transparent; border-radius: 0.55rem; background: transparent; font: inherit; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.acc-toggle__btn:hover { background: rgba(255, 255, 255, 0.65); }
.acc-toggle__btn.is-active { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: 0 1px 3px rgba(20, 24, 27, 0.12); }
.acc-toggle__count { min-width: 2.25rem; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--line); font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.acc-toggle__btn.is-active .acc-toggle__count { background: var(--primary); color: #fff; }
.acc-toggle__of { font-size: 0.75rem; font-weight: 500; color: var(--ink-soft); }
.acc-scope { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0.1rem 0.75rem; }

.acc-controls { background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.9rem 1rem 1rem; margin-bottom: 0.75rem; }
.acc-search { position: relative; }
.acc-search input[type="search"] { width: 100%; min-height: 3rem; border: 1px solid #b8bec4; border-radius: 0.6rem; padding: 0.7rem 2.75rem 0.7rem 0.9rem; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; }
.acc-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.acc-search input[type="search"]:focus { outline: 3px solid var(--info-line); outline-offset: 0; }
.acc-search__clear { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.acc-search__clear:hover { background: var(--line); }
.acc-search__hint { font-size: 0.78rem; color: var(--ink-soft); margin: 0.4rem 0.1rem 0; }
.acc-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem 0.75rem; margin-top: 0.75rem; }
.acc-filter { display: block; min-width: 0; }
.acc-filter > span { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.2rem; }
.acc-filter select { width: 100%; min-height: 2.5rem; font: inherit; font-size: 0.85rem; padding: 0.4rem 0.5rem; border: 1px solid #b8bec4; border-radius: 0.4rem; background: #fff; text-overflow: ellipsis; }
.acc-filter select.is-set { border-color: var(--primary); background: var(--info-bg); font-weight: 600; }

.acc-resultbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.25rem 0 0.75rem; min-height: 2rem; }
.acc-count { font-size: 0.85rem; font-weight: 600; }
.acc-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.acc-chip { display: inline-flex; align-items: center; padding: 0.15rem 0.15rem 0.15rem 0.65rem; border-radius: 999px; background: var(--info-bg); border: 1px solid var(--info-line); font-size: 0.8rem; font-weight: 600; }
.acc-chip__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 20rem; }
.acc-chip button { background: transparent; border: 0; color: inherit; padding: 0.1rem 0.5rem; font-size: 1rem; line-height: 1; cursor: pointer; border-radius: 999px; min-width: 1.75rem; min-height: 1.75rem; }
.acc-chips__clear { background: transparent; border: 0; color: var(--ink-soft); font: inherit; font-size: 0.8rem; text-decoration: underline; cursor: pointer; padding: 0.2rem 0.4rem; }
.acc-resultbar__right { margin-left: auto; }

.acc-cards { display: grid; gap: 0.75rem; }
.acc-card[data-id] { max-width: none; margin: 0; overflow: visible; position: relative; border-left: 0.4rem solid var(--sev, #d0d5dd); padding: 0.9rem 1rem; }
.acc-card[data-id]:hover { box-shadow: 0 3px 10px rgba(20, 24, 27, 0.1); }
.acc-card.is-focus { box-shadow: 0 0 0 3px var(--info-line), 0 3px 10px rgba(20, 24, 27, 0.1); }
.acc-card.is-test { background: repeating-linear-gradient(135deg, #fff, #fff 0.9rem, #fffbf2 0.9rem, #fffbf2 1.8rem); }
.acc-card__top { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr) auto; gap: 0.4rem 1.1rem; align-items: start; }
.acc-date__main { font-size: 1rem; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.acc-date__sub { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.1rem; }
.acc-head { min-width: 0; }
.acc-name { font-size: 1.05rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.acc-name a { color: var(--ink); }
.acc-loc { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.1rem; }
.acc-matched { margin-top: 0.3rem; font-size: 0.78rem; color: var(--ink-soft); }
.acc-matched__tag { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 0.3rem; }
.acc-hit { display: inline-block; margin-right: 0.5rem; }
.acc-cards mark, .acc-ui-card mark { background: #fde68a; color: inherit; padding: 0 1px; border-radius: 2px; }
.acc-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; align-items: center; max-width: 21rem; }
.acc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.5rem 1rem; margin-top: 0.75rem; padding-top: 0.65rem; border-top: 1px solid var(--line); }
.acc-cell { display: flex; flex-direction: column; min-width: 0; }
.acc-cell__label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.acc-cell__value { font-size: 0.88rem; overflow-wrap: anywhere; }
.acc-cell__value.is-yes { font-weight: 700; }
.acc-cell__value.is-no { color: var(--ink-soft); }
.acc-card__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.acc-card[data-id] .acc-card__foot { padding: 0; border: 0; flex-direction: row; }
.acc-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; color: var(--ink-soft); }
.acc-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.acc-actions .btn { min-height: 2.5rem; display: inline-flex; align-items: center; text-decoration: none; }
.acc-empty { text-align: center; padding: 2rem 1rem; background: var(--card); border: 1px dashed var(--line); border-radius: 0.75rem; }
.acc-empty__tip { font-size: 0.85rem; color: var(--ink-soft); max-width: 36rem; margin: 0.6rem auto; }
.acc-empty__actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 0.6rem; }
.acc-more { display: flex; align-items: center; gap: 0.75rem; justify-content: center; margin: 1rem 0; }
.acc-more__note { font-size: 0.85rem; color: var(--ink-soft); }

@media (max-width: 64rem) { .acc-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 45rem) {
  .acc-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-card__top { grid-template-columns: minmax(0, 1fr); }
  .acc-badges { justify-content: flex-start; max-width: none; }
  .acc-date__main { white-space: normal; }
  .acc-toggle__btn { font-size: 0.85rem; padding: 0.4rem; gap: 0.3rem; min-height: 3rem; }
}

/* ---------------------------------------------------------------- one report */
.rp-head { background: var(--card); border: 1px solid var(--line); border-left: 0.4rem solid var(--sev, #d0d5dd); border-radius: 0.75rem; padding: 1rem 1.1rem; margin-bottom: 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }
.rp-head__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; align-items: center; }
.rp-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.rp-type { padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--info-bg); border: 1px solid var(--info-line); }
.rp-type--employee { background: #f4f3ff; border-color: #d9d6fe; }
.rp-id { font-size: 0.85rem; color: var(--ink-soft); }
.rp-name { margin: 0; font-size: 1.4rem; line-height: 1.25; overflow-wrap: anywhere; }
.rp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.6rem 1rem; }
.rp-fact { display: flex; flex-direction: column; min-width: 0; }
.rp-fact__lbl, .rp-field__lbl { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.rp-fact__val { overflow-wrap: anywhere; }
.rp-conf { font-size: 0.85rem; padding: 0.55rem 0.75rem; background: var(--bg); border-radius: 0.5rem; }
.rp-conf__tag { display: inline-block; margin-right: 0.5rem; padding: 0 0.45rem; border-radius: 0.25rem; background: var(--primary); color: #fff; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.rp-sec { background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; padding: 1rem 1.1rem; margin-bottom: 0.9rem; }
.rp-sec h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.rp-sec--legacy { background: var(--bg); }
.rp-sec__note { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 0.6rem; }
.rp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.25rem; }
.rp-field { display: flex; flex-direction: column; min-width: 0; }
.rp-field.is-full { grid-column: 1 / -1; }
.rp-val { overflow-wrap: anywhere; }
.rp-val--long { white-space: pre-wrap; }
.rp-statement { display: flex; gap: 0.5rem; padding: 0.55rem 0.75rem; background: var(--info-bg); border-radius: 0.5rem; }
.rp-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.rp-filelink { background: transparent; border: 0; padding: 0.25rem 0; color: var(--ink); font: inherit; text-decoration: underline; cursor: pointer; text-align: left; }
.rp-pdf { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; margin-bottom: 0.5rem; }
.rp-pdf.is-original { background: var(--bg); }
.rp-pdf__ic { flex: 0 0 auto; padding: 0.25rem 0.5rem; border-radius: 0.3rem; background: var(--stop); color: #fff; font-size: 0.7rem; font-weight: 700; }
.rp-pdf__main { flex: 1 1 auto; min-width: 0; }
.rp-pdf__name { font-weight: 600; overflow-wrap: anywhere; }
.rp-pdf__sub { font-size: 0.78rem; color: var(--ink-soft); }
.rp-history { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.rp-history th, .rp-history td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.rp-history th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.h-act { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.h-act--edit { background: #f4f3ff; border-color: #d9d6fe; }
.h-act--err { background: var(--stop-bg); border-color: var(--stop-line); }
.h-act--filed, .h-act--pdf { background: var(--ok-bg); border-color: var(--ok-line); }
.h-lbl { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--ink-soft); }
.h-changes { list-style: none; margin: 0.35rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.h-changes li { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: baseline; }
.h-field { font-weight: 600; }
.h-from { color: var(--ink-soft); text-decoration: line-through; }
.rp-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem 1rem; margin-top: 0.5rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; box-shadow: 0 -2px 10px rgba(20, 24, 27, 0.08); }
.rp-actions__hint { font-size: 0.85rem; color: var(--ink-soft); flex: 1 1 18rem; }
.rp-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rp-btns .btn { min-height: 2.75rem; }
@media (max-width: 45rem) {
  .rp-grid { grid-template-columns: 1fr; }
  .rp-history thead { position: absolute; left: -9999px; }
  .rp-history, .rp-history tbody, .rp-history tr, .rp-history td { display: block; width: 100%; }
  .rp-history tr { border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
  .rp-history td { border: 0; padding: 0.15rem 0; }
  .rp-history td::before { content: attr(data-l) ": "; font-weight: 700; color: var(--ink-soft); font-size: 0.75rem; }
  .rp-btns .btn { flex: 1 1 8rem; }
}
@media print {
  .acc-subnav, .rp-actions, .acc-toast { display: none !important; }
  .rp-head, .rp-sec { break-inside: avoid; }
}

/* ---------------------------------------------------------------- admin */
.acc-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0 0.9rem; }
.acc-tab-btn { padding: 0.55rem 0.9rem; min-height: 2.75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font: inherit; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.acc-tab-btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.acc-pane { outline: none; }
.acc-pane h3 { margin: 0.25rem 0; }
.acc-panel { background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.9rem 1rem; margin-bottom: 0.8rem; }
.acc-panel h4 { margin: 0 0 0.3rem; }
.acc-field { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.acc-grow { flex: 1 1 18rem; display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.acc-lbl { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
.acc-help { font-size: 0.82rem; color: var(--ink-soft); margin: 0.25rem 0; }
.acc-source { font-size: 0.78rem; color: var(--ink-soft); }
.acc-check { display: inline-flex; gap: 0.4rem; align-items: center; margin-top: 0.4rem; font-size: 0.88rem; }
.acc-panel input[type="text"], .acc-panel input[type="email"], .acc-panel input[type="url"], .acc-panel textarea, .acc-panel select, .acc-contact input, .acc-contact textarea, .acc-field input, .acc-field select {
  width: 100%; min-height: 2.5rem; padding: 0.4rem 0.6rem; font: inherit; border: 1px solid #b8bec4; border-radius: 0.4rem; background: #fff; color: var(--ink);
}
.acc-panel .rm-row input[type="text"] { flex: 1 1 14rem; width: auto; }
.acc-pill { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; border: 1px solid var(--line); background: var(--bg); margin-right: 0.3rem; }
.acc-pill.is-green { background: var(--ok-bg); border-color: var(--ok-line); }
.acc-pill.is-amber { background: var(--warn-bg); border-color: var(--warn-line); }
.acc-pill.is-blue { background: var(--info-bg); border-color: var(--info-line); }
.acc-pill.is-red { background: var(--stop-bg); border-color: var(--stop-line); }
.acc-default { margin: 0.4rem 0 0; }
.acc-default--warn { color: var(--warning); font-weight: 600; }
.acc-district-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.2rem 1rem; margin: 0.4rem 0; }
.acc-districttable .acc-sub td { background: var(--bg); }
.acc-pill.is-purple { background: #f4f3ff; border-color: #d9d6fe; }
.acc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.5rem; margin: 0.5rem 0; }
.acc-tile { border: 1px solid var(--line); border-top: 0.25rem solid var(--sev, var(--line)); border-radius: 0.5rem; padding: 0.5rem 0.65rem; background: var(--card); }
.acc-tile.is-hl { border-top-color: var(--primary); }
.acc-tile.is-warn { border-top-color: #e0bd7a; }
.acc-tile__n { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.acc-tile__l { font-size: 0.75rem; color: var(--ink-soft); }
.acc-bar { height: 0.6rem; background: var(--line); border-radius: 999px; overflow: hidden; min-width: 5rem; }
.acc-bar > span { display: block; height: 100%; background: var(--primary); }
.acc-yeartable td, .acc-yeartable th { white-space: nowrap; }
.acc-yeartable tr.is-zero td { color: var(--ink-soft); }
.acc-recovery__row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.acc-recovery__row span { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.acc-contacts { display: grid; gap: 0.75rem; }
.acc-contact { background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.8rem 1rem; }
.acc-contact__top { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.acc-contact__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem; margin-bottom: 0.5rem; }
.acc-flow { margin: 0.5rem 0 0.9rem; padding-left: 1.25rem; font-size: 0.9rem; color: var(--ink-soft); }
.acc-sheet { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.5rem 0; }
.acc-skipped { margin: 0.75rem 0; font-size: 0.875rem; color: var(--ink-soft); }
.acc-skipped ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.acc-tab { background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.8rem 1rem; margin-bottom: 0.8rem; }
.acc-tab.is-skip { background: var(--bg); }
.acc-tab__head { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: space-between; align-items: center; }
.acc-tab__title { font-weight: 700; }
.acc-tab__sub { display: flex; flex-wrap: wrap; gap: 0.3rem 0.5rem; align-items: center; font-size: 0.82rem; color: var(--ink-soft); }
.acc-details { margin: 0.5rem 0; font-size: 0.88rem; }
.acc-maphead { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.75rem 0 0.3rem; }
.acc-map select { min-width: 12rem; width: 100%; min-height: 2.25rem; font: inherit; }
@media (max-width: 40rem) {
  /* A phone: the place as recorded, then the row count and the "how" chip, then the select across the whole card. */
  .acc-map select { min-width: 0; }
  .acc-map td:nth-child(3) { grid-column: 1 / -1; order: 5; }
}
.acc-map tr.is-unmapped td { background: var(--warn-bg); }
.acc-map tr.is-changed td { background: var(--info-bg); }
.acc-raw { overflow-wrap: anywhere; }
.acc-savebar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: flex-end; padding: 0.6rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 0.75rem; }
.acc-aliases { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.acc-alias { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.2rem 0.1rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.8rem; background: var(--bg); }
.acc-xs { min-height: 1.75rem; padding: 0 0.5rem; }
.acc-job { margin-top: 0.75rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--bg); }
.acc-job.is-error { border-color: var(--stop-line); }
.acc-job.is-done { border-color: var(--ok-line); }
.acc-job__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.acc-live { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.acc-run { padding: 0.5rem 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.acc-run__top { display: flex; justify-content: space-between; gap: 0.5rem; font-weight: 600; }

/* ---------------------------------------------------------------- dialogs and the toast */
.acc-ui-overlay { position: fixed; inset: 0; z-index: var(--z-dialog, 4000); background: rgba(20, 24, 27, 0.5); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.acc-ui-card { background: var(--card); border-radius: 0.9rem; width: 100%; max-width: 32rem; max-height: 90vh; overflow: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); }
.acc-ui-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.9rem 1.1rem 0.4rem; }
.acc-ui-title { font-weight: 700; font-size: 1.05rem; }
.acc-ui-x { background: transparent; border: 0; font-size: 1.5rem; line-height: 1; width: 2.5rem; height: 2.5rem; cursor: pointer; border-radius: 50%; }
.acc-ui-body { padding: 0.25rem 1.1rem 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.acc-ui-body textarea { width: 100%; min-height: 5rem; padding: 0.5rem 0.65rem; font: inherit; border: 1px solid #b8bec4; border-radius: 0.5rem; }
.acc-ui-list { margin: 0; padding-left: 1.25rem; font-size: 0.9rem; }
.acc-ui-hint { font-size: 0.8rem; color: var(--ink-soft); }
.acc-ui-err { padding: 0.5rem 0.65rem; background: var(--stop-bg); border: 1px solid var(--stop-line); border-radius: 0.4rem; font-size: 0.88rem; }
.acc-ui-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem 1.1rem 1rem; }
.acc-ui-foot .btn { min-height: 2.75rem; }
.acc-toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: calc(var(--z-dialog, 4000) + 1); max-width: calc(100vw - 2rem); padding: 0.7rem 1rem; border-radius: 0.6rem; background: var(--primary); color: #fff; font-size: 0.92rem; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.acc-toast--show { opacity: 1; }
.acc-toast--error { background: var(--stop); }
@media (prefers-reduced-motion: reduce) { .acc-toast { transition: none; } }

/* The SOP list editor (v0.57.0). */
.sopl { display: flex; flex-direction: column; gap: 0.75rem; margin: 0.5rem 0; }
.sopl__row { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; }
.sopl__fields { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.sopl__fields input[data-f="label"] { flex: 1 1 12rem; min-width: 0; min-height: 2.5rem; padding: 0.4rem 0.6rem; font: inherit; border: 1px solid var(--line); border-radius: 0.4rem; }
.sopl__fields input[data-f="url"] { flex: 2 1 16rem; min-width: 0; min-height: 2.5rem; padding: 0.4rem 0.6rem; font: inherit; border: 1px solid var(--line); border-radius: 0.4rem; }
.sopl__open[hidden] { display: none; }
.sopl__forms { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.sopl__forms legend { font-weight: 700; padding: 0; margin-bottom: 0.25rem; }
.sopl__chk { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.25rem; }
.sopl__btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* v0.59.0: a status chip and its sentence in a box (the confirmation's "Cleared to drive"): side by side where they fit, and a long sentence wraps
   under the TEXT, not under the chip. Any app's confirmation may use it. */
.rm-statusbox { display: flex; align-items: baseline; gap: 0.6rem; text-align: left; }
.rm-statusbox > :first-child { flex: none; }
.rm-statusbox__text { flex: 1 1 0; min-width: 0; }
.rm-statusbox__text > p { margin: 0.35rem 0 0; }
.rm-statusbox .fl-pill { white-space: nowrap; margin-right: 0; }
