/* ix-risks-c.css: risk map direction C, "The map of examples, walked through" (21 October 2026, second build; owner: the risk-map
   workflow). Markup: ../../prototype/app/ix-risks-c.js. Every rule starts #v8 #app .rmc (the card's chart class from api.sec), or
   html#v8 #app .rmc where it has to outrank the system's chip. Type only 12/16 at 400/700 with !important on size and weight; no
   font-size inside a media or container query (layout responds, type does not). Colours only from the v8 tokens.
   The map's layout answers its own width (a container query on .rmc-mv): under 720 each How often row lists its pills cheapest first;
   from 720 a matrix of cost columns with the rows' words on top; from 900 the words in a column at the left. ix-risks-c.js uses the
   same 720 line (NARROW) to open an example's summary in place */

#v8 #app .rmc [hidden] { display: none !important; }
#v8 #app .rmc .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#v8 #app .rmc-w { color: var(--v8-ink); }
#v8 #app .rmc-mv { container: rmc / inline-size; }

/* ---------- The toolbar: the walk, Show all examples, Show as a list; under them the key. It never changes height when used ---------- */
#v8 #app .rmc-tb { display: grid; gap: var(--v8-4); margin-bottom: var(--v8-6); }
#v8 #app .rmc-tb1 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--v8-2) var(--v8-4); min-height: 44px; }
#v8 #app .rmc-tb1-l { margin-bottom: var(--v8-4); }
#v8 #app .rmc-walk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--v8-3); }
#v8 #app .rmc-sc { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; color: var(--v8-ink); margin-right: var(--v8-1); }
#v8 #app .rmc-sb { min-width: 96px; }
#v8 #app .rmc-sb[aria-disabled="true"], #v8 #app .rmc-sb[aria-disabled="true"]:hover { box-shadow: inset 0 0 0 1px var(--v8-line); color: var(--v8-ink-2); cursor: default; background: var(--v8-white); }
#v8 #app .rmc-tbr { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--v8-5); margin-left: auto; }
#v8 #app .rmc-view, #v8 #app .rmc-all { min-height: 44px; }

/* The key: the events by risk level, each the system's pressed chip (base.css 22: --v8-sel wash, --v8-st-sel edge, the focus
   ring), drawn at the map's pills' scale so the key never outweighs the data. The radio glyph gives way to the event's icon */
#v8 #app .rmc-key { display: flex; flex-wrap: wrap; align-items: center; gap: var(--v8-3) var(--v8-6); }
#v8 #app .rmc-kg { display: flex; flex-wrap: wrap; align-items: center; gap: var(--v8-2); }
#v8 #app .rmc-kh { display: inline-flex; align-items: center; min-height: 32px; margin-right: var(--v8-1); }
#v8 #app .rmc-kh .rkb { gap: var(--v8-2); }
#v8 #app .rmc-kh .rkb-w { font-size: var(--v8-fs-14) !important; line-height: var(--v8-lh-14) !important; font-weight: 700 !important; color: var(--v8-ink); }
#v8 #app .rmc-kh .rkb-c { height: 16px; gap: 2px; }
#v8 #app .rmc-kh .rkb-c > i { width: 6px; }
#v8 #app .rmc-kh .rkb-c > i:nth-child(1) { height: 7px; }
#v8 #app .rmc-kh .rkb-c > i:nth-child(2) { height: 11px; }
#v8 #app .rmc-kh .rkb-c > i:nth-child(3) { height: 16px; }
#v8 #app .rmc-sum .rkb { gap: var(--v8-2); }
#v8 #app .rmc-sum .rkb-w { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; }
html#v8 #app .rmc .v8-cf-chip.rmc-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin: 0; padding: 0 var(--v8-3) 0 var(--v8-2); font-size: var(--v8-fs-14) !important; line-height: var(--v8-lh-14) !important; font-weight: 700 !important; text-align: left; }
html#v8 #app .rmc .v8-cf-chip.rmc-chip::before { content: none; display: none; }
html#v8 #app .rmc .v8-cf-chip.rmc-chip::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }
#v8 #app .rmc-ci { display: grid; place-items: center; flex: none; width: 16px; height: 16px; }
#v8 #app .rmc-ci svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- The map: a row per How often, a column per cost range ---------- */
#v8 #app .rmc-map { display: grid; }
#v8 #app .rmc-yh { margin-bottom: var(--v8-2); }
#v8 #app .rmc-yt, #v8 #app .rmc-al { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; color: var(--v8-ink); }
#v8 #app .rmc-ps { display: grid; gap: var(--v8-1); }
#v8 #app .rmc-row { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: var(--v8-r-sm); background: var(--v8-gray); padding: var(--v8-2) var(--v8-3) var(--v8-3); }
#v8 #app .rmc-yl { padding: var(--v8-1) 0 var(--v8-2); font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; color: var(--v8-ink); }
/* Narrow (the default): the cells give way, the row is one list of pills, cheapest first, each with its cost */
#v8 #app .rmc-cells { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--v8-2); }
#v8 #app .rmc-cell { display: contents; }
#v8 #app .rmc-axes { display: none; }

/* A pill: the short name, under it the event's icon and the cost (the name has the pill's whole width, so it fits one line at 1440).
   46 to the eye and to the pointer */
#v8 #app .rmc-p { position: relative; display: inline-grid; grid-template-columns: 16px auto; grid-template-areas: "t t" "i c"; justify-content: start; align-items: center; column-gap: 6px; row-gap: 2px; max-width: 100%; min-height: 46px; margin: 0; padding: 6px var(--v8-3); border: 0; border-radius: 23px; background: var(--v8-white); box-shadow: var(--v8-st-soft); color: var(--v8-ink); font: inherit; text-align: left; cursor: pointer; transition: background-color .16s ease-out, box-shadow .16s ease-out, color .16s ease-out; }
#v8 #app .rmc-t { grid-area: t; min-width: 0; font-size: var(--v8-fs-14) !important; line-height: var(--v8-lh-14) !important; font-weight: 700 !important; overflow-wrap: break-word; }
#v8 #app .rmc-c { grid-area: c; font-size: var(--v8-fs-14) !important; line-height: var(--v8-lh-14) !important; font-weight: 400 !important; color: var(--v8-ink-2); white-space: nowrap; }
#v8 #app .rmc-d { grid-area: i; display: grid; place-items: center; width: 16px; height: 16px; color: var(--v8-ink); }
#v8 #app .rmc-d svg { width: 16px; height: 16px; fill: currentColor; }
@media (hover: hover) { #v8 #app .rmc-p:hover { box-shadow: var(--v8-st-hover); } }
#v8 #app .rmc-p:focus-visible { outline: none; box-shadow: var(--v8-st-focus); }
/* Lit up (the chosen event's other examples, or the walk's level): the system's selected edge, 1 px. The rest quieter, still
   readable (ink-2 on the gray, 5,9:1) and still buttons. The chosen example: the system's selected wash and edge, its cost Bold */
#v8 #app .rmc-hl .rmc-p:not(.rmc-on):not(.rmc-cur) { background: var(--v8-gray); box-shadow: var(--v8-st-soft); color: var(--v8-ink-2); }
#v8 #app .rmc-hl .rmc-p:not(.rmc-on):not(.rmc-cur) .rmc-d { color: var(--v8-ink-2); }
#v8 #app .rmc-p.rmc-on { background: var(--v8-white); box-shadow: inset 0 0 0 1px var(--v8-sel-edge); }
#v8 #app .rmc-p.rmc-cur { background: var(--v8-sel); box-shadow: var(--v8-st-sel); color: var(--v8-ink); }
#v8 #app .rmc-p.rmc-cur .rmc-c { color: var(--v8-ink); font-weight: 700 !important; }
@media (hover: hover) {
  #v8 #app .rmc-hl .rmc-p:not(.rmc-cur):hover { box-shadow: var(--v8-st-hover); }
  #v8 #app .rmc-p.rmc-cur:hover { box-shadow: var(--v8-st-sel-hover); }
}
#v8 #app .rmc-p.rmc-cur:focus-visible { box-shadow: var(--v8-st-sel-focus); }
#v8 #app .rmc-hl .rmc-p:not(.rmc-cur):focus-visible { box-shadow: var(--v8-st-focus); }

/* The cost axis: ticks on the columns' edges, the first and last held inside the plot */
#v8 #app .rmc-axes { grid-template-columns: minmax(0, 1fr); row-gap: var(--v8-1); margin-top: var(--v8-2); }
#v8 #app .rmc-xa { display: grid; grid-template-columns: var(--rmc-cols); gap: var(--v8-1); height: 20px; }
#v8 #app .rmc-tc { position: relative; }
#v8 #app .rmc-tk { position: absolute; top: 0; left: -2px; transform: translateX(-50%); padding-top: 2px; font-size: var(--v8-fs-14) !important; line-height: var(--v8-lh-14) !important; font-weight: 400 !important; color: var(--v8-ink-2); white-space: nowrap; }
#v8 #app .rmc-tk.rmc-tk-0 { left: 0; transform: none; }
#v8 #app .rmc-tk.rmc-tk-n { left: auto; right: 0; transform: none; }
#v8 #app .rmc-al { order: 2; text-align: center; }

/* From 720: the matrix. Columns as wide as their share of the log scale (--rmc-cols), each cell a gray tile listing its pills */
@container rmc (min-width: 720px) {
  #v8 #app .rmc-row { padding: 0; background: none; border-radius: 0; }
  #v8 #app .rmc-cells { display: grid; grid-template-columns: var(--rmc-cols); align-items: stretch; gap: var(--v8-1); }
  #v8 #app .rmc-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; min-height: 54px; padding: var(--v8-1); border-radius: var(--v8-r-sm); background: var(--v8-gray); }
  #v8 #app .rmc-axes { display: grid; }
  #v8 #app .rmc-yl { padding: var(--v8-2) 0; }
}
/* From 900: the rows' words in a column at the left, as a chart's axis */
@container rmc (min-width: 900px) {
  #v8 #app .rmc-row { grid-template-columns: 88px minmax(0, 1fr); align-items: stretch; }
  #v8 #app .rmc-yl { align-self: center; padding: 0 var(--v8-2) 0 0; font-weight: 400 !important; }
  #v8 #app .rmc-axes { grid-template-columns: 88px minmax(0, 1fr); }
  #v8 #app .rmc-xa { grid-column: 2; }
  #v8 #app .rmc-al { grid-column: 2; }
}

/* ---------- The summary under the map: what a click does, or what was chosen ---------- */
#v8 #app .rmc-sum { margin-top: var(--v8-5); }
#v8 #app p.rmc-hint { margin: 0; color: var(--v8-ink-2); max-width: var(--v8-measure); }
#v8 #app .rmc-sx { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: var(--v8-3); padding: var(--v8-4); border-radius: var(--v8-r); background: var(--v8-gray); }
#v8 #app .rmc-sx-l { grid-template-columns: minmax(0, 1fr); }
#v8 #app .rmc-sd svg { width: 24px; height: 24px; fill: var(--v8-ink); }
#v8 #app .rmc-sm { display: grid; gap: var(--v8-2); min-width: 0; }
#v8 #app .rmc-sm p { margin: 0; }
#v8 #app p.rmc-st { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--v8-3); font-weight: 700 !important; }
#v8 #app .rmc-sn { font-weight: 400 !important; }
#v8 #app p.rmc-sf, #v8 #app p.rmc-se { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--v8-5); }
#v8 #app .rmc-sf b { font-weight: 700 !important; }
#v8 #app .rmc-k { color: var(--v8-ink-2); margin-right: 4px; }
#v8 #app .rmc-si { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
#v8 #app .rmc-si > .rmc-k { white-space: nowrap; }
#v8 #app .rmc-se .rmc-en { font-weight: 700 !important; }
#v8 #app .rmc-mh { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px var(--v8-4); }
#v8 #app p.rmc-sl { max-width: var(--v8-measure); color: var(--v8-ink-2); }
#v8 #app .rmc .st-src { margin-left: 0; }
/* In place, on a narrow card: under the tapped pill, the row's full width */
#v8 #app .rmc-sx.rmc-inl { flex: 0 0 100%; box-sizing: border-box; margin: 0 0 var(--v8-1); padding: var(--v8-3); background: var(--v8-white); border-radius: var(--v8-r-in); }

/* ---------- The level page: the old card's rows ---------- */
#v8 #app .rmc-low { margin-top: var(--v8-6); }
#v8 #app .rmc-low:empty { display: none; }
#v8 #app .rmc-pan { display: grid; gap: var(--v8-3); }
#v8 #app .rmc-ph { display: flex; align-items: center; gap: 12px; margin: 0; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; color: var(--v8-ink); }
#v8 #app .rmc-ph span { font-weight: 700 !important; }
#v8 #app .rmc-pl { margin: 0; max-width: var(--v8-measure); color: var(--v8-ink-2); }
#v8 #app .rmc-evs { display: grid; gap: var(--v8-2); margin: var(--v8-1) 0 0; padding: 0; list-style: none; }
#v8 #app .rmc-ev { border-radius: var(--v8-r); background: var(--v8-gray); overflow: hidden; }
#v8 #app .rmc-evh { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 24px; align-items: center; column-gap: 12px; width: 100%; min-height: 56px; margin: 0; padding: var(--v8-3) var(--v8-4); border: 0; background: transparent; color: var(--v8-ink); font: inherit; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; text-align: left; cursor: pointer; }
@media (hover: hover) { #v8 #app .rmc-evh:hover { background: var(--v8-hover); } }
#v8 #app .rmc-evh:focus-visible { outline: var(--v8-focus); outline-offset: -2px; box-shadow: var(--v8-focus-glow-in) !important; }
#v8 #app .rmc-ei svg { width: 24px; height: 24px; fill: var(--v8-ink); }
#v8 #app .rmc-en { font-weight: 700 !important; }
#v8 #app .rmc-em { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px var(--v8-4); }
#v8 #app .rmc .st-may { color: var(--v8-ink); }
#v8 #app .rmc .st-may-k { color: var(--v8-ink-2); margin-right: 4px; }
#v8 #app .rmc .st-has { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#v8 #app .rmc .st-has svg { width: 20px; height: 20px; flex: none; }
#v8 #app .rmc .st-has-y { color: var(--v8-green-t); }
#v8 #app .rmc .st-has-y svg { fill: var(--v8-green-t); }
#v8 #app .rmc .st-has-n { color: var(--v8-ink-2); }
#v8 #app .rmc .st-has-n svg { fill: var(--v8-ink-2); }
#v8 #app .rmc-chev svg { width: 20px; height: 20px; fill: var(--v8-ink); transition: transform .16s ease-out; }
#v8 #app .rmc-open .rmc-chev svg { transform: rotate(180deg); }
/* The body clears the floating assistant bubble at the right */
#v8 #app .rmc-evb { padding: var(--v8-2) var(--v8-4) var(--v8-5) calc(var(--v8-4) + 24px + 12px); }
#v8 #app .rmc-when { margin: 0 0 var(--v8-4); max-width: 760px; color: var(--v8-ink); }
#v8 #app p.rmc-impn { margin: var(--v8-3) 0 0; max-width: var(--v8-measure); color: var(--v8-ink-2); }
#v8 #app .rmc table.st-evt tr.rmc-cur > * { background: var(--v8-sel); }
#v8 #app .rmc table.st-evt tr.rmc-cur > :first-child { border-radius: var(--v8-r-sm) 0 0 var(--v8-r-sm); box-shadow: inset 4px 0 0 var(--v8-sel-edge); }
#v8 #app .rmc table.st-evt tr.rmc-cur > :last-child { border-radius: 0 var(--v8-r-sm) var(--v8-r-sm) 0; }
#v8 #app .rmc table.st-evt tr.rmc-cur .st-ext { font-weight: 700 !important; }
#v8 #app .rmc table.st-evt th[scope="row"] { padding-left: 12px; }
#v8 #app .rmc table.st-evt thead th:first-child { padding-left: 12px; }

/* The list view: the old card's columns, as storyRisks() draws them */
#v8 #app .rmc-lv { display: block; }

/* ---------- Narrow cards: the level page's rows stack (the card's own width, so a 1024 window's card does it too) ---------- */
@container rmc (max-width: 719px) {
  #v8 #app .rmc-evh { grid-template-columns: 24px minmax(0, 1fr) 24px; row-gap: 4px; }
  #v8 #app .rmc-em { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  #v8 #app .rmc-chev { grid-column: 3; grid-row: 1; }
  #v8 #app .rmc-evb { padding-left: var(--v8-4); }
  #v8 #app .rmc-sc { flex-basis: 100%; }
  #v8 #app .rmc-sx { grid-template-columns: minmax(0, 1fr); }
  #v8 #app .rmc-sd { display: none; }
}
@media (max-width: 639px) {
  #v8 #app .rmc table.st-evt td.st-lk::before { content: "How often: "; }
  #v8 #app .rmc table.st-evt tr.rmc-cur { border-radius: var(--v8-r-sm); background: var(--v8-sel); box-shadow: inset 4px 0 0 var(--v8-sel-edge); padding: 8px 12px; }
  #v8 #app .rmc table.st-evt tr.rmc-cur > * { background: transparent; box-shadow: none; padding-left: 0; }
  #v8 #app .rmc table.st-evt th[scope="row"], #v8 #app .rmc table.st-evt thead th:first-child { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { #v8 #app .rmc-p, #v8 #app .rmc-chev svg { transition: none; } }
@media (forced-colors: active) {
  #v8 #app .rmc-p { border: 1px solid CanvasText; }
  #v8 #app .rmc-p.rmc-cur, html#v8 #app .rmc .v8-cf-chip.rmc-chip[aria-pressed="true"] { border: 3px solid CanvasText; }
  #v8 #app .rmc-cell, #v8 #app .rmc-row { outline: 1px solid CanvasText; }
}
