/* Digital forms (Logs v2.8) - Procedures > Forms */
.fm-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fm-tile { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface-2); color: inherit; text-decoration: none; }
.fm-tile:hover { border-color: var(--accent); background: #fff; }
.fm-tile span { font: 600 12px var(--display); color: var(--accent); }
.fm-tile b { display: block; font-size: 15.5px; margin: 2px 0 4px; }
.fm-tile em { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); }
.fm-filt { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 0; }
.fm-filt input { max-width: 300px; }
.fm-filt select { max-width: 300px; }
.fm-ref { display: inline-block; padding: 1px 7px; border-radius: 4px; background: var(--surface-2); font: 600 12px var(--display); color: var(--accent); }
.fm-ref.big { font-size: 15px; vertical-align: middle; }
.fm-st { display: inline-block; padding: 1px 8px; border-radius: 10px; font: 600 12px var(--body); }
.fm-st.ok { background: var(--ok-bg); color: var(--ok); }
.fm-st.dr { background: var(--soon-bg); color: #7A4F00; }
.fm-desc { margin-bottom: 6px; }
.fm-sec { margin: 0 0 18px; }
.fm-h { font-size: 15px; color: var(--hull); margin: 14px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--line-2); }
.fm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.fm-grid label.f em { display: block; }
.fm-sec > textarea { width: 100%; }
.fm-note { padding: 10px 12px; background: var(--surface-2); border-left: 4px solid var(--accent); border-radius: 4px; font-size: 14px; }
table.fm-chk td, table.fm-chk th { vertical-align: middle; }
table.fm-chk th.c, table.fm-chk td.c { text-align: center; width: 58px; }
table.fm-chk td:last-child input[type=text] { width: 100%; min-width: 180px; }
table.fm-chk input[type=radio], table.fm-chk input[type=checkbox], table.fm-grid-t input[type=checkbox] { width: 19px; height: 19px; }
.fm-stop { color: var(--over); font-weight: 700; font-size: 13px; }
.fm-stop:empty { display: none; }
table.fm-grid-t td { vertical-align: top; padding: 5px 6px; }
table.fm-grid-t td textarea, table.fm-grid-t td input[type=text], table.fm-grid-t td select { width: 100%; min-width: 110px; }
table.fm-grid-t td.c { text-align: center; }
table.fm-grid-t th { vertical-align: bottom; }
.fm-gh { font-weight: 400; text-transform: none; letter-spacing: 0; }
.fm-n { color: var(--muted); width: 30px; }
[data-addrow] { margin-top: 8px; }
.fm-foot { justify-content: flex-end; margin: -6px 0 24px; }
/* read-only view and print */
.fm-ph { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--hull); padding-bottom: 8px; margin-bottom: 6px; }
.fm-ph h2 { font-size: 22px; margin: 0; }
.fm-org { font-size: 13px; color: var(--muted); font-weight: 600; }
.fm-ro .f > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fm-v { min-height: 26px; padding: 3px 0; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.fm-txt { min-height: 60px; white-space: normal; }
.fm-blank { display: inline-block; min-width: 1px; }
.fm-box { display: inline-flex; width: 17px; height: 17px; border: 1.5px solid #555; border-radius: 3px; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; line-height: 1; }
.fm-box.on { background: #E8F3EC; border-color: var(--ok); color: var(--ok); }
.fm-pf { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 6px; }
@media (max-width: 900px) { .fm-cards { grid-template-columns: 1fr 1fr; } .fm-grid { grid-template-columns: 1fr 1fr; } }
@media print {
  .fm-print { border: 0; box-shadow: none; }
  .fm-print .panel-body { padding: 0; }
  .fm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .fm-sec { break-inside: auto; margin-bottom: 10px; }
  .fm-h { margin-top: 8px; break-after: avoid; }
  table.fm-chk tr, table.fm-grid-t tr { break-inside: avoid; }
  .fm-chk, .fm-grid-t { font-size: 12px; }
  .fm-v { min-height: 20px; margin-bottom: 6px; }
}
@media print {
  table.fm-chk td, table.fm-chk th, table.fm-grid-t td, table.fm-grid-t th { padding-top: 3px; padding-bottom: 3px; }
  .fm-chk .small, .fm-sec > .small { font-size: 10.5px; }
  .fm-h { font-size: 13.5px; margin: 6px 0 4px; }
  .fm-sec { margin-bottom: 6px; }
  .fm-txt { min-height: 44px; }
  .fm-note { padding: 6px 10px; font-size: 12px; }
  .fm-box { width: 14px; height: 14px; font-size: 11px; }
}
/* v2.9 risk rating matrix - floating window */
.fm-hrow { display: flex; align-items: center; gap: 12px; }
.fm-hrow .fm-h { flex: 1 1 auto; }
.fm-mxbtn { flex: 0 0 auto; }
.fm-mx { position: fixed; z-index: 60; width: 560px; max-width: calc(100vw - 32px); max-height: calc(100vh - 100px); overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 36px rgba(10, 25, 50, .28); }
.fm-mx-h { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; background: var(--hull); color: #fff; cursor: move; border-radius: 10px 10px 0 0; user-select: none; position: sticky; top: 0; }
.fm-mx-h b { flex: 1 1 auto; }
.fm-mx-h .small { opacity: .7; }
.fm-mx-x { background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; padding: 2px 6px; }
.fm-mx-b { padding: 10px 12px 12px; }
.fm-mx-t { width: 100%; border-collapse: separate; border-spacing: 3px; margin: 8px 0; table-layout: fixed; }
.fm-mx-t th { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2; padding: 2px; }
.fm-mx-t th span { display: block; font: 700 13px var(--display); color: var(--ink); }
.fm-mx-t tbody th { text-align: right; padding-right: 6px; width: 92px; }
.fm-mx-t .fm-mx-ax { font-size: 11.5px; color: var(--hull); text-transform: uppercase; letter-spacing: .04em; }
.fm-mx-t td { text-align: center; padding: 6px 2px; border-radius: 5px; cursor: pointer; border: 2px solid transparent; }
.fm-mx-t td b { display: block; font: 700 15px var(--display); }
.fm-mx-t td em { display: block; font-style: normal; font-size: 10.5px; }
.fm-mx-t td:hover { border-color: var(--ink); }
.fm-mx-t td.sel { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.mx-low { background: #CFEBD6; color: #1E5631; }
.mx-medium { background: #FFF0B3; color: #6B5300; }
.mx-high { background: #FFC58F; color: #7A3A00; }
.mx-extreme { background: #F2A39B; color: #6E1209; }
.fm-mx-msg { min-height: 20px; font-weight: 600; font-size: 13px; color: var(--hull); }
.fm-mx-key { display: grid; gap: 4px; margin: 6px 0 8px; font-size: 12.5px; }
.fm-mx-key span { display: inline-block; min-width: 100px; padding: 1px 6px; border-radius: 4px; margin-right: 8px; font-weight: 700; font-size: 12px; }
.fm-mx details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.fm-mx-d { font-size: 12.5px; display: grid; gap: 3px; margin-top: 6px; }
.fm-mx-d b { margin-top: 6px; }
.fm-mx-d span { display: inline-block; min-width: 118px; font-weight: 600; }
tr.fm-flash td { background: #FFF6CC; transition: background .3s; }
/* rating colours in the form's rating column */
