/* Descent calculator. Loaded after home.css, article.css, the take-off and
   landing tool's tol.css, the mass and balance tool's mb.css and the fuel
   tool's fv.css, whose card, fields, notes, checks, tables and formula
   blocks (.calc) it reuses. */

/* Fields switched by the selects: [hidden] must beat the labels' flex. */
.ds [hidden] { display: none !important; }
.ds .tol-group > .wide { grid-column: 1 / -1; }
.tol-form input[aria-invalid="true"] { border-color: var(--magenta); outline: 2px solid var(--magenta); outline-offset: 1px; }

.ds .tol-out .main dd { font-size: 26px; }
.ds .tol-out .dim { opacity: 0.55; }
.mb-checks li.warn { color: #9a6212; font-weight: 600; }
.mb-checks li.warn::before { content: "!"; color: #b7791f; }

/* Profile */
.ds-chart { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 6px 4px 2px; }
.ds-svg { display: block; width: 100%; height: auto; }
.ds-axis { stroke: var(--rule); stroke-width: 2; }
.ds-guide { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.6; }
.ds-path { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.ds-path.ds-desc { stroke: var(--magenta); stroke-width: 3.5; }
.ds-rule { stroke: var(--blue); stroke-width: 2; stroke-dasharray: 7 6; fill: none; }
.ds-dot { fill: var(--magenta); stroke: var(--card); stroke-width: 2; }
.ds-rdot { fill: var(--blue); }
.ds-pt { fill: var(--ink); stroke: var(--card); stroke-width: 2; }
.ds-tick { stroke: var(--ink); stroke-width: 2; }
.ds-lab { font: 500 14px var(--mono); fill: var(--ink-soft); }
.ds-lab.b { font-weight: 600; fill: var(--ink); }
.ds-lab.r { fill: var(--blue); font-weight: 600; }

/* Headwind / tailwind comparison */
.ds-cmp { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 10px; }
.ds-cmp h4 { margin: 0 0 2px; font: 600 15px var(--body); color: var(--ink); }
.ds-cmp .mb-note { margin-bottom: 6px; }
.ds-cmp td { white-space: nowrap; }
.ds-cmp td:first-child { white-space: normal; }
.ds-cmp td small { font-family: var(--body); font-size: 12px; opacity: 0.85; }

/* The live steps sit in the result column: keep the label column narrow. */
.ds-steps .calc-r { grid-template-columns: 9.5em minmax(0, 1fr); }
.ds-steps { margin-top: 8px; }
@media (max-width: 600px) {
  .ds-steps .calc-r { grid-template-columns: minmax(0, 1fr); }
  .ds-cmp th, .ds-cmp td { padding: 7px 5px; font-size: 13px; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mb-checks li.warn { color: #e0a84a; }
}
:root[data-theme="dark"] .mb-checks li.warn { color: #e0a84a; }

@media print {
  .skip, header.nav, .art-head, main > article, footer.foot, .ds .tol-form { display: none !important; }
  body { background: #fff; color: #000; }
  .tol-card { display: block; border: 0; box-shadow: none; }
}
