.compliance-heading,.compliance-toolbar,.compliance-rule-row,.compliance-hours {display:flex;align-items:center;gap:1rem;flex-wrap:wrap;justify-content:space-between}
.compliance-heading p {max-width:64ch}
.compliance-grid-wrap {overflow:auto;max-width:100%;margin:1rem 0;border:1px solid var(--edge);border-radius:.5rem}
.compliance-grid {width:100%;border-collapse:collapse}
.compliance-grid th,.compliance-grid td {padding:.65rem;border-bottom:1px solid var(--edge);text-align:center;min-width:8rem;max-width:12rem}
.compliance-grid th:first-child {position:sticky;left:0;z-index:1;text-align:left;background:var(--paper);min-width:9rem}
.compliance-grid .compliance-cell {width:100%;display:flex;align-items:center;flex-direction:column;gap:.15rem;background:transparent;border:0;box-shadow:none;min-height:44px;padding:.15rem}
.compliance-grid td:has(.compliance-cell:hover) {background:var(--row-hover)}
.compliance-grid .compliance-cell:hover,.compliance-grid .compliance-cell:focus-visible {outline:2px solid var(--focus);outline-offset:-2px}
.compliance-grid .compliance-cell {cursor:pointer}
/* Like the existing review desk, the cell is the target; an extra outlined card obscures the matrix. */
:root .compliance-grid button.compliance-cell {border-color:transparent !important;box-shadow:none !important;background:transparent !important}
/* The cell's word is one of the app's status pills (style guide: good / warn / bad / info / neutral), never a glyph. */
.compliance-cell [class^="pill-"] {white-space:normal;text-align:center}
.compliance-cell small {font-size:.75rem;line-height:1.35;color:var(--ink-soft)}
.compliance-cert-mark {display:inline-flex;vertical-align:middle;margin-left:.25rem;align-items:center;color:var(--done)}
/* Holding the certification is a positive state, so the shield is green (owner, November 11; style guide, Say it with a mark).
   On the month grid it sits on a service-coloured chip, where green would not read, so it keeps the chip's text colour there. */
.month-shift-bar .compliance-cert-mark {color:inherit}
.compliance-disclaimer {border:1px solid var(--edge);border-radius:.5rem;padding:.75rem 1rem;font-size:.85rem;line-height:1.5}
.compliance-rule-row {padding:.5rem 0}
.compliance-sources {padding-left:1.25rem;font-size:.85rem}
.compliance-hours {flex-wrap:nowrap;margin:.5rem 0;gap:.5rem}
.compliance-hours input,.compliance-hours select {min-width:0;flex:1;width:30%}
.compliance-proof-links {display:flex;flex-wrap:wrap;gap:1rem;margin:1rem 0}
.compliance-policy {white-space:pre-wrap}
.compliance-history {padding-left:1.25rem;overflow-wrap:anywhere}
.compliance-checklist {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr));gap:1rem}
.compliance-page .schedule-sheet input,.compliance-page .schedule-sheet textarea {max-width:100%}
@media(max-width:600px) {.compliance-grid th,.compliance-grid td{min-width:7rem;padding:.4rem}.compliance-grid th:first-child{min-width:7rem;max-width:8rem}.compliance-heading{align-items:flex-start}}

/* A status opens (owner, November 9): a › at the end of every pill, the cell tinted and outlined under the pointer. */
.compliance-pill {display:inline-flex;align-items:center;gap:4px}
.compliance-pill svg {width:12px;height:12px;flex:none;opacity:.8}
.compliance-grid th[scope="row"] .table-item-link {text-align:left}
.compliance-grid-hint {margin:var(--space-3) 0 0}
.compliance-toolbar {align-items:flex-end}
.compliance-filters {display:flex;flex-wrap:wrap;gap:var(--space-2);align-items:center}
.compliance-search {width:min(18rem,100%)}
.compliance-tab-book {margin-top:var(--space-3)}

/* Configuration: four panels on the page, each its own card (style guide, Cards; a full page keeps its sections as cards) */
.compliance-config {display:grid;gap:var(--space-4)}
.compliance-panel {display:grid;gap:var(--space-2);margin:0}
.compliance-panel > h2 {margin:0;font-size:var(--text-lg)}
.compliance-panel > .hint {margin:0}
.compliance-panel > button.small {justify-self:start}
.compliance-active {list-style:none;margin:0;padding:0;border:1px solid var(--edge);border-radius:var(--radius)}
.compliance-active > li {display:flex;justify-content:space-between;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-3)}
.compliance-active > li:nth-child(even) {background:var(--row-stripe)}
.compliance-active > li + li {border-top:1px solid var(--edge)}
/* Recommendations: bordered blocks striped in --row-stripe (style guide, Sheets: panels inside a panel) */
.compliance-recs {display:grid;gap:var(--space-3)}
.compliance-rec {border:1px solid var(--edge);border-radius:var(--radius);padding:var(--space-3) var(--space-4)}
.compliance-rec:nth-child(even) {background:var(--row-stripe)}
.compliance-rec h3 {margin:0 0 var(--space-1);font-size:var(--text-base);font-weight:600}
.compliance-rec p {margin:0 0 var(--space-1)}
.compliance-rec .actions {margin:var(--space-2) 0 0;justify-content:flex-start}
.compliance-dismissed ul {margin:var(--space-2) 0 0}
.compliance-dismissed li {display:flex;align-items:center;gap:var(--space-3);padding:var(--space-1) 0}
.compliance-coverage {display:grid;gap:var(--space-2)}
/* Boxes as wide as what goes in them, not the whole panel (owner, November 9) */
.compliance-config select.fit, .compliance-rule select.fit {width:auto;max-width:100%;justify-self:start;align-self:flex-start}
.compliance-days, .compliance-number, .compliance-search {justify-self:start;align-self:flex-start}
.compliance-days {width:16ch;max-width:100%}
.compliance-days::placeholder {font-style:italic}
.compliance-number {width:6ch}
.compliance-repeat {display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-2)}
.compliance-check-row {display:flex;align-items:flex-start;gap:var(--space-1)}
.compliance-check-row .has-tip {border:0 !important;padding:0;background:none;box-shadow:none}
:root .help-mark {display:inline-grid;place-items:center;min-height:0;width:20px;height:20px;padding:0;border:1px solid var(--edge) !important;border-radius:50%;
  background:transparent !important;box-shadow:none !important;color:var(--ink-soft);font-size:var(--text-xs);font-weight:700;line-height:1;cursor:help}
:root .help-mark:hover, :root .help-mark:focus-visible {color:var(--ink);border-color:var(--ink-soft) !important}
.compliance-save {position:sticky;bottom:0;justify-content:flex-end;background:var(--paper);border:1px solid var(--edge);border-radius:var(--radius);padding:var(--space-3) var(--space-4)}
/* the sticky name column takes its row's stripe, so a striped row reads as one band */
.compliance-grid tbody tr:nth-child(even) th:first-child {background:var(--row-stripe)}
/* Who needs it: one compact row per job, its name then a small select (owner, November 9: boxes as wide as their contents) */
.compliance-rule fieldset > label:not(.check) {display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:var(--space-3);margin:0;padding:var(--space-1) 0}
.compliance-rule fieldset > label:not(.check) + label:not(.check) {border-top:1px solid var(--edge)}
.compliance-rule fieldset > label:not(.check) select {width:auto;flex:none}
:root .compliance-grid th[scope="row"] .table-item-link {background:transparent !important}
