:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #23262b;
  --muted: #6b7078;
  --line: #e6e5df;
  --accent: #3f6f8f;

  --wont_fix: #8b6bb8;
  --fix_incomplete: #c9793b;
  --no_fix: #b6334a;
  --workaround_only: #a9842a;
  --unconfirmed: #2f6fab;
  --fix_available: #2e8a5c;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 30, 25, 0.04), 0 4px 16px rgba(30, 30, 25, 0.04);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
a { color: var(--accent); }
code { background: #efeee9; padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.top-inner { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 26px 16px; flex-wrap: wrap; }
.sub { margin: 4px 0 0; color: var(--muted); font-style: italic; font-size: calc(1em + 2pt); }
.top-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; }

.btn { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.btn:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: var(--accent); color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.btn.dark { font-size: 13px; background: var(--muted); border-color: var(--muted); color: #fff; }
.btn.dark:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
/* Same colors as their matching donut piece: the total ring, the pink "no complete fix"
   wedge, and the light-green "attacked, fix exists" share of the fix_available wedge. */
.card[data-metric="total"] { background: #e8c53a; }
.card[data-metric="loose"] { background: color-mix(in srgb, var(--no_fix) 55%, white); }
.card[data-metric="attackedFixed"] { background: color-mix(in srgb, var(--fix_available) 40%, white); }
.card .num { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.card .label { color: var(--muted); font-size: 14px; }
.card.clickable .label { margin-top: auto; }
.card.alert .num { color: var(--no_fix); }
.card.clickable { font: inherit; text-align: left; color: inherit; display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-start; border: 0; width: 100%;
  cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }
.card.clickable.alert { border: 5px solid var(--no_fix); }
.card.clickable .label::after { content: " →"; color: var(--accent); }
.card.clickable:hover { filter: brightness(1.05) saturate(1.08); box-shadow: 0 2px 4px rgba(30, 30, 25, 0.06), 0 8px 24px rgba(30, 30, 25, 0.08); }
.card.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The reference screenshot's font is Adobe Clean (Adobe's own house typeface, not publicly
   licensed) - "Source Sans 3" is the closest freely available match, since Adobe Clean is
   itself based on Source Sans. Scoped to this popup specifically, per request, not site-wide. */
.methodology { max-width: 560px; width: calc(100% - 32px); border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px 26px; font-family: "Source Sans 3", "Source Sans Pro",
  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.methodology::backdrop { background: rgba(20, 20, 18, 0.35); }
/* The whole header strip is the drag handle, not just the title text tightly - a wider,
   more forgiving grab area, like a real window's title bar, while the body below stays
   normal (selectable text, clickable links) instead of also being draggable. */
.methodology-head { margin-bottom: 14px; padding: 6px 28px 10px 0; cursor: grab; user-select: none; }
.methodology-head:active { cursor: grabbing; }
.methodology h2 { font-weight: 700; }
.methodology h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  margin: 14px 0 6px; }
.methodology p, .methodology li { font-size: 14px; }
.methodology ul { margin: 0; padding-left: 18px; }
.methodology-close { position: absolute; top: 14px; right: 14px; padding: 4px 10px; }

.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 20px; }
/* The donut's transform shifts its painted position without enlarging its own box (see
   .donut-svg below), and .status-donut's position:relative puts it in a stacking context that
   paints above later, non-positioned siblings regardless of DOM order - so without this, the
   SVG's own bounding box (994x~635px, even the empty parts, which still intercept clicks)
   visually overlapped and blocked the next panel's filter dropdowns. The ring itself has 72px
   of clearance before this panel's own edge (see #170), so clipping here doesn't cut it off. */
#fixStatusPanel { overflow: hidden; }
.panel h2 { margin-bottom: 14px; }
.since-when { font-size: 13px; font-weight: 400; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.empty { text-align: center; padding: 48px 24px; }

.changes { display: flex; flex-wrap: wrap; gap: 8px; }
.change { flex: 1 1 165px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; min-width: 165px; }
.change b { font-size: 20px; display: block; }
.change span { color: var(--muted); font-size: calc(12.5px + 2pt); white-space: nowrap; }
.change.bad b { color: var(--no_fix); }
.change.good b { color: var(--fix_available); }
button.change { font: inherit; text-align: left; color: inherit; display: block; }
.change.clickable { cursor: pointer; background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s; }
.change.clickable:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-color: var(--accent); box-shadow: var(--shadow); }
.change.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.change.clickable span::after { content: " →"; color: var(--accent); }

.change-note { margin: 16px 0 0; font-size: 14px; }
.change-note[hidden] { display: none; }
.change-note-head { display: flex; align-items: center; gap: 10px; }
.change-note .list { margin-top: 12px; }
.change-note .list[hidden] { display: none; }
.btn.small { padding: 4px 12px; font-size: 13px; }

.statusbar-summary { margin: 0 0 12px; font-size: 14px; color: var(--muted); max-width: 72ch; }
.statusbar-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.donut-total-label, .donut-hotfix-label { padding: 1px 0; border-radius: 4px; transition: background-color 0.15s; }
.donut-total-label:hover, .donut-total-label.lit, .donut-total-label.pinned { background: #e8c53a; }
.donut-hotfix-label:hover, .donut-hotfix-label.lit { background: color-mix(in srgb, var(--fix_available) 40%, white); }
.donut-quietfix-label { padding-bottom: 2px; border-bottom: 3px solid transparent; transition: border-color 0.15s; }
.donut-quietfix-label:hover, .donut-quietfix-label.lit { border-bottom-color: var(--fix_available); }
/* Same small highlight treatment as the labels above - background only shows on hover or
   while pinned, not permanently. Hovering/clicking this text, the pink wedge, or the "845
   have loose ends..." summary card all drive the same shared highlight (see setLoosePinned
   and the hover listeners on .card[data-metric="loose"] in app.js). */
.donut-loose-label { display: inline; padding: 1px 0; border-radius: 4px; border: 0; background: none;
  font: inherit; color: inherit; margin: 0; cursor: pointer; transition: background-color 0.15s; }
.donut-loose-label:hover, .donut-loose-label.lit, .donut-loose-label.pinned {
  background: color-mix(in srgb, var(--no_fix) 55%, white); }
.donut-loose-label:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Red underline (the same red as the "151 confirmed actively exploited..." card's frame)
   on hover or while pinned by a click on that card. */
.donut-attackedloose-label { padding-bottom: 2px; border-bottom: 3px solid transparent; transition: border-color 0.15s; }
.donut-attackedloose-label:hover, .donut-attackedloose-label.lit, .donut-attackedloose-label.pinned {
  border-bottom-color: var(--no_fix); }

.status-donut { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
/* Custom replacement for the donut's native <title> tooltips - bigger text in a bigger
   bubble, and much quicker to show than the browser's own hover-delay + fade. Follows the
   cursor (position: fixed + clientX/clientY in app.js) so it works at any scroll position. */
.donut-tooltip { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 50; max-width: 280px;
  background: var(--ink); color: #fff; font-size: 16px; line-height: 1.35; font-variant-numeric: tabular-nums;
  padding: 10px 14px; border-radius: 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 0; transform: translateY(4px); transition: opacity 0.08s ease, transform 0.08s ease; }
.donut-tooltip.show { opacity: 1; transform: translateY(0); }
/* Ring diameter is 2*R_OUT=252 viewBox units, which render 1:1 at this max-width (720px) -
   994px keeps that ratio and adds exactly 96px (1in at the standard 96px/in) to the diameter. */
/* Shifted 2.85in (273.6px) left from its centered position, per request. */
/* The downward shift (and the matching margin-bottom that reserves space for it - a
   transform moves painted pixels, not the layout box) is deliberately less than the max
   994px width would allow, to keep the empty space below the ring small. */
.donut-svg { width: 100%; max-width: 994px; height: auto; display: block; transform: translate(-273.6px, 168px); margin-bottom: 70.3px; }
.donut-seg { cursor: pointer; transition: opacity 0.15s, filter 0.15s; }
.donut-seg.off { opacity: 0.25; }
.donut-seg[data-s="fix_available"][data-tone="hot"]:hover,
#statusChart.hotfix-lit .donut-seg[data-s="fix_available"][data-tone="hot"] { filter: saturate(1.7) brightness(0.95); }
.donut-seg[data-s="fix_available"][data-tone="quiet"]:hover,
#statusChart.quietfix-lit .donut-seg[data-s="fix_available"][data-tone="quiet"] { filter: saturate(1.5) brightness(1.1); }
.donut-total-ring { stroke: #e8c53a; stroke-width: 15; transition: stroke 0.15s, filter 0.15s; cursor: default; }
.donut-total-ring:hover, #statusChart.total-lit .donut-total-ring, #statusChart.total-pinned .donut-total-ring { stroke: #d9ae1f; filter: brightness(1.12); }
.donut-seg[data-s="loose"]:hover,
#statusChart.loose-lit .donut-seg[data-s="loose"],
#statusChart.loose-pinned .donut-seg[data-s="loose"] { filter: saturate(1.4) brightness(0.96); }
/* Per-category detail bars for the "no complete fix" wedge - permanently shown, per request.
   Positioned at the upper right of the chart, near the pink wedge, per the reference mockup -
   not in normal document flow, so it floats over that corner instead of pushing the page down.
   The grey left border is a visual tether back to the pink wedge it's a breakdown of. */
/* Shifted 1in (96px) left from the corner (right offset), 0.35in (33.6px) down, then another
   0.35in (33.6px) right, then back 31.35px left so the text keeps at least 0.35in clear of
   the card's right edge (the text was overflowing its own grid cell by a few px, leaving
   almost no margin at the previous position). */
.donut-detail { position: absolute; top: 67.2px; right: 16.95px; width: 800px; max-width: 72%; margin: 0;
  display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--muted); padding-left: 16px; }
/* Bar column 2.5x its original 130px, per request - the panel above was widened to match.
   The text half is itself 6 grid columns (the "out of"/"actively exploited in" joiners, plus
   two fixed-width number columns the counts are centered in) so every row's "out of" and
   "actively exploited in" start at the same x position and the numbers before/between them
   read as centered in their own slot, not just left-aligned after whatever digit count came
   before. `.detail-text` has no box of its own (`display: contents`) so its children become
   grid items of `.detail-row` directly, sized once across every row. */
.detail-row { display: grid; grid-template-columns: 325px 34px auto 46px auto 1fr; align-items: center;
  column-gap: 6px; width: 100%; font-size: 13.5px; color: var(--ink);
  border: 0; background: none; font-family: inherit; text-align: left; padding: 2px 6px; border-radius: 6px;
  cursor: pointer; transition: opacity 0.15s, background-color 0.15s; }
.detail-row.off { opacity: 0.35; }
.detail-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); }
.detail-track { height: 14px; border-radius: 4px; overflow: hidden; }
.detail-bar { display: flex; height: 100%; width: 0; min-width: 8px; }
.detail-seg { display: block; height: 100%; }
.detail-seg.hot { background: var(--c); }
.detail-seg.quiet { background: color-mix(in srgb, var(--c) 40%, white); border-left: 2px solid var(--surface); }
.detail-text { display: contents; }
.detail-n { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.detail-join, .detail-cat { white-space: nowrap; }
.detail-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; color: var(--accent); }
.legend-help summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.legend-help dl { margin: 12px 0 16px; display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; font-size: 14px; }
.legend-help dd { margin: 0; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 3px 10px;
  border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 75%, black); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.filters { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; font-size: 14px; color: var(--muted); }
.filters select, .filters input[type=search] { font: inherit; color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 10px; background: var(--surface); margin-left: 6px; }
.search { flex: 1 1 260px; }
.search input { width: 100%; margin-left: 0 !important; }
.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.count { margin: 16px 0 4px; font-size: 13px; }

.list { list-style: none; margin: 0; padding: 0; }
.item { border-top: 1px solid var(--line); }
.item > .row { box-sizing: border-box; width: 100%; cursor: pointer; display: grid;
  grid-template-columns: 1fr auto; gap: 6px 16px; padding: 16px 4px; }
.item > .row:focus-visible { outline: 2px solid var(--accent); border-radius: 8px; }
.item .id { font-weight: 600; font-variant-numeric: tabular-nums; }
.item .id:hover, .item .id:focus-visible { text-decoration-thickness: 2px; }
.item .title { color: var(--ink); }
.item .prod { color: var(--muted); font-size: 13.5px; }
.item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #f1efe9; color: var(--muted); }
.badge.hot { background: #fbe9e7; color: #a84040; }
.likely { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.meter { width: 70px; height: 6px; border-radius: 3px; background: #eceae4; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }

.detail { padding: 0 4px 20px; font-size: 14px; display: grid; gap: 12px; }
.detail h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 4px; }
.detail ul { margin: 0; padding-left: 18px; }
.detail p { margin: 0; }
.more-wrap { text-align: center; margin-top: 16px; }
.foot { font-size: 12.5px; text-align: center; padding: 8px 0 40px; }

@media (max-width: 640px) {
  .item > button { grid-template-columns: 1fr; }
  .item .right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  /* The desktop shift is a fixed pixel amount - on a narrow phone it pushes the donut
     off-screen, so it's centered here instead. */
  .donut-svg { transform: none; margin-bottom: 0; }
  /* The floating upper-right corner box is too narrow for the bars + text at phone width -
     back to a normal full-width block below the ring, like before this was repositioned. */
  .donut-detail { position: static; width: 100%; max-width: 560px; margin: 8px auto 0; }
  /* The fixed 325px bar column, and the column-aligned number/joiner layout, don't fit a phone
     screen - stack the bar above a normal wrapping line of text instead. `.detail-text` gets its
     box back (undoing the desktop `display: contents`) so its children flow and wrap as one
     run of text instead of staying separate fixed-width grid cells. */
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .detail-text { display: block; }
  .detail-n, .detail-join, .detail-cat { white-space: normal; }
}

@media print {
  body { background: #fff; font-size: 11px; }
  .top { margin-bottom: 12px; }
  .btn, .filters, .more-wrap, .legend-help summary { display: none !important; }
  .legend-help dl { display: grid !important; }
  .card.clickable .label::after { display: none !important; }
  .panel, .card { box-shadow: none; border: 1px solid var(--line); break-inside: avoid; }
  .item { break-inside: avoid; }
  .donut-seg, .detail-seg, .pill, .pill::before, .meter i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
