/* ============================================================================
   Multi-Arch Release tab — sticky-col positioning + workflow column widths
   ============================================================================
   The Multi-Arch Release table reuses Release History's `.release-history-table`
   class for the separate-borders + sticky-col bleed-through fixes, but it has
   only TWO sticky cols (ROCm Version + Commit) instead of Release History's
   FOUR (Version + Date + Time + Commit). Without these overrides, `col-time`
   inherits the `left: 360px !important` rule from `.release-history-table`
   (which assumes 80+60+220px of preceding sticky cols) and ends up floating
   far to the right, overlapping workflow columns. We:

   1. Pin col-sha at left:0 with width 130px (room for `7.13.0a20260514`)
   2. Pin col-time at left:130px with width 90px (room for 8-char commit hash)
   3. Give non-perArch workflow columns (Multiarch Build/Test) min-width so
      the long header label (`Multiarch — Build`) doesn't get crushed to the
      cat-badge width. Mathlib columns auto-size when collapsed (badge-width)
      and expand to N×34px arch cells when opened. */
/* ROCm version + run-number suffix + ↗ link must all stay on a SINGLE
   line — wrapping bloats every body row by an extra ~18px. Widened
   from 130px → 195px so `7.13.0a20260518 #35 ↗` (the longest realistic
   payload: 15-char synthesized version + 4-char #N + 2-char arrow at
   monospace) fits without overflowing or wrapping. */
.multi-arch-release-table thead th.col-sha,
.multi-arch-release-table tbody td.col-sha {
    width: 195px !important;
    min-width: 195px !important;
    white-space: nowrap !important;
}
.multi-arch-release-table thead th.col-time,
.multi-arch-release-table tbody td.col-time {
    left: 195px !important; /* directly after the widened col-sha */
    width: 90px !important;
    min-width: 90px !important;
    white-space: nowrap !important;
}

/* ── Stage-wise column layout (11 stages × Build+Test = 22 columns) ───────
   Each cat-header is rendered as a 2-line label ("Stage" on top, "Build"
   or "Test" on the bottom) using inline spans. Layout aims to:

   • Keep each non-perArch column compact (~85px) so all 22 fit without
     extreme horizontal scroll. perArch (Math-Libs) columns auto-size:
     ~85px when collapsed, ~85 + N×34px when expanded into per-arch dots.

   • Visually pair Build + Test of the same stage. Cells with the same
     `data-mar-stage` get a SHARED background tint (alternating soft
     palette across stages) plus a thicker left-border on the Build column
     to mark the start of each stage group. Tests within a stage get NO
     left border so the pair reads as one block.

   • Phase indicator: a tiny "BUILD" / "TEST" sub-label below the stage
     name, in muted color so the dominant visual is the stage name (the
     thing users care about at a glance). */
#multi-arch-release-tab th.rh-cat-header {
    /* 2-line label: OS prefix ("LINUX" / "WINDOWS") on top, stage name
       below. white-space:normal lets the inline-span layout flow naturally
       without overflowing the column. */
    white-space: normal;
    line-height: 1.15;
    padding: 6px 6px;
    /* 26 columns at 90px = ~2340px workflow width, plus ~330px for sticky
       cols + Downloads = ~2670px — fits horizontal-scroll. Bumped from 80
       to 90 to give "WINDOWS" + "Compiler-Runtime" comfortable room. */
    min-width: 90px;
    width: 90px;
}
#multi-arch-release-tab th.rh-cat-header .mar-stage-os {
    /* "LINUX" / "WINDOWS" tag at the top of each header — sits above the
       stage name in a smaller / lighter style, color-coded per OS for
       at-a-glance OS recognition. */
    display: block;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 2px;
}
#multi-arch-release-tab th.rh-cat-header .mar-stage-name {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.15;
}
/* `is-empty` here means "non-expandable by design" (most non-perArch
   columns). Don't fade them — their data IS meaningful. */
#multi-arch-release-tab th.rh-cat-header.is-empty {
    opacity: 1;
    cursor: default;
}
/* (removed) The old inline `.cat-expand-icon` chevron on workflow
   headers was replaced by the unified `.col-expand-pill` defined at
   the top of this file. Pill is pinned to the bottom-center of the
   header via the `.mar-wf-drillable` host class. */

/* ── CI-HUD-style multi-row header ────────────────────────────────────
   When a workflow column is expanded, its arch sub-columns now appear
   in a SECOND header row directly beneath the workflow header (instead
   of inline to the right). When an arch is further drilled into per-
   test-components, those appear in a THIRD header row.

   The sub-rows use a slightly stronger top-border + a small left-pad
   bump on the first cell of each lane so the visual grouping under
   each workflow header is unambiguous. */
#multi-arch-release-tab tr.mar-sub-row > th,
#multi-arch-release-tab tr.mar-subsub-row > th,
#multi-arch-release-tab tr.rh-sub-row > th,
#multi-arch-release-tab tr.rh-subsub-row > th {
    border-top: 1px solid rgba(99, 102, 241, 0.18);
}
/* Drilled-arch header in the row-2 strip gets a stronger bottom border
   so the user reads it as a SUB-GROUP HEAD that has component cells
   sitting under it in row 3. */
#multi-arch-release-tab tr.mar-sub-row > th.rh-arch-drilled,
#multi-arch-release-tab tr.rh-sub-row > th.rh-arch-drilled {
    border-bottom: 2px solid var(--accent-light, #818cf8) !important;
}
/* Make the sub-rows visually slightly recessed compared to the row-1
   workflow headers — same chrome, just a hair darker, so the layered
   hierarchy is obvious without being noisy. */
#multi-arch-release-tab tr.mar-sub-row,
#multi-arch-release-tab tr.rh-sub-row,
#multi-arch-release-tab tr.mar-subsub-row,
#multi-arch-release-tab tr.rh-subsub-row {
    background: rgba(0, 0, 0, 0.10);
}
[data-theme="light"] #multi-arch-release-tab tr.mar-sub-row,
[data-theme="light"] #multi-arch-release-tab tr.rh-sub-row,
[data-theme="light"] #multi-arch-release-tab tr.mar-subsub-row,
[data-theme="light"] #multi-arch-release-tab tr.rh-subsub-row {
    background: rgba(99, 102, 241, 0.04);
}

/* ── Lane-boundary borders ─────────────────────────────────────────────
   Each lane (Setup / Linux Build / Linux Pkg / Linux Publish / Linux
   Tests / Linux Wheels / Windows Build / Windows Pkg / Windows Publish /
   Windows Tests / Windows Wheels) starts at the column carrying
   `data-mar-lane-start="true"`. A thicker 2px primary-tinted border on
   that boundary visually segments the 26-column strip into 11 lanes.
   Body cells inherit the same boundary attribute via the renderer. */
#multi-arch-release-tab th[data-mar-lane-start="true"],
#multi-arch-release-tab td[data-mar-lane-start="true"] {
    border-left: 2px solid rgba(99, 102, 241, 0.55) !important;
}

/* ── Lane group row (Row 0) ────────────────────────────────────────────
   Top-most header row showing per-lane group cells. Each cell spans
   over its lane's visible body cols and (when the lane has >=2 wfs)
   exposes a chevron pill that toggles the lane between collapsed and
   expanded. Collapsed lanes show a single summary cell below; expanded
   lanes show the per-stage columns we always had. */
#multi-arch-release-tab thead tr.mar-lane-row > th {
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
    background-color: rgba(99, 102, 241, 0.04);
    border-bottom: 1px solid rgba(99, 102, 241, 0.18);
    position: relative;
}
/* Sticky cells (ROCm Version, Commit) live in this lane row via
   rowspan so their pinning extends through every header row. The
   lane-row blanket `position: relative` rule above would otherwise
   override `.ci-hud-table thead th.sticky-col { position: sticky }`
   (higher specificity wins) — combined with the existing
   `.col-time { left: 195px }` that's intended as the STICKY pin
   offset, it shifts Commit 195px to the right of its natural position
   and breaks the entire row's horizontal layout. Restore `sticky`
   for sticky cells in the lane row so `left:0` / `left:195px` go
   back to being pin offsets, not relative-position offsets. */
#multi-arch-release-tab thead tr.mar-lane-row > th.sticky-col {
    position: sticky;
}
#multi-arch-release-tab th.mar-lane-group,
#multi-arch-release-tab th.mar-lane-group-fixed {
    cursor: pointer;
    user-select: none;
    transition: background-color 120ms ease, color 120ms ease;
    /* Center the group label+chevron over its (often wide) column span so
       "LINUX BUILD" / "LINUX PACKAGING" sit over their columns instead of
       hugging the far-left edge of the span. */
    text-align: center;
}
#multi-arch-release-tab th.mar-lane-group:hover {
    background-color: rgba(99, 102, 241, 0.10);
    color: var(--text-primary, #e5e7eb);
}
#multi-arch-release-tab th.mar-lane-group.collapsed {
    /* Slightly more saturated tint when collapsed so the eye notices
       there's a hidden group waiting to be opened. */
    background-color: rgba(99, 102, 241, 0.09);
    color: var(--text-primary, #e5e7eb);
}
#multi-arch-release-tab th.mar-lane-group-fixed {
    /* Single-col lanes — no chevron, no hover affordance (nothing to
       toggle). Keeps the label visible without implying interactivity. */
    cursor: default;
    color: var(--text-muted, #9ca3af);
}
#multi-arch-release-tab th.mar-lane-group .mar-lane-group-label {
    display: inline-block;
    vertical-align: middle;
}
#multi-arch-release-tab th.mar-lane-group .col-expand-pill {
    margin-left: 6px;
    vertical-align: middle;
    /* Always visible on lane group headers (unlike per-column pills
       which fade in on hover) — the user shouldn't have to hover to
       discover the lane group can be toggled. */
    opacity: 0.85;
}
#multi-arch-release-tab th.mar-lane-group:hover .col-expand-pill {
    opacity: 1;
}

/* Lane-summary HEADER cell (Row 1, when the lane is collapsed). Looks
   like a normal workflow header but spans rowspan=bottomRows and shows
   the lane label + stage count. */
#multi-arch-release-tab th.mar-lane-summary-header {
    cursor: pointer;
    text-align: center;
    background-color: rgba(99, 102, 241, 0.05);
}
#multi-arch-release-tab th.mar-lane-summary-header:hover {
    background-color: rgba(99, 102, 241, 0.12);
}

/* Stage-count label inside the collapsed lane-summary header.
   No longer paired with a duplicate lane-name `<span>` (the Row 0 lane
   group already carries the title), so center the single line on its
   own and de-emphasize a bit so it doesn't compete with the chevron
   above. */
#multi-arch-release-tab th.mar-lane-summary-header .mar-lane-stage-count {
    display: block;
    text-align: center;
    font-weight: 500;
    opacity: 0.65;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

/* Lane-summary BODY cell — single aggregate "passed/total" badge for a
   collapsed lane. Lives in a single col so the row stays compact even
   when the underlying lane has 11 stages. The badge uses the SAME
   .cat-pass / .cat-fail / .cat-run sizing as the other "M/N" columns
   (e.g. test-artifacts 242/369) so a collapsed lane reads consistently
   with its expanded siblings. */
#multi-arch-release-tab td.mar-lane-summary {
    text-align: center;
    background-color: rgba(99, 102, 241, 0.04);
}

/* ── Per-LANE body tint ────────────────────────────────────────────────
   11 distinct soft palettes — each lane (Setup, Linux Build, Linux Pkg,
   Linux Publish, Linux Tests, Linux Wheels, Windows Build, Windows Pkg,
   Windows Publish, Windows Tests, Windows Wheels) gets its own subtle
   background. Tests, Build, and Wheels for the SAME OS share related
   hue families (cool blues for Linux, warmer reds/oranges for Windows)
   so the eye groups them. */
#multi-arch-release-tab tbody td[data-mar-lane="setup"]          { background-color: rgba(148, 163, 184, 0.05); }
/* Linux family — cool blues + greens */
#multi-arch-release-tab tbody td[data-mar-lane="linuxBuild"]     { background-color: rgba(56, 189, 248, 0.04); }
#multi-arch-release-tab tbody td[data-mar-lane="linuxPkg"]       { background-color: rgba(34, 197, 94, 0.04); }
#multi-arch-release-tab tbody td[data-mar-lane="linuxPublish"]   { background-color: rgba(20, 184, 166, 0.06); }
#multi-arch-release-tab tbody td[data-mar-lane="linuxNativeTests"] { background-color: rgba(34, 211, 238, 0.05); }
#multi-arch-release-tab tbody td[data-mar-lane="linuxTests"]     { background-color: rgba(132, 204, 22, 0.05); }
#multi-arch-release-tab tbody td[data-mar-lane="linuxWheels"]    { background-color: rgba(168, 85, 247, 0.06); }
#multi-arch-release-tab tbody td[data-mar-lane="linuxPytorchTests"]   { background-color: rgba(217, 70, 239, 0.06); }
#multi-arch-release-tab tbody td[data-mar-lane="linuxPytorchFullTest"] { background-color: rgba(190, 24, 93, 0.06); }
#multi-arch-release-tab tbody td[data-mar-lane="linuxJaxWheels"] { background-color: rgba(16, 185, 129, 0.07); }
/* Windows family — warmer ambers + reds */
#multi-arch-release-tab tbody td[data-mar-lane="windowsBuild"]   { background-color: rgba(251, 146, 60, 0.04); }
#multi-arch-release-tab tbody td[data-mar-lane="windowsPkg"]     { background-color: rgba(244, 114, 182, 0.04); }
#multi-arch-release-tab tbody td[data-mar-lane="windowsPublish"] { background-color: rgba(251, 191, 36, 0.06); }
#multi-arch-release-tab tbody td[data-mar-lane="windowsTests"]   { background-color: rgba(239, 68, 68, 0.04); }
#multi-arch-release-tab tbody td[data-mar-lane="windowsWheels"]  { background-color: rgba(96, 165, 250, 0.06); }
#multi-arch-release-tab tbody td[data-mar-lane="windowsPytorchTests"] { background-color: rgba(129, 140, 248, 0.06); }

/* Per-arch / wheels-matrix expanded child cells get a slightly stronger
   tint so the "drilled" strip stands out as the focal group. */
#multi-arch-release-tab tbody td[data-mar-stage="linMathLibs"].rh-grp-child,
#multi-arch-release-tab tbody td[data-mar-stage="winMathLibs"].rh-grp-child {
    background-color: rgba(56, 189, 248, 0.08);
}
#multi-arch-release-tab tbody td[data-mar-stage="linTests"].rh-grp-child,
#multi-arch-release-tab tbody td[data-mar-stage="winTests"].rh-grp-child {
    background-color: rgba(132, 204, 22, 0.08);
}
#multi-arch-release-tab tbody td[data-mar-stage="linWheels"].rh-grp-child,
#multi-arch-release-tab tbody td[data-mar-stage="winWheels"].rh-grp-child {
    background-color: rgba(168, 85, 247, 0.10);
}

/* OS chip color in the cat-header `mar-stage-os` block — Linux gets
   teal-ish, Windows gets amber, Setup keeps default muted gray. */
#multi-arch-release-tab th[data-mar-lane^="linux"] .mar-stage-os    { color: rgb(56, 189, 248); }
#multi-arch-release-tab th[data-mar-lane^="windows"] .mar-stage-os  { color: rgb(251, 146, 60); }

/* Downloads cell at the far right — give the column header room for the
   "DOWNLOADS" label so it doesn't wrap. */
#multi-arch-release-tab .ci-hud-table thead th.col-cat:last-child,
#multi-arch-release-tab .ci-hud-table tbody td.col-cat:last-child {
    min-width: 130px;
    border-left: 2px solid rgba(99, 102, 241, 0.45) !important;
    text-align: center;
}

/* The Downloads button on the Multi-Arch tab uses the `rh-download-btn`
   class (carried over from the removed Release History tab, issue #60).
   These rules give it the pill styling — without them the button would
   render as a plain unstyled browser button. */
#multi-arch-release-tab .rh-download-btn.cat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 0.74rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.14);
    color: var(--accent-light, #818cf8);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
#multi-arch-release-tab .rh-download-btn.cat-badge:hover {
    background: rgba(99, 102, 241, 0.26);
    border-color: rgba(99, 102, 241, 0.55);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}
#multi-arch-release-tab .rh-download-btn.cat-badge:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.2);
}
[data-theme="light"] #multi-arch-release-tab .rh-download-btn.cat-badge {
    background: rgba(99, 102, 241, 0.10);
    color: #4f46e5;
}
[data-theme="light"] #multi-arch-release-tab .rh-download-btn.cat-badge:hover {
    background: rgba(99, 102, 241, 0.22);
    color: #fff;
}

/* Icon-only cat-badge for non-expandable workflow cells. The default
   `.cat-badge` is sized for "M/N" text (~32px wide, padding for digits);
   the icon variant is squarer, slightly smaller, and centered cleanly.
   Color comes from the standard cat-pass/cat-fail/cat-run classes. */
#multi-arch-release-tab .cat-badge.mar-status-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
}

/* Make the day-row visibly clickable. The whole TR opens the tree-view
   sidebar; the Downloads button intercepts via stopPropagation. */
#multi-arch-release-tab .ci-hud-table tbody tr.ci-hud-row {
    cursor: pointer;
}
#multi-arch-release-tab .ci-hud-table tbody tr.ci-hud-row:hover td.sticky-col {
    box-shadow: inset 4px 0 0 var(--primary, #6366f1);
}
