/* Insights "Aircraft health" section (ADR 0043; components/health_view.js).
   Light card styling to match insights.css. Nothing here may widen the page
   on a 390 px phone: long text wraps (overflow-wrap: anywhere) and every
   table scrolls inside its own .hv-table-wrap. */

.hv-section { margin-bottom: var(--space-4); }
.ins-container > .hv-section { margin-bottom: var(--space-4); }
.hv-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.hv-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; color: #445; font-weight: 700; margin: 0; padding-bottom: 6px; }
.hv-body { font-size: 13px; color: #334; min-width: 0; overflow-wrap: anywhere; }
.hv-body[aria-busy="true"] { cursor: progress; }

/* States */
.hv-state { padding: var(--space-3) 0; color: #667; }
.hv-state p { margin: 0 0 var(--space-2); }
.hv-error p { color: #a11d1d; }
.hv-retry { font: inherit; font-size: 13px; min-height: 30px; padding: 4px 12px; border: 1px solid #c9ced8; border-radius: var(--radius-md); background: #fff; color: #223; cursor: pointer; }
.hv-retry:hover { background: #eef4ff; border-color: var(--color-accent); }
.hv-retry:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Tier chips */
.hv-chip { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.4; padding: 1px 8px; border-radius: 10px; white-space: nowrap; background: #eef0f4; color: #556; }
.hv-tier-before_next_flight.hv-chip { background: #fdecea; color: #a11d1d; }
.hv-tier-next_maintenance.hv-chip { background: #fff3e0; color: #a24a00; }
.hv-tier-monitor.hv-chip { background: #e8f0fe; color: #1a4f9c; }
.hv-tier-no_action.hv-chip { background: #eef5ee; color: #2e6b31; }
.hv-tier-historical.hv-chip { background: #eef0f4; color: #556; }

/* Expandable rows */
.hv-body details > summary { cursor: pointer; list-style: none; }
.hv-body details > summary::-webkit-details-marker { display: none; }
.hv-arrow { display: inline-block; width: 10px; color: #889; font-size: 10px; transition: transform 0.15s; flex: none; }
.hv-body details[open] > summary .hv-arrow { transform: rotate(90deg); }
.hv-finding-head .hv-arrow { align-self: center; }
.hv-body details > summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.hv-group { margin-bottom: var(--space-2); }
.hv-group-summary, .hv-list-summary { display: flex; align-items: center; gap: var(--space-2); padding: 4px 0; font-weight: 600; }
.hv-group-count { font-size: 11px; color: #778; font-weight: 600; }
.hv-group-items { padding-left: var(--space-2); }

.hv-finding, .hv-block { border: 1px solid #e4e7ee; border-radius: var(--radius-md); margin: var(--space-1) 0; background: #fff; }
.hv-finding > summary, .hv-block > summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px var(--space-3); padding: 6px var(--space-2); }
.hv-finding[open] > summary, .hv-block[open] > summary { border-bottom: 1px solid #eef0f4; }
.hv-finding-head { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); min-width: 0; }
.hv-finding-title, .hv-block-title { color: #223; font-weight: 600; }
.hv-ata { font-size: 11px; color: #889; white-space: nowrap; }
.hv-finding-meta { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); min-width: 0; }
.hv-basis { font-size: 11px; color: #667; font-style: italic; }
.hv-short { font-size: 11px; color: #889; }
.hv-finding-body, .hv-block-body, .hv-list-body { padding: var(--space-2) var(--space-3) var(--space-3); min-width: 0; }

.hv-field { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-2); padding: 3px 0; }
.hv-field-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; color: #889; font-weight: 600; padding-top: 2px; }
.hv-field-value { color: #334; }
.hv-field-list { margin: 0; padding-left: 18px; }
.hv-rec .hv-field-value, .hv-rec .hv-field-list { color: #223; font-weight: 600; }
.hv-fim { margin: var(--space-1) 0 var(--space-2); padding-left: var(--space-2); border-left: 2px solid #d5dbe6; }
.hv-fim-head { margin: 0 0 var(--space-1); font-weight: 600; color: #334; }
.hv-fim-steps { margin: var(--space-1) 0; padding-left: 20px; }
.hv-fim-step { margin: 2px 0; }
.hv-text { margin: 0 0 var(--space-2); }
.hv-note { margin: var(--space-1) 0; font-size: 12px; color: #667; }
.hv-methods { font-size: 11px; color: #889; }
.hv-sub { margin-top: var(--space-2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; color: #889; font-weight: 600; }
.hv-empty { color: #99a; font-size: 12px; margin: var(--space-1) 0; }

.hv-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: #667; font-weight: 700; margin: var(--space-3) 0 var(--space-2); }
.hv-diagnoses { margin-top: var(--space-2); }
.hv-lists { margin-top: var(--space-3); border-top: 1px solid #eef0f4; padding-top: var(--space-2); }
.hv-list { border-bottom: 1px solid #f4f6fb; }
.hv-list-title { color: #445; }

/* Tables scroll in their own wrapper, never the page */
.hv-table-wrap { overflow-x: auto; max-width: 100%; margin: var(--space-1) 0 var(--space-2); -webkit-overflow-scrolling: touch; }
.hv-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.hv-table th { text-align: left; padding: 4px 8px; border-bottom: 2px solid #e4e7ee; color: #667; font-weight: 600; white-space: nowrap; }
.hv-table td { padding: 3px 8px; border-bottom: 1px solid #f0f1f5; vertical-align: top; overflow-wrap: normal; }
.hv-table td.hv-nw { white-space: nowrap; }
.hv-flight-link { color: #1a5fb4; text-decoration: none; }
.hv-flight-link:hover { text-decoration: underline; }
.hv-flight-link:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }

.hv-dq { margin-top: var(--space-2); }
.hv-dq-list { margin: 0; padding-left: 18px; font-size: 12px; color: #556; }
.hv-dq-list li { margin: 2px 0; }

/* The disclaimer: never collapsed on its own (ADR 0022); on Insights it sits
   with the other lists under the rows, after the always-visible note. */
.hv-disclaimer { margin-top: var(--space-3); padding: var(--space-2) var(--space-3); background: #f6f7fa; border-radius: var(--radius-md); font-size: 11px; color: #667; }
.hv-disclaimer p { margin: 0 0 var(--space-1); }
.hv-disclaimer p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
    .hv-field { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .hv-finding > summary, .hv-block > summary { flex-direction: column; align-items: flex-start; }
    .hv-head .ins-report { width: 100%; }
}

/* DSU sequence coverage (coverage_bar.css) in the data row, and the flight
   history's gap / undated rows (ADR 0043 note 2026-11-08). */
.hv-coverage { margin: 0 0 var(--space-3); min-width: 0; }
.hv-history-table tr.hv-gap-row td { background: #f6f7fa; color: #778; font-style: italic; white-space: normal; }

/* v5: the rare events nearby an occurrence (ADR 0040 note 2026-11-08), one line each */
.hv-lines { min-width: 16em; }
.hv-line { font-size: 0.92em; color: #45526b; white-space: normal; }
.hv-line + .hv-line { margin-top: 2px; }

/* v6 (ADR 0046): a system row's detail. Metric tables scroll in their
   wrapper on a phone rather than squeeze to one word a line. */
.hv-row-body > .hv-table-wrap .hv-table td { min-width: 9em; }
.hv-row-body > .hv-table-wrap .hv-table td:last-child { min-width: 18em; }
.hv-plot { font: inherit; font-size: 11px; margin-left: var(--space-2); padding: 0 6px; border: 1px solid #c9ced8; border-radius: var(--radius-md); background: #fff; color: #1a5fb4; cursor: pointer; }
.hv-plot:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.hv-barcell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hv-bar { display: inline-block; width: 48px; height: 7px; background: #eef1f6; border: 1px solid #c9ced8; border-radius: 2px; overflow: hidden; }
.hv-bar-fill { display: block; height: 100%; background: #45526b; }
/* the battery health estimates' bar colour (the server's bar_tone) */
.hv-bar-green { background: var(--color-severity-green); }
.hv-bar-amber { background: var(--color-severity-amber); }
.hv-bar-red { background: var(--color-severity-red); }

/* The header's open findings by tier, and the row list (owner request
   2026-11-16): one row per system and a last "Data & recording" row — a
   button with a colour dot (red before next flight, amber next
   maintenance, blue monitor, green no open findings, hollow grey not enough
   data), the name, a status word, the most important open finding and a
   count of the others; its detail opens beneath it. The colour is never
   alone: every row prints its words. About 30 px a row on a desktop; on a
   phone the notification takes a second line. */
.hv-head-tiers { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-3); margin-right: auto; padding-bottom: 6px; font-size: 12px; color: #556; }
.hv-head-tier { white-space: nowrap; padding-left: 6px; border-left: 3px solid #c9ced8; }
.hv-head-tier.hv-tier-before_next_flight { border-left-color: #c62828; }
.hv-head-tier.hv-tier-next_maintenance { border-left-color: #ef6c00; }
.hv-head-tier.hv-tier-monitor { border-left-color: #1565c0; }
.hv-head-tier.hv-tier-no_action { border-left-color: #2e7d32; }
.hv-head-count { font-weight: 700; color: #223; }
.hv-head-tier.hv-zero .hv-head-count { color: #aab; }

.hv-rows { border-top: 1px solid #eef0f4; }
.hv-row { border-bottom: 1px solid #eef0f4; }
/* (.ins-panel h3 is a card heading: none of it applies to a row) */
.hv-section .hv-row-h { margin: 0; font-size: inherit; font-weight: inherit; text-transform: none; letter-spacing: normal; color: inherit; }
.hv-row-btn { font: inherit; font-size: 13px; width: 100%; min-height: 30px; display: grid; grid-template-columns: 10px minmax(0, 20em) minmax(0, 9em) minmax(0, 1fr) auto 10px; grid-template-areas: "dot title status note more arrow"; align-items: center; gap: 0 var(--space-2); padding: 3px var(--space-1); border: 0; background: none; color: #223; text-align: left; cursor: pointer; }
.hv-row-btn:hover { background: #f6f8fc; }
.hv-row-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.hv-dot { grid-area: dot; width: 10px; height: 10px; border-radius: 50%; background: #c9ced8; box-sizing: border-box; }
.hv-tone-red .hv-dot { background: #c62828; }
.hv-tone-amber .hv-dot { background: #ef6c00; }
.hv-tone-blue .hv-dot { background: #1565c0; }
.hv-tone-green .hv-dot { background: #2e7d32; }
.hv-tone-grey .hv-dot { background: #fff; border: 2px solid #9aa0ab; }
.hv-row-title { grid-area: title; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-row-status { grid-area: status; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #556; }
.hv-tone-red .hv-row-status { color: #a11d1d; }
.hv-tone-amber .hv-row-status { color: #a24a00; }
.hv-tone-blue .hv-row-status { color: #1a4f9c; }
.hv-row-note { grid-area: note; font-size: 12px; font-weight: 400; color: #334; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-tone-green .hv-row-note { color: #2e6b31; }
.hv-tone-grey .hv-row-note, .hv-tone-none .hv-row-note { color: #667; }
.hv-row-more { grid-area: more; justify-self: end; align-self: center; font-size: 11px; font-weight: 700; line-height: 1.5; color: #445; background: #eef0f4; border-radius: 9px; padding: 0 6px; white-space: nowrap; }
.hv-row-more:empty { display: none; }
.hv-row-btn .hv-arrow { grid-area: arrow; }
.hv-row-open > .hv-row-h .hv-arrow { transform: rotate(90deg); }
.hv-row-open > .hv-row-h .hv-row-btn { background: #f6f8fc; }
.hv-row-panel { padding: var(--space-1) var(--space-2) var(--space-3) 22px; min-width: 0; }
.hv-row-panel[hidden] { display: none; }
.hv-row-reason { margin-top: 0; }
.hv-row-findings { margin-bottom: var(--space-2); }
.hv-foot { margin-top: var(--space-2); }
.hv-foot-note { margin: 0 0 var(--space-1); font-size: 11px; }
.hv-more { border-bottom: none; }
@media (max-width: 600px) {
    .hv-row-btn { grid-template-columns: 10px minmax(0, 1fr) auto 10px; grid-template-areas: "dot title status arrow" ". note more ."; row-gap: 1px; padding: 5px 2px; }
    .hv-row-title, .hv-row-note { white-space: normal; }
    /* at most two lines: the full text is the button's name and tooltip */
    .hv-row-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
    .hv-row-more { align-self: start; margin-top: 1px; }
    .hv-row-panel { padding-left: var(--space-2); padding-right: 0; }
    .hv-head-tiers { font-size: 11px; width: 100%; }
}
/* v9 subsystems (owner request 2026-11-19): every monitored subsystem of a
   system as a nested row under it — indented, a lighter title, a smaller
   dot (a green check when no issue is detected), about 28 px — its detail
   opening beneath it. The sub rules carry one more class than the row
   rules, so a sub's tone wins over its system's. */
.hv-subs { margin: 0 0 var(--space-2); border-top: 1px solid #f0f2f6; }
.hv-subrow { border-bottom: 1px solid #f0f2f6; }
.hv-sub-btn { font: inherit; font-size: 12.5px; width: 100%; min-height: 28px; display: grid; grid-template-columns: 10px minmax(0, 24em) minmax(0, 9em) minmax(0, 1fr) auto 10px; grid-template-areas: "dot title status note more arrow"; align-items: center; gap: 0 var(--space-2); padding: 2px var(--space-1) 2px 12px; border: 0; background: none; color: #223; text-align: left; cursor: pointer; }
.hv-sub-btn:hover { background: #f8f9fc; }
.hv-sub-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
/* the title column grows (review 2026-11-19): wide enough for the longest
   title at 1440 px, and it wraps rather than cutting a name short */
.hv-sub-btn .hv-row-title { font-weight: 500; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.hv-sub-btn .hv-row-status { font-size: 11.5px; }
.hv-sub-btn .hv-arrow { grid-area: arrow; }
.hv-subrow .hv-subdot { width: 8px; height: 8px; justify-self: center; }
.hv-subrow.hv-tone-red > .hv-sub-btn .hv-dot { background: #c62828; border: 0; }
.hv-subrow.hv-tone-amber > .hv-sub-btn .hv-dot { background: #ef6c00; border: 0; }
.hv-subrow.hv-tone-blue > .hv-sub-btn .hv-dot { background: #1565c0; border: 0; }
.hv-subrow.hv-tone-grey > .hv-sub-btn .hv-dot { background: #fff; border: 2px solid #9aa0ab; }
.hv-subrow.hv-tone-green > .hv-sub-btn .hv-dot.hv-check { width: auto; height: auto; background: none; border: 0; border-radius: 0; color: #2e7d32; font-size: 12px; font-weight: 700; line-height: 1; }
.hv-subrow.hv-tone-red > .hv-sub-btn .hv-row-status { color: #a11d1d; }
.hv-subrow.hv-tone-amber > .hv-sub-btn .hv-row-status { color: #a24a00; }
.hv-subrow.hv-tone-blue > .hv-sub-btn .hv-row-status { color: #1a4f9c; }
.hv-subrow.hv-tone-green > .hv-sub-btn .hv-row-status { color: #2e6b31; }
.hv-subrow.hv-tone-grey > .hv-sub-btn .hv-row-status { color: #667; }
.hv-subrow > .hv-sub-btn .hv-row-note { color: #445; }
.hv-subrow.hv-tone-green > .hv-sub-btn .hv-row-note, .hv-subrow.hv-tone-grey > .hv-sub-btn .hv-row-note { color: #667; }
.hv-subrow.hv-row-open > .hv-sub-btn .hv-arrow { transform: rotate(90deg); }
.hv-subrow.hv-row-open > .hv-sub-btn { background: #f8f9fc; }
.hv-sub-panel { padding: var(--space-1) var(--space-1) var(--space-2) 30px; min-width: 0; }
.hv-sub-panel[hidden] { display: none; }
.hv-sub-body > .hv-table-wrap .hv-table td { min-width: 9em; }
.hv-sub-body > .hv-table-wrap .hv-table td:last-child { min-width: 18em; }
.hv-sub-body .hv-engine-metrics .hv-table td { min-width: 0; }
.hv-sub-body .hv-engine-metrics .hv-table td:first-child { min-width: 12em; }
@media (max-width: 600px) {
    .hv-sub-btn { grid-template-columns: 10px minmax(0, 1fr) auto 10px; grid-template-areas: "dot title status arrow" ". note more ."; row-gap: 1px; padding: 4px 2px 4px 8px; }
    .hv-sub-btn .hv-row-title, .hv-sub-btn .hv-row-note { white-space: normal; }
    .hv-sub-btn .hv-row-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
    .hv-sub-btn .hv-row-more { align-self: start; margin-top: 1px; }
    .hv-sub-panel { padding-left: var(--space-2); padding-right: 0; }
}
.hv-toggle[hidden] { display: none; }
.hv-toggle { font: inherit; font-size: 13px; min-height: 30px; padding: 4px 12px; border: 1px solid #c9ced8; border-radius: var(--radius-md); background: #fff; color: #1a5fb4; cursor: pointer; }
.hv-toggle:hover { background: #eef4ff; border-color: var(--color-accent); }
.hv-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Inline sparklines (components/sparkline.js): one series, thin marks; the
   shaded band is the trend monitor's control band, the dashed line its
   baseline (or the median), the dotted line the alert limit, the vertical
   mark the alert onset. */
.hv-spark-slot { display: inline-flex; align-items: center; vertical-align: middle; margin: 2px var(--space-2) 2px 0; min-height: 28px; }
.hv-spark { display: block; overflow: visible; }
.hv-spark-band { fill: rgba(21, 101, 192, 0.10); stroke: none; }
.hv-spark-ref { fill: none; stroke: #778; stroke-width: 1; stroke-dasharray: 3 2; }
.hv-spark-limit { fill: none; stroke: #c62828; stroke-width: 1; stroke-dasharray: 1 2; }
.hv-spark-line { fill: none; stroke: #1a4f9c; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.hv-spark-dot { fill: #1a4f9c; }
.hv-spark-last { fill: #1a4f9c; stroke: #fff; stroke-width: 1; }
.hv-spark-onset { stroke: #ef6c00; stroke-width: 1.5; }
.hv-spark-empty { font-size: 11px; color: #99a; }
.hv-finding-plot, .hv-wsh-plot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); margin: 0 0 var(--space-2); }
.hv-finding-plot .hv-plot, .hv-wsh-plot .hv-plot { margin-left: 0; }
.hv-table td .hv-spark-slot { display: flex; }

/* The rows' consolidated content: engine metrics (Engines), windshield
   sides (Ice & rain), and a trend alert's live state + acknowledge. */
.hv-engine, .hv-windshield { margin-top: var(--space-2); min-width: 0; }
.hv-row-body .hv-engine-metrics .hv-table td { min-width: 0; }
.hv-row-body .hv-engine-metrics .hv-table td:first-child { min-width: 12em; }
.hv-wsh-side { padding: 4px 0; font-size: 12px; }
.hv-wsh-side + .hv-wsh-side { border-top: 1px dashed #e4e7ee; }
.hv-wsh-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.hv-wsh-name { font-weight: 700; }
.hv-wsh-item { color: #445; }
.hv-wsh-evidence { margin: 2px 0 0 1.2em; }
.hv-trend-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; margin: 0 0 var(--space-2); }
.hv-trend-actions .tra-btn { margin-left: 0; }
