/* Incidents module. Every selector is prefixed with "incidents". Phone first: large tap
   targets (48 px and up), one column under 700 px, no horizontal page scroll at 390 px. */
.content:has(.incidents-noscope) > .scope-bar { display: none; }
.incidents-big { min-height: 52px; font-size: 14px; padding: 12px 18px; }
.incidents-toolbar { align-items: center; }
.incidents-filters { align-items: flex-end; }
.incidents-filters .incidents-date { display: flex; flex-direction: column; font-size: 11px; color: #5C5851; gap: 2px; }
.incidents-filters .incidents-date input { min-width: 140px; }
.incidents-metrics .metric .icon { float: right; color: #9B9386; }
.incidents-title-cell { min-width: 220px; }
.incidents-flags { display: block; margin-top: 4px; }
.incidents-table tbody tr { cursor: pointer; }
.incidents-table td:first-child { white-space: nowrap; }
.incidents-table tbody tr:focus-visible { outline: 3px solid #AA7A02; outline-offset: -3px; }

/* Report form */
.incidents-report { max-width: 760px; }
.incidents-report fieldset, .incidents-energy fieldset, .incidents-wizard fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.incidents-report legend, .incidents-group > legend, .incidents-group > summary { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: #242424; }
.incidents-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.incidents-tile { position: relative; display: block; cursor: pointer; }
.incidents-tile input, .incidents-seg-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.incidents-tile span { display: block; min-height: 72px; padding: 12px; border: 2px solid #D8D1C4; border-radius: 8px; background: #fff; }
.incidents-tile strong { display: block; font-size: 14px; }
.incidents-tile small { display: block; font-size: 11px; margin-top: 4px; }
.incidents-tile-hot span { border-color: #f0c2c6; }
.incidents-tile input:checked + span { border-color: #DBB363; background: #fceced; box-shadow: inset 0 0 0 1px #DBB363; }
.incidents-tile input:focus-visible + span, .incidents-seg-item input:focus-visible + span { outline: 3px solid #AA7A02; outline-offset: 2px; }
.incidents-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.incidents-seg legend:not(.sr-only) { width: 100%; }
.incidents-seg-item { flex: 1 1 90px; position: relative; }
.incidents-seg-item span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 12px; border: 2px solid #D8D1C4; border-radius: 8px; background: #fff; font-weight: 650; text-align: center; }
.incidents-seg-item input:checked + span { border-color: #181818; background: #181818; color: #fff; }
.incidents-sub { border-left: 3px solid #D8D1C4; padding-left: 14px; margin: -6px 0 18px; }
.incidents-inline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.incidents-inline input, .incidents-inline select { flex: 1 1 160px; width: auto; margin-top: 0; }
.incidents-chips { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.incidents-chips li { display: inline-flex; align-items: center; gap: 4px; background: #F3F0E9; border-radius: 16px; padding: 2px 4px 2px 12px; font-size: 12px; }
.incidents-check { align-items: flex-start; min-height: 40px; margin: 6px 0; }
.incidents-check input { margin-top: 2px; flex-shrink: 0; }
.incidents-check small { font-weight: 700; color: #666157; margin-right: 4px; }
.incidents-row-help { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin: -10px 0 18px; }
.incidents-row-help [aria-pressed="true"] { background: #fceced; border-color: #DBB363; color: #a31923; }
.incidents-group { border: 1px solid #DED9CF !important; border-radius: 8px; padding: 14px !important; background: #fff; }
.incidents-group > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.incidents-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 18px; }
.incidents-quick .btn { min-height: 44px; }
.incidents-report label.check { min-height: 44px; align-items: center; }
.incidents-photo-btn { cursor: pointer; }
.incidents-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.incidents-thumbs figure { margin: 0; display: grid; gap: 4px; }
.incidents-thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid #D8D1C4; }
.incidents-submit { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 0; }
.incidents-submit small { flex-basis: 100%; }
.incidents-done .incidents-ref { font-size: 30px; font-weight: 750; color: #181818; letter-spacing: 1px; margin: 4px 0 12px; }

/* Serious event and agency report */
.incidents-serious { border: 2px solid #DBB363; background: #fff4f4; border-radius: 8px; padding: 14px 16px; margin: 12px 0 18px; }
.incidents-serious strong { display: flex; gap: 8px; align-items: center; color: #a31923; }
.incidents-serious p { color: #4a1c20; margin: 6px 0; }
.incidents-agency { margin-bottom: 16px; }
.incidents-ok { color: #246547; }
.incidents-warn { color: #795600; }

/* Detail */
.incidents-head { margin-top: 18px; }
.incidents-head h2 { font-size: 22px; margin: 2px 0 6px; overflow-wrap: anywhere; }
.incidents-head p { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.incidents-statusbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fff; border: 1px solid #DED9CF; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.incidents-statusbar select { width: auto; min-height: 36px; padding: 4px 8px; }
.incidents-blocked { flex-basis: 100%; font-size: 12px; color: #795600; }
.incidents-blocked summary { cursor: pointer; font-weight: 650; }
.incidents-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid #DED9CF; margin-bottom: 18px; }
.incidents-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 14px; min-height: 46px; font-weight: 650; color: #625D55; white-space: nowrap; }
.incidents-tabs button[aria-selected="true"] { color: #b51924; border-bottom-color: #DBB363; }
.incidents-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 18px; margin: 14px 0; }
.incidents-dl dt { font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px; color: #666157; font-weight: 700; }
.incidents-dl dd { margin: 2px 0 0; font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.incidents-people { list-style: none; padding: 0; margin: 0; }
.incidents-people li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F0EDE6; }
.incidents-people li.incidents-current { background: #fceced; padding-left: 8px; border-radius: 6px; }
.incidents-files { list-style: none; padding: 0; }
.incidents-files li { padding: 8px 0; border-bottom: 1px solid #F0EDE6; overflow-wrap: anywhere; }
.incidents-upload { display: grid; gap: 8px; margin-bottom: 16px; }
.incidents-columns { columns: 2 240px; }
.incidents-fishbone { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.incidents-rationale { white-space: pre-wrap; font: 12px/1.6 Workspace, "Segoe UI", sans-serif; background: #FAF9F6; border: 1px solid #DED9CF; border-radius: 6px; padding: 12px; overflow-wrap: anywhere; }
.incidents-days { grid-template-columns: repeat(2, 1fr); }
.incidents-period { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.incidents-period select, .incidents-period input { flex: 1 1 120px; width: auto; }

/* Energy assessment and wizard dialogs */
.incidents-help { font-size: 12px; color: #56534D; padding-left: 18px; }
.incidents-src { border: 1px solid #DED9CF !important; border-radius: 8px; padding: 6px 12px 10px !important; }
.incidents-src:has(input[name$="-present"]:not(:checked)) .incidents-src-body { display: none; }
.incidents-q { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; margin: 8px 0; font-size: 13px; }
.incidents-yn { display: inline-flex; gap: 12px; }
.incidents-yn label { display: inline-flex; gap: 6px; align-items: center; min-height: 36px; }
.incidents-yn input { width: 18px; min-height: 18px; }
.incidents-preview { font-weight: 700; color: #181818; }
.incidents-step { border: 1px solid #DED9CF !important; border-radius: 8px; padding: 10px 14px !important; }
.incidents-step legend { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.incidents-wizard-result { position: sticky; bottom: 0; background: #fff; border-top: 2px solid #181818; padding: 10px 0; max-height: 30vh; overflow: auto; }
.incidents-wizard-result ol { padding-left: 18px; font-size: 12px; margin: 0; }
.incidents-yes::marker { color: #246547; }
.incidents-no { color: #a31923; }
.incidents-pending { color: #795600; }
.incidents-calc summary { cursor: pointer; font-weight: 650; }

/* OSHA logs */
.incidents-osha-bar label { display: flex; flex-direction: column; font-size: 11px; color: #5C5851; gap: 2px; }
.incidents-log th, .incidents-log td { padding: 8px; font-size: 11px; }
.incidents-log td.incidents-x, .incidents-log td.incidents-num { text-align: center; }
.incidents-log tbody tr[data-osha-open] { cursor: pointer; }
.incidents-total th, .incidents-total td { font-weight: 750; background: #FAF9F6; text-align: center; }
.incidents-hours input { min-width: 110px; }
.incidents-links { list-style: none; padding: 0; }
.incidents-links li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #F0EDE6; }
.incidents-links small { display: block; }
.incidents-columns-list code { overflow-wrap: anywhere; font-size: 11px; }
.incidents-public { max-width: 760px; }
.incidents-public-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

@media (max-width: 700px) {
  .incidents-tiles { grid-template-columns: 1fr 1fr; }
  .incidents-table thead { display: none; }
  .incidents-table, .incidents-table tbody, .incidents-table tr, .incidents-table td { display: block; width: 100%; }
  .incidents-table tr { border-bottom: 1px solid #DED9CF; padding: 10px 14px; }
  .incidents-table td { border: 0; padding: 3px 0; max-width: none; }
  /* Two columns per card (number and date, type and site, severity and status), the
     description across both, so a phone shows more than two incidents per screen. */
  .incidents-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; }
  .incidents-table tbody td { width: auto; min-width: 0; overflow-wrap: anywhere; }
  .incidents-table tbody td.incidents-title-cell { grid-column: 1 / -1; min-width: 0; }
  .incidents-table td::before { content: attr(data-label); display: block; font-size: 9px; text-transform: uppercase; letter-spacing: 0.6px; color: #666157; }
  .incidents-submit { position: sticky; bottom: 0; background: #F6F4EF; border-top: 1px solid #DED9CF; z-index: 4; padding: 8px 0; gap: 8px; }
  .incidents-submit .incidents-big { flex: 1 1 55%; }
  .incidents-submit small { font-size: 11px; }
  .incidents-filters .incidents-date, .incidents-filters select, .incidents-filters input { flex: 1 1 140px; min-width: 0; }
  .incidents-days { grid-template-columns: 1fr 1fr; }
}
