/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Container ─────────────────────────────────────────────────────────── */
#oil-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
    max-width: 1100px;
    margin: 48px auto;
    padding: 0 24px;
}

/* ── Stepper ───────────────────────────────────────────────────────────── */
.oda-stepper {
    display: flex;
    align-items: center;
    margin-bottom: 2.5rem;
}

.oda-step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.oda-step-item:last-child { flex: 0; }

.oda-step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    transition: background .2s, box-shadow .2s;
}

.oda-step-active {
    background: #004fa3;
    color: #fff;
    box-shadow: 0 0 0 4px #dbeafe;
}

.oda-step-done {
    background: #004fa3;
    color: #fff;
}

.oda-step-idle {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #9ca3af;
}

.oda-step-label {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.oda-step-label--active {
    color: #111827;
    font-weight: 500;
}

.oda-step-conn {
    flex: 1;
    height: 1px;
    background: #d1d5db;
    margin: 0 10px;
}

.oda-step-conn--done { background: #004fa3; }

/* ── Page headings ─────────────────────────────────────────────────────── */
.oda-h1 {
    font-size: 26px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px;
}

.oda-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 1.75rem;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.oda-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.oda-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.oda-card-header i {
    font-size: 18px;
    color: #004fa3;
}

/* ── Grid ──────────────────────────────────────────────────────────────── */
.oda-grid {
    display: grid;
    gap: 1rem;
}

.oda-g2 { grid-template-columns: 1fr 1fr; }
.oda-g3 { grid-template-columns: 1fr 1fr 1fr; }
.oda-full { grid-column: 1 / -1; }

@media (max-width: 720px) {
    .oda-g2, .oda-g3 { grid-template-columns: 1fr; }
}

/* ── Fields ────────────────────────────────────────────────────────────── */
.oda-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* .oda-field's own `display: flex` above otherwise wins over the browser's
   default `[hidden] { display: none }` rule (author CSS always overrides
   user-agent CSS, regardless of specificity), which silently defeated the
   `hidden` attribute anywhere it was set on a `.oda-field` — e.g. the
   Your details step's conditional State/Province field. */
.oda-field[hidden] {
    display: none;
}

.oda-field label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.oda-req { color: #dc2626; margin-left: 2px; }

.oda-field input,
.oda-field select,
.oda-field textarea {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    color: #111827;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 12px;
    height: 40px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.oda-field textarea {
    height: 96px;
    resize: vertical;
    padding: 10px 12px;
}

.oda-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-color: #f9fafb;
    padding-right: 32px;
}

.oda-field input:hover,
.oda-field select:hover,
.oda-field textarea:hover {
    border-color: #9ca3af;
}

.oda-field input:focus,
.oda-field select:focus,
.oda-field textarea:focus {
    border-color: #004fa3;
    /* background-color (not the `background` shorthand) — the shorthand
       resets background-image to `none`, which was wiping out the select's
       chevron icon (and its position/repeat) every time a select field
       gained focus. */
    background-color: #fff;
    box-shadow: 0 0 0 3px #dbeafe;
}

/* Error state */
.oda-has-err input,
.oda-has-err select,
.oda-has-err textarea {
    border-color: #dc2626;
    /* background-color, not `background` — see note above; same shorthand
       bug would otherwise wipe the chevron on a select showing an error. */
    background-color: #fef2f2;
}

.oda-err-msg {
    font-size: 12px;
    color: #dc2626;
    display: none;
}

.oda-has-err .oda-err-msg { display: block; }

.oda-hint {
    font-size: 12px;
    color: #9ca3af;
}

/* ── Checkbox row ──────────────────────────────────────────────────────── */
.oda-checkbox-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: .875rem 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    cursor: pointer;
}

.oda-checkbox-row input[type="checkbox"] {
    width: auto;
    height: auto;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #004fa3;
}

.oda-checkbox-row span {
    font-size: 13px;
    color: #374151;
    line-height: 1.55;
}

/* ── Oil Quality standard (IEC/IEEE) sub-choice ───────────────────────────
   Deliberately a SIBLING of .oda-checkbox-row, not nested inside it — an
   <input> nested inside a <label> that already wraps another <input>
   (testOQ) would risk clicks on the radios also toggling the checkbox. */
.oda-test-choice-wrap {
    display: flex;
    flex-direction: column;
}

.oda-oq-standard {
    display: flex;
    align-items: center;
    margin: 8px 0 0 1rem;
}

.oda-oq-standard-disabled {
    opacity: .45;
}

/* Every direct child of .oda-oq-standard (this label, and each
   .oda-radio-item below) is pinned to the exact same 14px height/
   line-height on purpose. Measuring this in a real browser (via
   getBoundingClientRect) showed the IEC and IEEE items — both already
   14px tall themselves — still landing 2.5px apart under
   align-items:center. The real cause turned out to be the site's own
   theme/plugin CSS: a generic `label { margin-bottom: ...; }` rule (from
   a combined/optimized stylesheet) was leaking onto our
   <label class="oda-radio-item"> elements, since we never gave the
   label itself an explicit margin to override it with.
   The 14px spacing between "Standard"/IEC/IEEE is set directly here as
   margin-right (rather than via a separate low-specificity "> * + *"
   selector, which a first attempt at this used — that rule's specificity
   is lower than .oda-radio-item's own, so the margin:0 needed below to
   beat the theme's `label` rule was quietly cancelling it out too,
   collapsing all the spacing). Both are `!important` since the theme's
   reset is external and its own specificity/order relative to ours
   isn't something we control — this way ours always wins regardless. */
.oda-oq-standard-label {
    display: inline-flex;
    align-items: center;
    height: 14px;
    line-height: 14px;
    margin: 0 14px 0 0 !important;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.oda-radio-item {
    display: inline-flex;
    align-items: center;
    height: 14px;
    margin: 0 14px 0 0 !important;
    font-size: 13px;
    line-height: 14px;
    color: #374151;
    cursor: pointer;
    position: relative;
}

.oda-oq-standard-disabled .oda-radio-item {
    cursor: default;
}

/* The real <input> stays in the DOM (for click/keyboard/focus and to
   drive :checked below) but is stretched invisibly over the whole label
   instead of being shown itself — two attempts at styling the native
   radio directly (matching box size, then appearance:none + hand-drawn
   ring/dot) both still came out with the checked one sitting visibly
   lower than the unchecked one once measured on a real render, which
   points to the native form-control box itself carrying an inconsistent
   layout contribution across browsers, not just an inconsistent look.
   Taking it out of flow entirely removes that variable — the visible
   circle below (.oda-radio-dot) is a plain span with no native
   form-control involved, so its position is decided purely by ordinary
   flex layout and can't drift between the two states. */
.oda-radio-item input[type="radio"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.oda-oq-standard-disabled .oda-radio-item input[type="radio"] {
    cursor: default;
}

.oda-radio-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    border: 1.5px solid #9ca3af;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    margin: 0 5px 0 0 !important;
}

.oda-radio-item input[type="radio"]:checked + .oda-radio-dot {
    border-color: #004fa3;
}

.oda-radio-item input[type="radio"]:checked + .oda-radio-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #004fa3;
    transform: translate(-50%, -50%);
}

.oda-oq-standard-note {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
    margin: 3px 0 0 1rem;
}

/* ── Actions bar ───────────────────────────────────────────────────────── */
.oda-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
}

.oda-actions-right {
    display: flex;
    gap: 10px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.oda-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.oda-btn:hover { background: #f9fafb; }

.oda-btn-primary {
    background: #004fa3;
    border-color: #004fa3;
    color: #fff;
}

.oda-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.oda-btn-ghost {
    border-color: transparent;
    background: transparent;
    color: #6b7280;
}

.oda-btn-ghost:hover { background: #f3f4f6; color: #374151; }

/* ── Alert banner ──────────────────────────────────────────────────────── */
.oda-alert {
    display: flex;
    gap: 10px;
    padding: .875rem 1rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.oda-alert i { color: #d97706; font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.oda-alert p { font-size: 13px; color: #374151; line-height: 1.55; }

/* ── Review summary ────────────────────────────────────────────────────── */
.oda-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .oda-summary-grid { grid-template-columns: 1fr; }
}

.oda-summary-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
}

.oda-summary-title {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 .875rem;
}

.oda-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid #e5e7eb;
}

.oda-summary-row:last-child { border-bottom: none; }

.oda-summary-key {
    font-size: 13px;
    color: #6b7280;
    flex-shrink: 0;
}

.oda-summary-val {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    text-align: right;
    word-break: break-word;
}

/* ── Success screen ────────────────────────────────────────────────────── */
.oda-success {
    text-align: center;
    padding: 5rem 1rem;
}

.oda-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #d1fae5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 28px;
    color: #059669;
}

.oda-success-title {
    font-size: 22px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 .5rem;
}

.oda-success-body {
    font-size: 15px;
    color: #6b7280;
}


/* ══════════════════════════════════════════════════════════════════════════
   Oil test grid — page 3 — years as rows, parameters as columns
   ══════════════════════════════════════════════════════════════════════════ */

/* Legend */
.oda-ot-legend {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: .5rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    align-items: center;
}
.oda-ot-legend-item { display:flex; align-items:center; gap:6px; font-size:13px; color:#374151; }
.oda-grade-dot { width:11px; height:11px; border-radius:50%; flex-shrink:0; }

/* Scroll wrapper */
.oda-grid-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f9fafb;
}
.oda-grid-scroll::-webkit-scrollbar { height: 6px; }
.oda-grid-scroll::-webkit-scrollbar-track { background: #f9fafb; }
.oda-grid-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* Table */
.oda-cross-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: 12px;
}

/* ── Column headers ───────────────────────────────────────────────────── */
.oda-ch {
    padding: 6px 8px;
    background: #f3f4f6;
    border-bottom: 2px solid #d1d5db;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    text-align: center;
}

/* Group header (Core / Advanced / Indices) */
.oda-ch-group {
    background: #eef2ff;
    color: #3730a3;
    border-bottom: 1px solid #c7d2fe;
    padding: 4px 8px;
}

/* Year/meta sticky column headers */
.oda-ch-yr-label, .oda-ch-yr-meta {
    background: #f3f4f6;
    position: sticky;
    z-index: 3;
    border-right: 1px solid #e5e7eb;
}
.oda-ch-yr-label { left: 0;     min-width: 148px; }
.oda-ch-yr-meta  { left: 148px; min-width: 70px; }
.oda-ch-yr-meta + .oda-ch-yr-meta { left: 218px; min-width: 100px; }

/* Param column headers */
.oda-ch-param {
    min-width: 108px;
    max-width: 120px;
    vertical-align: bottom;
    padding-bottom: 8px;
}
.oda-ch-param-name {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    white-space: normal;
    line-height: 1.3;
    margin-bottom: 2px;
}
.oda-ch-param-unit {
    display: block;
    font-size: 9px;
    color: #9ca3af;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.oda-ch-param-method {
    display: block;
    font-size: 8px;
    color: #b0b5bd;
    font-weight: 400;
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 1px;
}

/* Dashboard column headers */
.oda-ch-dash  { min-width: 66px; background: #faf5ff; color: #6b21a8; }
.oda-ch-oqi   { min-width: 72px; }

/* ── Year rows ────────────────────────────────────────────────────────── */
.oda-yr { border-bottom: 1px solid #f3f4f6; }
.oda-yr:last-child { border-bottom: none; }
.oda-yr:hover .oda-yl { background: #f0f4ff; }
.oda-yr:nth-child(even) .oda-yl { background: #fafafa; }

/* Sticky left cells (year + meta) */
.oda-yl {
    padding: 5px 8px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    vertical-align: middle;
    position: sticky;
    z-index: 1;
}
.oda-yl-year { left: 0;    min-width: 148px; }
.oda-yl-meta { left: 148px; min-width: 70px; }
.oda-yl-meta + .oda-yl-meta { left: 218px; min-width: 100px; }

/* Date-tested input */
.oda-year-input {
    width: 136px;
    height: 28px;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    background: #eef2ff;
    font-size: 13px;
    font-weight: 700;
    color: #1e40af;
    padding: 0 6px;
    outline: none;
}
.oda-year-input:focus { border-color: #004fa3; box-shadow: 0 0 0 2px #dbeafe; }

/* Meta inputs inside year row */
.oda-meta-input-sm {
    width: 58px; height: 26px;
    border: 1px solid #d1d5db; border-radius: 5px;
    background: #fff; font-size: 11px; color: #111827;
    padding: 0 5px; outline: none;
    -moz-appearance: textfield;
}
.oda-meta-input-sm::-webkit-outer-spin-button,
.oda-meta-input-sm::-webkit-inner-spin-button { -webkit-appearance: none; }
.oda-meta-input-sm:focus { border-color: #004fa3; box-shadow: 0 0 0 2px #dbeafe; }

/* Fixed (non-editable) HV band / oil type display — these are always
   derived from the Transformer step and get silently re-derived every
   time this step is re-entered (see render()'s "step === 'oil-quality'"
   block), so they used to be an editable <select> that looked
   customizable per test date but wasn't really — any edit was wiped out
   on the next visit to this step. Rendered as plain fixed text instead. */
.oda-meta-fixed {
    height: 26px; width: 90px;
    display: flex; align-items: center;
    border: 1px solid #e5e7eb; border-radius: 5px;
    background: #f3f4f6; font-size: 11px; color: #111827;
    padding: 0 8px; box-sizing: border-box;
}

/* Fixed IEC HV band label — same plain-text treatment as the IEEE note
   below it (no box), so the two stack as a matching pair once IEEE is
   selected instead of a boxed IEC value sitting above unboxed IEEE text.
   Neutral grey rather than IEEE's blue so the two stay visually distinct. */
.oda-hv-iec-note {
    font-size: 10px;
    font-weight: 700;
    color: #374151;
    white-space: nowrap;
}

/* Read-only IEEE voltage-class note shown under the IEC HV band note
   once IEEE is the selected standard — see _yearRowHTML() in app.js.
   Not a form control: the class itself is always derived from the
   Transformer step's rated voltage, never edited per test date. */
.oda-hv-ieee-note {
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    color: #004fa3;
    white-space: nowrap;
}

/* ── Data cells ───────────────────────────────────────────────────────── */
.oda-cd {
    padding: 3px 4px;
    border-right: 1px solid #f3f4f6;
    vertical-align: middle;
}
.oda-cd:last-child { border-right: none; }
.oda-cd-cell     { background: #fff; }
.oda-cd-untested { background: #004fa3; }
.oda-cd-dash     { background: #faf5ff; text-align: center; padding: 4px 5px; }
.oda-cd-oqi      { background: #f5f3ff; }

/* Cell content: checkbox + input + grade pip inline */
.oda-cell-wrap {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;
}

.oda-chk {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    cursor: pointer;
    accent-color: #004fa3;
}

.oda-val-input {
    width: 66px;
    height: 26px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #f9fafb;
    font-size: 11px;
    color: #111827;
    padding: 0 5px;
    outline: none;
    flex-shrink: 0;
    -moz-appearance: textfield;
}
.oda-val-input::-webkit-outer-spin-button,
.oda-val-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.oda-val-input:focus { border-color: #004fa3; background: #fff; box-shadow: 0 0 0 2px #dbeafe; }
.oda-val-input:disabled { background: #004fa3; border-color: #004fa3; color: #004fa3; cursor: not-allowed; }

/* Grade pip */
.oda-grade-pip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}
.oda-grade-pip--empty { background: transparent; color: #9ca3af; }

/* Dashboard badges */
.oda-dash-idx {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 22px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
}
.oda-oqi-badge { font-size: 12px; min-width: 48px; }

/* Category badge (used in param header tooltip) */
.oda-tr-cat {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
}
.oda-tr-cat--core { background: #dbeafe; color: #1e40af; }
.oda-tr-cat--adv  { background: #f3e8ff; color: #6b21a8; }

/* ══════════════════════════════════════════════════════════════════════════
   Review results — page 4
   ══════════════════════════════════════════════════════════════════════════ */

/* Summary bar */
.oda-rv-summary-bar {
    display: flex;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: #fff;
}
.oda-rv-sb-item {
    flex: 1;
    padding: .875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid #e5e7eb;
}
.oda-rv-sb-item:last-child { border-right: none; }
.oda-rv-sb-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #9ca3af; }
.oda-rv-sb-val   { font-size: 20px; font-weight: 700; color: #111827; }

/* Two-column layout */
.oda-rv-two-col {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1.5rem;
}
@media (max-width: 860px) { .oda-rv-two-col { grid-template-columns: 1fr; } }

.oda-rv-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: .875rem;
}
.oda-rv-section-title i { font-size: 16px; color: #004fa3; }

/* Year cards grid */
.oda-rv-year-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.oda-rv-year-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.oda-rv-year-card--empty {
    background: #f9fafb;
    border-style: dashed;
}

/* Card header */
.oda-rv-yc-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .75rem 1rem;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}
.oda-rv-yc-year {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    min-width: 44px;
}
.oda-rv-yc-oqi {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
}
.oda-rv-yc-worst {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
}
.oda-rv-yc-empty {
    padding: .875rem 1rem;
    font-size: 13px;
    color: #9ca3af;
}

/* Card body */
.oda-rv-yc-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid #f3f4f6;
}
@media (max-width: 640px) { .oda-rv-yc-body { grid-template-columns: 1fr; } }

.oda-rv-yc-indices {
    padding: .875rem 1rem;
    border-right: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.oda-rv-idx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.oda-rv-idx-label { font-size: 12px; color: #6b7280; }
.oda-rv-idx-val {
    min-width: 40px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
}

/* Completeness mini-bars */
.oda-rv-yc-completeness {
    padding: .875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}
.oda-rv-cmp-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}
.oda-rv-cmp-row .oda-ys-bar-wrap { flex: 1; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.oda-rv-cmp-row span:last-child { font-weight: 600; color: #111827; min-width: 28px; text-align: right; }
.oda-rv-cmp-row span:first-child { min-width: 40px; }

/* Recommended actions */
.oda-rv-actions-section {
    padding: .75rem 1rem;
    background: #fffbeb;
    border-top: 1px solid #fcd34d;
}
.oda-rv-actions-section--ok {
    background: #f0fdf4;
    border-top-color: #bbf7d0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #16a34a;
}
.oda-rv-actions-section--ok i { font-size: 16px; }
.oda-rv-actions-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #92400e;
    margin-bottom: 6px;
}
.oda-rv-actions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.oda-rv-action {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
}
.oda-rv-action .oda-grade-pip {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    font-size: 10px;
    margin-top: 1px;
}

/* Side column */
.oda-rv-col-side {
    position: sticky;
    top: 1rem;
}

.oda-rv-sparkline-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: .5rem;
}

.oda-rv-glossary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: .875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.oda-rv-gl-item {
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
}
.oda-rv-gl-item strong { color: #111827; }

/* Reuse bar styles from old scoring sheet */
.oda-ys-bar-wrap { flex:1; height:6px; background:#e5e7eb; border-radius:3px; overflow:hidden; }
.oda-ys-bar      { height:100%; border-radius:3px; transition:width .3s; }

/* ══════════════════════════════════════════════════════════════════════════
   Review results — page 4
   ══════════════════════════════════════════════════════════════════════════ */

/* Summary bar */
.oda-rv-summary-bar {
    display: flex;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: #fff;
}
.oda-rv-sb-item {
    flex: 1;
    padding: .875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid #e5e7eb;
}
.oda-rv-sb-item:last-child { border-right: none; }
.oda-rv-sb-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #9ca3af; }
.oda-rv-sb-val   { font-size: 20px; font-weight: 700; color: #111827; }

/* Two-column layout */
.oda-rv-two-col {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1.5rem;
}
@media (max-width: 860px) { .oda-rv-two-col { grid-template-columns: 1fr; } }

.oda-rv-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: .875rem;
}
.oda-rv-section-title i { font-size: 16px; color: #004fa3; }

/* Year cards grid */
.oda-rv-year-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.oda-rv-year-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.oda-rv-year-card--empty {
    background: #f9fafb;
    border-style: dashed;
}

/* Card header */
.oda-rv-yc-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .75rem 1rem;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}
.oda-rv-yc-year {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    min-width: 44px;
}
.oda-rv-yc-oqi {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
}
.oda-rv-yc-worst {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
}
.oda-rv-yc-empty {
    padding: .875rem 1rem;
    font-size: 13px;
    color: #9ca3af;
}

/* Card body */
.oda-rv-yc-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid #f3f4f6;
}
@media (max-width: 640px) { .oda-rv-yc-body { grid-template-columns: 1fr; } }

.oda-rv-yc-indices {
    padding: .875rem 1rem;
    border-right: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.oda-rv-idx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.oda-rv-idx-label { font-size: 12px; color: #6b7280; }
.oda-rv-idx-val {
    min-width: 40px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
}

/* Completeness mini-bars */
.oda-rv-yc-completeness {
    padding: .875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}
.oda-rv-cmp-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}
.oda-rv-cmp-row .oda-ys-bar-wrap { flex: 1; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.oda-rv-cmp-row span:last-child { font-weight: 600; color: #111827; min-width: 28px; text-align: right; }
.oda-rv-cmp-row span:first-child { min-width: 40px; }

/* Recommended actions */
.oda-rv-actions-section {
    padding: .75rem 1rem;
    background: #fffbeb;
    border-top: 1px solid #fcd34d;
}
.oda-rv-actions-section--ok {
    background: #f0fdf4;
    border-top-color: #bbf7d0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #16a34a;
}
.oda-rv-actions-section--ok i { font-size: 16px; }
.oda-rv-actions-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #92400e;
    margin-bottom: 6px;
}
.oda-rv-actions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.oda-rv-action {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
}
.oda-rv-action .oda-grade-pip {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    font-size: 10px;
    margin-top: 1px;
}

/* Side column */
.oda-rv-col-side {
    position: sticky;
    top: 1rem;
}

.oda-rv-sparkline-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: .5rem;
}

.oda-rv-glossary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: .875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.oda-rv-gl-item {
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
}
.oda-rv-gl-item strong { color: #111827; }

/* Reuse bar styles from old scoring sheet */
.oda-ys-bar-wrap { flex:1; height:6px; background:#e5e7eb; border-radius:3px; overflow:hidden; }
.oda-ys-bar      { height:100%; border-radius:3px; transition:width .3s; }

/* ── Add / Remove year controls ──────────────────────────────────────── */
.oda-btn-add-year {
    height: 32px;
    padding: 0 14px;
    font-size: 13px;
    background: #004fa3;
    border-color: #004fa3;
    color: #fff;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    cursor: pointer;
}
.oda-btn-add-year:hover:not(:disabled) { background: #1d4ed8; }
.oda-btn-add-year:disabled {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.oda-yl-remove {
    left: auto;
    position: static;
    padding: 3px 6px;
    border-right: none;
    border-left: 1px solid #f3f4f6;
    background: #fff;
    text-align: center;
}
.oda-yr:nth-child(even) .oda-yl-remove { background: #fafafa; }

.oda-remove-row {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #ef4444;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    padding: 0;
    transition: background .12s;
}
.oda-remove-row:hover { background: #fee2e2; }

.oda-ch-remove { width: 36px; min-width: 36px; }

/* Import-from-PDF button (per row, under the date input) */
.oda-pdf-import-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 136px;
    height: 24px;
    margin-top: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    border-radius: 5px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
    transition: background .12s;
}
.oda-pdf-import-btn:hover:not(:disabled) { background: #dbeafe; }
.oda-pdf-import-btn:disabled { opacity: .6; cursor: default; }
.oda-pdf-import-btn i { font-size: 13px; }

/* Import-from-PDF review overlay */
.oda-pdf-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}
.oda-pdf-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px 22px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.oda-pdf-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.oda-pdf-modal-head h3 { margin: 0; font-size: 17px; color: #111827; }
.oda-pdf-modal-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    line-height: 1;
}
.oda-pdf-modal-close:hover { color: #374151; }

.oda-pdf-review-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.oda-pdf-review-row {
    display: grid;
    grid-template-columns: 20px 1fr 100px 130px;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: #fff;
    font-size: 13px;
}
.oda-pdf-review-row:nth-child(even) { background: #fafafa; }
.oda-pdf-review-row--empty { color: #9ca3af; }
.oda-pdf-review-name { color: #374151; }
.oda-pdf-review-unit { color: #9ca3af; font-size: 11px; margin-left: 4px; }
.oda-pdf-review-val {
    width: 100%;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    padding: 0 8px;
    font-family: inherit;
    font-size: 13px;
}
.oda-pdf-review-match { font-size: 11px; color: #9ca3af; text-align: right; }
/* Date Tested row — a native date input needs a bit more room than the
   100px value column gives every other row (a plain number/select). */
.oda-pdf-review-row--date { grid-template-columns: 20px 1fr 140px 130px; }

/* Multi-date PDF import review (openPdfImportReviewMultiDate()) — one
   collapsible-looking group per test date found in the PDF, each wrapping
   its own copy of the same .oda-pdf-review-list grid used above. */
.oda-pdf-modal--wide { max-width: 760px; }
.oda-pdf-date-groups { display: flex; flex-direction: column; gap: 14px; }
.oda-pdf-date-group {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
}
.oda-pdf-date-group--blocked { opacity: .6; background: #f9fafb; }
.oda-pdf-date-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}
.oda-pdf-date-head strong { color: #111827; }
.oda-pdf-date-status { color: #6b7280; font-size: 12px; }
.oda-pdf-date-group--blocked .oda-pdf-date-status { color: #b45309; }
.oda-pdf-date-group .oda-pdf-review-list { border-radius: 6px; }

/* Empty state */
.oda-empty-row {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #9ca3af;
    font-size: 14px;
}
.oda-empty-row i { font-size: 22px; display: block; margin-bottom: .5rem; }
.oda-empty-row strong { color: #374151; }

/* ══════════════════════════════════════════════════════════════════════════
   Run report — page 5
   ══════════════════════════════════════════════════════════════════════════ */

.rpt-report {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    color: #111827;
    max-width: 1100px;
}

/* Header */
.rpt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #1d4ed8;
}
.rpt-report-title { font-size: 22px; font-weight: 700; color: #1d4ed8; }
.rpt-report-sub   { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* Sections */
.rpt-section {
    margin-bottom: 2rem;
    break-inside: avoid;
}
.rpt-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #1d4ed8;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 5px;
    margin-bottom: .875rem;
}
.rpt-trend-dir { font-size: 14px; font-weight: 700; text-transform: none; letter-spacing: 0; color: #374151; }

/* Detail grid */
.rpt-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
@media (max-width: 720px) { .rpt-detail-grid { grid-template-columns: 1fr 1fr; } }

.rpt-detail-group {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .875rem 1rem;
}
.rpt-detail-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    margin-bottom: .5rem;
}
.rpt-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 12px;
}
.rpt-detail-row:last-child { border-bottom: none; }
.rpt-detail-row span { color: #6b7280; }
.rpt-detail-row strong { color: #111827; text-align: right; }

/* Tables */
.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: .5rem;
}
.rpt-th {
    padding: 6px 8px;
    background: #f3f4f6;
    border-bottom: 2px solid #d1d5db;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    text-align: left;
    white-space: nowrap;
}
.rpt-th-center { text-align: center; }
.rpt-td {
    padding: 5px 8px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #111827;
}
.rpt-td-cat    { width: 44px; }
.rpt-td-param  { font-weight: 500; white-space: nowrap; }
.rpt-td-val    { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-td-unit   { color: #9ca3af; font-size: 11px; white-space: nowrap; }
.rpt-td-grade  { text-align: center; width: 52px; }
.rpt-td-inf    { color: #374151; font-size: 11px; }
.rpt-td-year-sum { font-size: 12px; }

/* Gas-reference glossary table (Review + Report) — the 3 descriptive
   columns need to wrap, unlike every other .rpt-table which is short
   enough to stay on one line via the base .rpt-th white-space:nowrap. */
.rpt-dga-gasref-table .rpt-th   { white-space: normal; }
.rpt-dga-gasref-table .rpt-td   { vertical-align: top; }
.rpt-td-gasref-gas { font-weight: 600; white-space: nowrap; }

/* IEEE DGA Status reference table (Review + Report) — same wrapping
   need as the gas-reference table above. */
.rpt-dga-status-ref-table .rpt-th { white-space: normal; }
.rpt-dga-status-ref-table .rpt-td { vertical-align: top; }

/* Fault-type reference table (Review + Report) — rowspan'd cells (e.g.
   D2/D1's shared "C, C2H2" and "Very High" severity) read better centered
   within their merged block than pinned to its top edge, unlike the
   top-aligned wrapping tables above. */
.rpt-dga-faultref-table .rpt-td, .rpt-dga-faultref-table .rpt-th { vertical-align: middle; }

/* Row highlight by grade */
.rpt-row-e { background: #fff1f2; }
.rpt-row-d { background: #fff7ed; }

/* Grade badges */
.rpt-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}
.rpt-grade-none { color: #9ca3af; font-size: 11px; }

/* DGA sample status — a colored dot + plain text label, rather than a
   filled badge (matches the same dot+label pattern as the trend chart
   legends below). */
.rpt-status-dot-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}
.rpt-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Index pills */
.rpt-idx {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 20px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 0 5px;
}
.rpt-idx-none { color: #9ca3af; font-size: 11px; }

.rpt-index-note {
    font-size: 11px;
    color: #6b7280;
    margin-top: .375rem;
}

/* OQI badge in year header */
.rpt-oqi-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
}

/* Category badges */
.rpt-cat-core { background: #dbeafe; color: #1e40af; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; }
.rpt-cat-adv  { background: #f3e8ff; color: #6b21a8; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; }

/* Trend SVG */
.rpt-trend-svg { width: 100%; max-width: 520px; display: block; }

/* DGA report trend charts (6-up grid: CO/CO2, CH4/C2H6/C2H4, H2, C2H2,
   plus the CO2/CO and O2/N2 ratio charts) */
.rpt-dga-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: .75rem;
}
.rpt-trend-block {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .75rem .875rem;
    break-inside: avoid;
}
.rpt-trend-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .375rem .75rem;
    margin-bottom: .25rem;
}
.rpt-trend-title { font-size: 13px; font-weight: 700; color: #374151; }
.rpt-trend-legend { display: flex; flex-wrap: wrap; gap: .625rem; }
.rpt-legend-item { display: inline-flex; align-items: center; gap: .3rem; font-size: 10.5px; color: #6b7280; margin: 0 !important; }
.rpt-legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; margin: 0 !important; }
/* Review-only interactive variant (see dgaChartsHTML's opts.interactive in
   app.js) — same look as .rpt-legend-item, but a real checkbox so a gas's
   line can be toggled on/off in that chart. Report/PDF never renders this;
   it stays the static, non-interactive legend above. */
.rpt-legend-toggle { cursor: pointer; user-select: none; }
.rpt-legend-toggle:hover { color: #374151; }
/* The browser's native checkbox renders at very inconsistent sizes across
   browsers/OSes (often much larger than this 10.5px-text legend row) and
   doesn't reliably vertical-center next to text — appearance:none replaces
   it with a small custom box built entirely from this rule, so it always
   matches the .rpt-legend-dot next to it and sits on the same line.
   margin is !important for the same reason as .oda-radio-item elsewhere in
   this file: a site's own combined/optimized theme CSS can carry a broad
   `:last-child { margin-bottom: ... }` rule (confirmed live on one install
   — a WPBakery/Autoptimize page-builder rule matching any last-child
   element inside .wpb_text_column, which this checkbox can end up nested
   in depending on the page) that throws this exact alignment off again.
   Its specificity/load order relative to ours isn't something we control,
   so !important is what makes ours reliably win regardless. */
.rpt-legend-toggle input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    width: 12px; height: 12px; margin: 0 !important; padding: 0; flex-shrink: 0;
    border: 1.5px solid #9ca3af; border-radius: 3px; background: #fff;
    cursor: pointer; position: relative; top: 0;
}
.rpt-legend-toggle input[type="checkbox"]:checked { background: #004fa3; border-color: #004fa3; }
.rpt-legend-toggle input[type="checkbox"]:checked::after {
    content: ''; position: absolute; left: 3px; top: 0.5px;
    width: 3px; height: 6px; border: solid #fff; border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}
.rpt-legend-toggle:has(input:not(:checked)) { color: #d1d5db; }
.rpt-legend-toggle:has(input:not(:checked)) .rpt-legend-dot { opacity: .35; }
/* Full swatch legend under a banded ratio chart (e.g. CO2/CO's ageing
   zones) — a colored rounded-rect swatch per band, plus the usual dot for
   the line series itself. */
.rpt-trend-band-legend { display: flex; flex-wrap: wrap; gap: .375rem .875rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid #f3f4f6; }
.rpt-legend-swatch { width: 12px; height: 9px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.rpt-trend-svg--dga { max-width: 100%; }
.rpt-trend-caption { font-size: 10px; color: #9ca3af; margin: .375rem 0 0; }

/* Oil Quality parameter trend charts (6-up grid: Moisture, BDV, DDF,
   Resistivity, Acidity, IFT) — same block/grid styling as the DGA charts. */
.rpt-param-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: .75rem;
}
.rpt-trend-svg--param { max-width: 100%; }

@media (max-width: 640px) {
    .rpt-dga-charts,
    .rpt-param-charts { grid-template-columns: 1fr; }
}

/* Year blocks */
.rpt-year-block {
    margin-bottom: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    break-inside: avoid;
}
.rpt-year-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .625rem 1rem;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}
.rpt-year-title { font-size: 15px; font-weight: 700; }
.rpt-year-meta  { font-size: 11px; color: #6b7280; }
.rpt-no-data { padding: 1rem; color: #9ca3af; font-style: italic; margin: 0; }

.rpt-section--ref { page-break-before: always; }

/* Disclaimer — muted, smaller-print legal/technical boilerplate at the
   end of the report. */
.rpt-disclaimer-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 11px;
    line-height: 1.5;
    color: #6b7280;
}
.rpt-disclaimer-list li { margin-bottom: .5rem; }
.rpt-disclaimer-list li:last-child { margin-bottom: 0; }

.rpt-end-of-report {
    text-align: center;
    font-style: italic;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 1.5rem;
    padding-top: .75rem;
    border-top: 1px solid #e5e7eb;
}

/* ── Print styles ─────────────────────────────────────────────────────── */
@media print {
    @page { margin: 15mm 12mm; size: A4 portrait; }

    body { font-size: 11px; }

    /* Hide everything except the report */
    .oda-stepper,
    .oda-ot-legend,
    .oda-actions,
    .no-print { display: none !important; }

    #oil-app { margin: 0; padding: 0; max-width: 100%; }

    .rpt-report { max-width: 100%; }

    .rpt-header { border-bottom-color: #000; }
    .rpt-report-title { font-size: 18px; }
    .rpt-print-btn { display: none; }

    .rpt-section { break-inside: avoid; margin-bottom: 14pt; }
    .rpt-section-title { font-size: 10pt; color: #000; border-bottom-color: #000; }

    .rpt-table { font-size: 9pt; }
    .rpt-th { background: #e5e7eb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    .rpt-row-e, .rpt-row-d { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rpt-grade, .rpt-idx, .rpt-oqi-badge, .rpt-status-dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    .rpt-year-block { break-inside: avoid; }
    .rpt-year-header { background: #f3f4f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    .rpt-detail-group { background: #f9fafb !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    /* Portrait's printable width is too narrow for 3 equal detail-group
       columns without heavy text wrapping — 2 columns (same call as the
       PDF's Asset & Organization Details layout) reads much better. */
    .rpt-detail-grid { grid-template-columns: 1fr 1fr; }

    .rpt-trend-svg { max-width: 420px; }

    .rpt-end-of-report { margin-top: 12pt; padding-top: 8pt; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Grade inference reference panel — page 3
   ══════════════════════════════════════════════════════════════════════════ */

.oda-inf-details {
    margin-top: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.oda-inf-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .875rem 1rem;
    background: #f3f4f6;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.oda-inf-summary::-webkit-details-marker { display: none; }
.oda-inf-summary i { font-size: 16px; color: #004fa3; }
.oda-inf-summary::after {
    content: '▸';
    margin-left: auto;
    font-size: 12px;
    color: #6b7280;
    transition: transform .2s;
}
details[open] .oda-inf-summary::after { transform: rotate(90deg); }
.oda-inf-summary-hint {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}

/* Grid of parameter cards */
.oda-inf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}

/* Individual parameter card */
.oda-inf-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    font-size: 12px;
}

.oda-inf-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #eef2ff;
    border-bottom: 1px solid #e5e7eb;
}

.oda-inf-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e40af;
}

.oda-inf-card-unit {
    font-size: 11px;
    color: #6b7280;
    margin-left: auto;
}

/* Inference table inside card */
.oda-inf-table {
    width: 100%;
    border-collapse: collapse;
}

.oda-inf-row:nth-child(even) .oda-inf-text {
    background: #f9fafb;
}

.oda-inf-grade {
    width: 28px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 4px;
    vertical-align: top;
}

.oda-inf-text {
    padding: 5px 8px;
    color: #374151;
    font-size: 11px;
    line-height: 1.45;
    vertical-align: top;
    border-bottom: 1px solid #f3f4f6;
}

.oda-inf-row:last-child .oda-inf-text {
    border-bottom: none;
}

/* ── Threshold column in inference cards ─────────────────────────────── */
.oda-inf-th {
    padding: 4px 8px;
    background: #f3f4f6;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}
.oda-inf-th:first-child { width: 28px; text-align: center; }
.oda-inf-th:nth-child(2) { width: 90px; }

.oda-inf-threshold {
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #1e40af;
    vertical-align: top;
    white-space: nowrap;
    border-bottom: 1px solid #f3f4f6;
    min-width: 80px;
}
.oda-inf-unit {
    font-weight: 400;
    color: #6b7280;
    font-size: 10px;
}

/* Corrosive Sulphur select inside grid cell */
.oda-val-select {
    width: 66px;
    height: 26px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #f9fafb;
    font-size: 11px;
    color: #111827;
    padding: 0 18px 0 5px;
    outline: none;
    flex-shrink: 0;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-color: #f9fafb;
    cursor: pointer;
}
.oda-val-select:focus {
    border-color: #004fa3;
    background-color: #fff;
    box-shadow: 0 0 0 2px #dbeafe;
}
.oda-val-select:disabled {
    background-color: #004fa3;
    border-color: #004fa3;
    color: #004fa3;
    cursor: not-allowed;
}

/* Consent checkbox error state */
#f-consent.oda-has-err .oda-checkbox-row {
    border: 1px solid #dc2626;
    background: #fef2f2;
}
#f-consent .oda-err-msg {
    display: none;
}
#f-consent.oda-has-err .oda-err-msg {
    display: block;
}
