/* Mass and balance calculator. Loaded after home.css, article.css and the
   take-off and landing tool's tol.css, whose card, fields and outputs it reuses. */

.mb[data-mode="load"] .mb-move, .mb[data-mode="move"] .mb-load { display: none; }

.tol-form input[type="text"], .tol-form textarea { width: 100%; min-width: 0; padding: 10px 11px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink); font: 600 16px var(--body); }
.tol-form textarea { font: 500 15px/1.5 var(--mono); resize: vertical; }
.tol-form input[type="text"]:focus, .tol-form textarea:focus { outline: 2px solid var(--magenta); outline-offset: 1px; }

.mb-note { margin: 0; font-size: 14px; color: var(--ink-soft); }
.mb-note.wide { grid-column: 1 / -1; }
.mb-edit { grid-column: 1 / -1; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; background: var(--paper); }
.mb-edit > summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.mb-edit[open] > summary { margin-bottom: 12px; }
.mb-edit .tol-group { grid-column: 1 / -1; }
.mb-save { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mb-saved { font-size: 14px; color: #1f7a4d; }

.mb-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.mb-checks li { padding-left: 18px; position: relative; color: var(--ink-soft); }
.mb-checks li::before { content: "✓"; position: absolute; left: 0; color: #1f7a4d; font-weight: 700; }
.mb-checks li.bad { color: var(--magenta); font-weight: 600; }
.mb-checks li.bad::before { content: "!"; color: var(--magenta); }

.mb-chart { display: block; width: 100%; height: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.mb-grid { stroke: var(--rule); stroke-width: 1; }
.mb-tick { font: 500 13px var(--mono); fill: var(--ink-soft); }
.mb-ax { font: 600 14px var(--body); fill: var(--ink-soft); }
.mb-env { fill: var(--blue); fill-opacity: 0.12; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; }
.mb-path { stroke: var(--ink); stroke-width: 2; }
.mb-path.dash { stroke-dasharray: 4 4; stroke-width: 1.4; opacity: 0.6; }
.mb-dot { stroke: var(--card); stroke-width: 2; }
.mb-dot.ok { fill: #1f7a4d; }
.mb-dot.bad { fill: var(--magenta); }
.mb-lbl { font: 700 16px var(--mono); fill: var(--ink); }

.mb-tbl table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mb-tbl th, .mb-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--rule); text-align: right; }
.mb-tbl th:first-child, .mb-tbl td:first-child { text-align: left; }
.mb-tbl th { font-weight: 600; color: var(--ink-soft); }
.mb-tbl td { font-family: var(--mono); }
.mb-tbl td:first-child { font-family: var(--body); }
.mb-tbl tr.sum td { font-weight: 700; background: var(--paper-2); }
.mb-tbl tr.main td { background: var(--ink); color: var(--paper); }
.tbl-wrap { overflow-x: auto; }

.mb-sheet-head, .mb-sign { display: none; margin: 0; font-size: 14px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mb-dot.ok { fill: #5fd09a; }
  :root:not([data-theme="light"]) .mb-saved, :root:not([data-theme="light"]) .mb-checks li::before { color: #5fd09a; }
}
:root[data-theme="dark"] .mb-dot.ok { fill: #5fd09a; }

@media print {
  .skip, header.nav, .art-head, main > article, footer.foot, .tol-modes, .mb .tol-form, #mbPrint, .tol-chart > p { display: none !important; }
  body { background: #fff; color: #000; }
  .tol { padding: 0; max-width: none; }
  .tol-card { display: block; border: 0; box-shadow: none; padding: 0; background: #fff; }
  .mb-sheet-head, .mb-sign { display: block; }
  .mb-sign { margin-top: 18px; }
  .tol-res { gap: 10px; }
  .tol-out div, .tol-out .main { background: #fff; color: #000; border: 1px solid #999; }
  .mb-chart { max-width: 460px; border-color: #999; }
  .mb-tbl tr.main td, .mb-tbl tr.sum td { background: #eee; color: #000; }
  .tol-res, .tol-chart, .mb-tbl { break-inside: avoid; }
}
.mb-checks li.warn { color: var(--ink); font-weight: 600; }
.mb-checks li.warn::before { content: "!"; color: #b7791f; }
.mb-where { grid-column: 1 / -1; margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); }
.mb-where > summary { cursor: pointer; font-weight: 600; color: var(--magenta); }
.mb-where ul { margin: 8px 0 6px; padding-left: 18px; display: grid; gap: 6px; }
.mb-where p { margin: 0; font-size: 13px; }
.mb-save [hidden], .mb-where [hidden], #mbEnvMomHint[hidden] { display: none; }
