/* The Overview in compare mode (overview-compare.js), with its screen-size layouts. It fills the
   viewport. Top: how far along each SIPOC part is (parts × levels). Bottom: the change set beside
   what moved the selected part. Nothing scrolls inside a card; lists trim to fit. */
#view-overview.is-compare{display:flex;flex-direction:column}
.ov-compare{display:grid;grid-template-rows:auto auto;align-content:start;gap:var(--gap-card)}
.ov-compare[hidden]{display:none}
.ov-compare .kicker{margin:0 0 var(--space-1);font-size:var(--t-label)}
.ov-compare h3{margin:0;font-size:var(--t-title)}
.ov-compare .sub{margin:var(--space-1) 0 0;font-size:var(--t-label)}

/* How far along: one bar per part split at the system line (left: manual, hybrid, not rated;
   right: system, automated). Each side of the track is 0–100% of the part. */
.ovg-head{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-1) var(--space-4);flex-wrap:wrap;margin-bottom:var(--space-2)}
.ovg-key{margin:0;display:flex;flex-wrap:wrap;gap:var(--space-1) var(--space-3);font-size:var(--t-meta)}
.sx-key-from{display:inline-block;width:1rem;height:4px;border-radius:var(--radius-xs);background:var(--ink-2);opacity:.5}
.sx{display:grid;grid-template-columns:minmax(9rem,12rem) minmax(0,1fr) minmax(9rem,11rem);row-gap:2px;font-size:var(--t-label)}
.sx-row{display:contents}
.sx-row > *{min-width:0;padding:calc(0.3125rem * var(--dz)) var(--space-2);border-radius:var(--radius-xs)}
.sx-part,.sx-fig{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;border-radius:var(--control-radius)}
.sx-row > .sx-part{gap:var(--space-2)}
.sx-name{font-weight:var(--fw-semibold);color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sx-row > .sx-fig{gap:var(--space-2);justify-content:flex-end;font-variant-numeric:tabular-nums;white-space:nowrap}
.sx-fig b{font-size:var(--t-body);font-weight:var(--fw-heavy)}
.sx-fig .db-delta{font-weight:var(--fw-bold);font-size:var(--t-meta)}
.sx-fig small{font-size:var(--t-meta)}
.sx-row.is-sel > *{background:var(--accent-wash)}
.sx-row.is-sel > .sx-part{box-shadow:inset 0 0 0 1px var(--accent)}
.sx-part:hover,.sx-fig:hover{background:var(--grid)}
/* Axis */
.sx-axis > *{padding-top:0;padding-bottom:var(--space-1);color:var(--muted);font-size:var(--t-meta)}
.sx-scale{display:flex;justify-content:space-between;align-items:baseline}
.sx-mid{color:var(--ink-2);font-weight:var(--fw-semibold)}
.sx-mid b{color:var(--ink)}
.sx-fig-h{text-align:right;font-weight:var(--fw-semibold)}
/* The bars */
.sx-bars{display:flex;flex-direction:column;justify-content:center;gap:3px;position:relative}
.sx-bars::after{content:"";position:absolute;left:50%;top:0;bottom:0;width:2px;margin-left:-1px;background:var(--ink)}
.sx-bar{position:relative;display:block;box-shadow:inset 0 0 0 1px var(--grid);border-radius:var(--radius-xs)}
.sx-from{height:6px;opacity:.55}
.sx-now{height:16px}
.sx-l,.sx-r{position:absolute;top:0;bottom:0;display:flex;width:50%}
.sx-l{right:50%;flex-direction:row-reverse}
.sx-r{left:50%}
.sx-seg{display:block;height:100%;min-width:0}
.sx-seg:hover{filter:brightness(1.12)}
.sx-seg + .sx-seg{box-shadow:inset 1px 0 0 var(--surface)}
.sx-l .sx-seg + .sx-seg{box-shadow:inset -1px 0 0 var(--surface)}

/* Bottom: three cards side by side, each a title then one line of the same height (a note, the
   count, or the group-by switch), so their contents start level. */
.ov-bottom{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--gap-card);align-items:stretch}
.ov-card{display:flex;flex-direction:column;min-width:0}
.ovc-sub{margin:var(--space-1) 0 var(--space-2);min-height:var(--ctl-h);display:flex;align-items:center;flex-wrap:wrap;white-space:pre-wrap;font-size:var(--t-meta)}
.ovc-sub .tool-view{margin:0}
.ovc-sub a{margin-left:var(--space-2)}
.ovc-n{font-size:var(--t-body);font-weight:var(--fw-heavy);color:var(--ink)}
.ovc-types{margin:0 0 var(--space-3);display:flex;flex-wrap:wrap;gap:var(--space-1) var(--space-3)}
.ovc-type{display:inline-flex;align-items:center;gap:var(--space-1);white-space:nowrap;font-variant-numeric:tabular-nums}
.ov-card h4{margin:0 0 var(--space-1);font-size:var(--t-label);font-weight:var(--fw-bold);color:var(--ink)}
.ov-card h4 .muted{font-weight:var(--fw-regular);font-size:var(--t-meta);margin-left:var(--space-1)}
.ovc-regs{display:flex;flex-direction:column;gap:calc(0.1875rem * var(--dz))}
.ovc-reg{display:grid;grid-template-columns:minmax(5rem,7rem) minmax(2rem,1fr) auto;gap:var(--space-2);align-items:center;font-size:var(--t-label);text-decoration:none;color:var(--ink);padding:calc(0.125rem * var(--dz)) var(--space-1);border-radius:var(--radius-xs)}
.ovc-rn{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ovc-more{margin:0;font-size:var(--t-meta)}
.ov-card .bridge{grid-template-columns:minmax(4rem,8rem) minmax(2rem,1fr) auto;gap:calc(0.25rem * var(--dz)) var(--space-2);font-size:var(--t-label)}
.ov-card .br-track{height:10px}
.top-changes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2)}
.top-changes .hist-item{display:flex;flex-direction:column;align-items:flex-start;gap:calc(0.125rem * var(--dz));padding:var(--space-1) var(--space-2);font-size:var(--t-label)}
.tc-head{display:flex;align-items:center;gap:var(--space-2)}
.top-changes .hsum{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--ink-2)}

/* Short or narrow windows: the page scrolls; nothing inside a card is ever clipped. */
@media (max-height:40em),(max-width:64em){
  #view-overview.is-compare{height:auto}
}
@media (max-width:64em){
  .ov-bottom{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ov-bottom > :first-child{grid-column:1 / -1}
}
@media (max-width:40em){
  .ov-bottom{grid-template-columns:1fr}
  .sx{grid-template-columns:minmax(0,1fr) auto;grid-auto-flow:row dense}
  .sx-row > .sx-bars{grid-column:1 / -1;padding-top:0;margin-bottom:var(--space-2)}
  .sx-axis > :first-child,.sx-fig-h{display:none}
  .sx-axis > .sx-scale{grid-column:1 / -1}
  .sx-axis .sx-scale span:not(.sx-mid){display:none}
  .sx-axis .sx-scale{justify-content:center}
  .sx-fig small{display:none}
}
