/* Logs - operator manual (MTOP). Uses the colours from app.css (:root). */
.man-tabs { margin-bottom: 16px; }
.man-tabs .tabs { border-bottom: 0; }
.man-pend { color: var(--soon); font-weight: 600; }
.man-intro { max-width: 860px; margin: -4px 0 14px; }
.man-grid { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.man-side { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.man-side input[type=search] { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.man-toc-h { margin: 12px 2px 6px; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
.man-toc { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.man-toc li a { display: block; padding: 4px 8px; border-radius: 4px; color: var(--ink); text-decoration: none; line-height: 1.35; }
.man-toc li a:hover { background: var(--surface-2); color: var(--accent); }
.man-toc li.lvl1 a { font-weight: 600; margin-top: 6px; color: var(--hull); }
.man-toc li.lvl2 a { padding-left: 16px; }
.man-toc .tp { display: block; font-size: 11px; color: var(--muted); }

/* ---------- the document ---------- */
.mdoc { padding: 26px 34px 30px; }
.mpart-title { font: 600 13px var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); border-bottom: 2px solid var(--hull); padding-bottom: 8px; margin-bottom: 6px; }
.msec { padding: 16px 0 6px; border-bottom: 1px solid var(--line-2); scroll-margin-top: 12px; }
.msec:last-of-type { border-bottom: 0; }
.msec.flash { animation: manflash 1.6s ease-out; }
@keyframes manflash { 0% { background: #DCE8FA; } 100% { background: transparent; } }
.msec-head { display: flex; align-items: baseline; gap: 10px; }
.msec-head h2 { font-size: 18px; color: var(--hull); flex: 1; }
.msec.lvl1 .msec-head h2 { font-size: 22px; }
.msec.lvl1 { padding-top: 26px; }
.mnum { font: 600 14px var(--display); color: #fff; background: var(--hull-2); border-radius: 4px; padding: 2px 8px; font-variant-numeric: tabular-nums; flex: none; }
.msec.lvl1 .mnum { background: var(--accent); font-size: 15px; }
.msec-acts { display: flex; gap: 4px; opacity: .55; transition: opacity .12s; }
.msec:hover .msec-acts, .msec-acts:focus-within { opacity: 1; }

.mbody { max-width: 860px; font-size: 15px; line-height: 1.6; }
.mbody p { margin: 8px 0; }
.mbody h4 { font: 600 15px var(--display); color: var(--hull-2); margin: 16px 0 4px; }
.mbody ul, .mbody ol { margin: 6px 0 10px; padding-left: 24px; }
.mbody li { margin: 3px 0; }
.mbody li > ol, .mbody li > ul { margin: 4px 0; }
.mbody blockquote { margin: 10px 0; padding: 4px 16px; border-left: 4px solid var(--spray); background: var(--surface-2); font-style: italic; }
.mbody p.note { background: var(--soon-bg); border-left: 4px solid var(--soon); padding: 8px 12px; border-radius: 0 4px 4px 0; }
.mbody table { border-collapse: collapse; margin: 10px 0 14px; font-size: 14px; width: 100%; }
.mbody th, .mbody td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.mbody thead th { background: var(--hull-2); color: #fff; font-weight: 600; font-size: 13px; }
.mbody table.kv td:first-child { width: 32%; background: var(--surface-2); }
.mbody table.sign td { height: 34px; }
.mbody table.matrix th { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; padding: 8px 4px; vertical-align: bottom; }
.mbody table.matrix th:first-child { writing-mode: horizontal-tb; transform: none; vertical-align: bottom; }
.mbody table.matrix td { text-align: center; color: var(--ok); font-weight: 700; }
.mbody table.matrix td:first-child { text-align: left; color: var(--ink); font-weight: 400; white-space: nowrap; }
.mbody table.matrix tbody tr:nth-child(even) td { background: #F5F8FC; }
.mbody table.form td:nth-child(3) { width: 30%; }
.mbody figure { margin: 12px 0; }
.mbody figure img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.mbody figcaption { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.man-add { padding-top: 18px; }

/* ---------- editor ---------- */
.ed-head { display: grid; grid-template-columns: 120px 1fr; gap: 0 12px; }
.ed-head:has(select) { grid-template-columns: 110px 1fr 1fr 150px; }
.ed-wrap { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; }
.ed-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; position: sticky; top: 0; z-index: 2; }
.ed-b { border: 1px solid transparent; background: none; padding: 4px 9px; border-radius: 4px; cursor: pointer; font-size: 13.5px; min-width: 30px; }
.ed-b:hover { background: #fff; border-color: var(--line); }
.ed-tools .sep { width: 1px; background: var(--line); margin: 3px 4px; }
.ed { min-height: 320px; max-height: 58vh; overflow: auto; padding: 10px 16px; outline: none; max-width: none; }
.ed:focus { box-shadow: inset 0 0 0 2px #CFE0F8; }
.ed table td, .ed table th { min-width: 40px; }
.chg-fields { grid-template-columns: 2fr 1fr; }
.chg-fields textarea { resize: vertical; }

/* ---------- change record ---------- */
.chg { display: inline-block; font: 600 11.5px var(--display); text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 3px; margin-right: 4px; background: var(--surface-2); color: var(--muted); }
.chg.edit { background: #E2ECFA; color: var(--accent); }
.chg.add { background: var(--ok-bg); color: var(--ok); }
.chg.delete { background: var(--over-bg); color: var(--over); }
.chg.tidy, .chg.import { background: var(--soon-bg); color: var(--soon); }
.chg-reason { background: var(--surface-2); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.diff { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; line-height: 1.7; max-height: 56vh; overflow: auto; font-size: 14.5px; }
.diff del, .chg-reason del, .modal del { background: #F8D9D5; color: #8E1F16; text-decoration: line-through; }
.diff ins, .modal ins { background: #D5EEDD; color: #1B5A38; text-decoration: underline; }

/* ---------- Procedures page card ---------- */
.man-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 18px; text-decoration: none; color: inherit; border-left: 4px solid var(--accent); }
.man-card:hover { border-color: var(--accent); background: #F7FAFE; }
.man-card h3 { font-size: 17px; color: var(--hull); }
.man-card > div:nth-child(2) { flex: 1; }
.man-card-ic { font: 700 13px var(--display); letter-spacing: .05em; color: #fff; background: linear-gradient(160deg, var(--hull-2), var(--hull)); border-radius: 6px; padding: 14px 10px; flex: none; }

/* ---------- print view ---------- */
.mprint { background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.mprint .msec-acts { display: none; }
.mcover { text-align: center; padding: 40px 20px 30px; }
.mcover h1 { font-size: 30px; color: var(--hull); margin: 10px 0 6px; }
.mcover-op { font: 600 14px var(--display); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.mcover-sub { color: var(--muted); }
.mcover-v { font: 600 16px var(--display); margin: 16px 0 20px; }
.mcover img { max-width: 70%; border-radius: 6px; margin-bottom: 16px; }
.mpage { padding-top: 24px; }
.mcontents { list-style: none; padding: 0; columns: 2; column-gap: 32px; font-size: 13.5px; }
@media print { .mcontents { font-size: 10.5px; line-height: 1.35; } }
.mcontents > li { break-inside: avoid; margin-bottom: 10px; }
.mcontents ul { list-style: none; padding: 0; margin: 4px 0 0; }
.mcontents li.lvl1 { font-weight: 600; margin-top: 4px; }
.mcontents li.lvl2 { padding-left: 14px; }

.man-grid > * { min-width: 0; }
@media screen { .mbody { overflow-x: auto; } }
@media (max-width: 1000px) {
  .man-grid { grid-template-columns: 1fr; }
  .man-tabs .tabs { flex-wrap: nowrap; }
  .man-side { position: static; max-height: 260px; }
  .mdoc { padding: 18px; }
  .ed-head, .ed-head:has(select), .chg-fields { grid-template-columns: 1fr; }
}
@media print {
  body { background: #fff; }
  .main { padding: 0 !important; }
  .mprint { border: 0; }
  .mdoc { padding: 0; }
  .mpage { break-before: page; }
  .msec { break-inside: auto; }
  .msec-head { break-after: avoid; }
  .mbody table, .mbody figure { break-inside: avoid; }
  .mbody thead th, .mnum { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .err { display: none; }
}
/* v2.1 start-up checklist (Operating Procedures 4, class "steps") */
.mbody table.steps td:first-child, .mbody table.steps th:first-child { width: 36px; text-align: center; color: var(--muted); }
.mbody table.steps td:nth-child(3), .mbody table.steps th:nth-child(3) { width: 80px; text-align: center; font-family: var(--display); }
.mbody table.steps td:nth-child(4), .mbody table.steps th:nth-child(4) { width: 44px; }
.mbody table.steps tbody tr:nth-child(even) td { background: #F5F8FC; }

/* v2.7 drawings open full size on click */
.mbody:not(.ed) figure img { cursor: zoom-in; }
