/* ix-risks-d.css: risk map direction D, "The four-quadrant graph" (21 October 2026; owner: the risk-map d agent).
   Markup: ../../prototype/app/ix-risks-d.js. Every rule starts #v8 #app .rmd (the card's chart class from api.sec). Type only 12/16/20
   at 400/700 with !important on size and weight; no font-size inside a media or container query (layout responds, type does not).
   Colours from the v8 tokens; the quadrants' tints are the impact bars' warning colours (rest.css --v8-risk-1..3) mixed with white,
   light enough that ink (#333) and ink-2 (#5E5E5E) read on them at 4.5:1 or more (measured in the build notes).
   Tags, not pills (Janne, 21 October 2026: "fully curved edges are only on buttons"): every item is an 8 px corner, two lines or one. */

#v8 #app .rmd [hidden] { display: none !important; }
#v8 #app .rmd .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#v8 #app .rmd-w {
  --rmd-red: color-mix(in srgb, var(--v8-risk-3, #D63D29) 24%, #FFFFFF);
  --rmd-orange: color-mix(in srgb, var(--v8-risk-2, #F08A24) 26%, #FFFFFF);
  --rmd-yellow: color-mix(in srgb, var(--v8-risk-1, #F2C230) 34%, #FFFFFF);
  container: rmd / inline-size; color: var(--v8-ink);
}

/* ---------- The graph: How often up the left, the plot, Possible cost under it ---------- */
#v8 #app .rmd-g { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "yt yt" "ya plot" ". xa" ". xt"; column-gap: var(--v8-3); }
#v8 #app .rmd-yt { grid-area: yt; margin-bottom: var(--v8-3); font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; color: var(--v8-ink); }
#v8 #app .rmd-xt { grid-area: xt; margin-top: var(--v8-1); text-align: center; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; color: var(--v8-ink); }
#v8 #app .rmd-ye, #v8 #app .rmd-xe { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; color: var(--v8-ink-2); white-space: nowrap; }
/* The axes: a 2 px line between the end words, its arrowhead at the Often and Higher ends */
#v8 #app .rmd-ya { grid-area: ya; display: flex; flex-direction: column; align-items: flex-start; gap: var(--v8-2); padding: var(--v8-2) 0; }
#v8 #app .rmd-yl { position: relative; flex: 1; width: 2px; margin-left: 20px; background: #8C8C8C; border-radius: 1px; }
#v8 #app .rmd-yl::before { content: ""; position: absolute; top: -2px; left: 50%; width: 8px; height: 8px; border-top: 2px solid #8C8C8C; border-left: 2px solid #8C8C8C; transform: translateX(-50%) rotate(45deg); transform-origin: center; margin-left: 0; box-sizing: border-box; translate: 0 1px; }
#v8 #app .rmd-xa { grid-area: xa; display: flex; align-items: center; gap: var(--v8-3); margin-top: var(--v8-3); }
#v8 #app .rmd-xl { position: relative; flex: 1; height: 2px; background: #8C8C8C; border-radius: 1px; }
#v8 #app .rmd-xl::after { content: ""; position: absolute; right: -1px; top: 50%; width: 8px; height: 8px; border-top: 2px solid #8C8C8C; border-right: 2px solid #8C8C8C; transform: translateY(-50%) rotate(45deg); box-sizing: border-box; }

/* The plot: four tinted quadrants, the centre cross a 4 px white gap; outer corners 16, inner corners 4, so it reads as one field */
#v8 #app .rmd-plot { grid-area: plot; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; min-width: 0; }
#v8 #app .rmd-q { position: relative; min-width: 0; min-height: 184px; border-radius: 4px; }
#v8 #app .rmd-q-tl { border-top-left-radius: var(--v8-r); background: var(--rmd-orange); }
#v8 #app .rmd-q-tr { border-top-right-radius: var(--v8-r); background: var(--rmd-red); }
#v8 #app .rmd-q-bl { border-bottom-left-radius: var(--v8-r); background: var(--rmd-yellow); }
#v8 #app .rmd-q-br { border-bottom-right-radius: var(--v8-r); background: var(--rmd-orange); }
/* The quadrant's name, quiet, in its outer corner */
#v8 #app .rmd-qn { position: absolute; max-width: calc(100% - 32px); font-size: var(--v8-fs-14) !important; line-height: var(--v8-lh-14) !important; font-weight: 700 !important; color: var(--v8-ink); }
#v8 #app .rmd-q-tl .rmd-qn { top: 16px; left: 16px; }
#v8 #app .rmd-q-tr .rmd-qn { top: 16px; right: 16px; text-align: right; }
#v8 #app .rmd-q-bl .rmd-qn { bottom: 16px; left: 16px; }
#v8 #app .rmd-q-br .rmd-qn { bottom: 16px; right: 16px; text-align: right; }
/* The tags' list: until the script has measured and placed them, a plain wrapping list under the name */
#v8 #app .rmd-ts { display: flex; flex-wrap: wrap; gap: var(--v8-2); margin: 0; padding: 44px 16px 16px; list-style: none; }
#v8 #app .rmd-q-bl .rmd-ts, #v8 #app .rmd-q-br .rmd-ts { padding: 16px 16px 44px; }
#v8 #app .rmd-li { margin: 0; padding: 0; }
#v8 #app .rmd-laid .rmd-ts { display: block; padding: 0; }
#v8 #app .rmd-laid .rmd-li { position: absolute; width: max-content; }

/* A tag: the event's icon and its name, white on the tint, 8 px corners however many lines it takes; 44 to the pointer */
#v8 #app .rmd-t { display: flex; align-items: flex-start; gap: var(--v8-2); width: 100%; min-height: 44px; margin: 0; padding: 10px var(--v8-3); border: 0; border-radius: var(--v8-r-sm); background: var(--v8-white); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), inset 0 0 0 1px rgba(0, 0, 0, .08); color: var(--v8-ink); font: inherit; text-align: left; cursor: pointer; transition: background-color .16s ease-out, box-shadow .16s ease-out; }
#v8 #app .rmd-ti { display: grid; place-items: center; flex: none; width: 24px; height: 24px; }
#v8 #app .rmd-ti svg { width: 20px; height: 20px; fill: var(--v8-ink); }
#v8 #app .rmd-tn { min-width: 0; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; overflow-wrap: normal; hyphens: manual; }
@media (hover: hover) { #v8 #app .rmd-t:hover { box-shadow: var(--v8-st-hover); } }
#v8 #app .rmd-t:focus-visible { outline: none; box-shadow: var(--v8-st-focus); }
/* Open: the system's selected wash and edge, the name Bold */
#v8 #app .rmd-t[aria-expanded="true"] { background: var(--v8-sel); box-shadow: var(--v8-st-sel); }
#v8 #app .rmd-t[aria-expanded="true"] .rmd-tn { font-weight: 700 !important; }
@media (hover: hover) { #v8 #app .rmd-t[aria-expanded="true"]:hover { box-shadow: var(--v8-st-sel-hover); } }
#v8 #app .rmd-t[aria-expanded="true"]:focus-visible { box-shadow: var(--v8-st-sel-focus); }

/* ---------- The panel under the graph ---------- */
#v8 #app .rmd-pw:empty { display: none; }
#v8 #app .rmd-pw { margin-top: var(--v8-6); }
#v8 #app .rmd-pan { display: grid; gap: var(--v8-4); padding: var(--v8-5) var(--v8-6) var(--v8-6); border-radius: var(--v8-r); background: var(--v8-gray); }
#v8 #app .rmd-phd { display: grid; grid-template-columns: 24px minmax(0, 1fr) 44px; align-items: center; column-gap: var(--v8-3); margin: 0 -10px 0 0; }
#v8 #app .rmd-pi svg { width: 24px; height: 24px; fill: var(--v8-ink); }
#v8 #app .rmd-ph { margin: 0; font-size: var(--v8-fs-20) !important; line-height: var(--v8-lh-20) !important; letter-spacing: -0.01em; font-weight: 700 !important; color: var(--v8-ink); }
#v8 #app .rmd-ph:focus { outline: none; }
#v8 #app .rmd-ph:focus-visible { outline: var(--v8-focus); outline-offset: 0 !important; border-radius: 4px; box-shadow: var(--v8-focus-glow) !important; }
#v8 #app .rmd-pan p { margin: 0; max-width: var(--v8-measure); }
#v8 #app p.rmd-when { color: var(--v8-ink); }
#v8 #app p.rmd-lv { display: flex; flex-wrap: wrap; align-items: center; gap: var(--v8-2) var(--v8-4); }
#v8 #app .rmd-lv .rkb-w { font-weight: 700 !important; }
#v8 #app .rmd-lvw { color: var(--v8-ink-2); }
/* The typical costs: the old card's table on a white inset panel, the example that places the tag marked in words and the wash */
#v8 #app .rmd table.rmd-evt { max-width: none; margin-top: var(--v8-2); border-collapse: separate; border-spacing: 0; }
#v8 #app .rmd caption.rmd-cap { caption-side: top; padding: 0 0 var(--v8-2); text-align: left; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; color: var(--v8-ink); }
#v8 #app .rmd table.rmd-evt th[scope="row"], #v8 #app .rmd table.rmd-evt thead th:first-child { padding-left: 12px; }
#v8 #app .rmd table.rmd-evt tr.rmd-cur > * { background: var(--v8-white); }
#v8 #app .rmd table.rmd-evt tr.rmd-cur > :first-child { border-radius: var(--v8-r-sm) 0 0 var(--v8-r-sm); }
#v8 #app .rmd table.rmd-evt tr.rmd-cur > :last-child { border-radius: 0 var(--v8-r-sm) var(--v8-r-sm) 0; }
#v8 #app .rmd .rmd-on, #v8 #app .rmd .rmd-src { display: inline-block; margin: 4px 8px 0 0; padding: 2px 8px; border-radius: var(--v8-r-tag); background: var(--v8-white); box-shadow: inset 0 0 0 1px var(--v8-line); color: var(--v8-ink-2); font-size: var(--v8-fs-14) !important; line-height: var(--v8-lh-14) !important; font-weight: 400 !important; white-space: nowrap; }
#v8 #app .rmd tr.rmd-cur .rmd-on { background: var(--v8-gray); box-shadow: none; color: var(--v8-ink); font-weight: 700 !important; }
#v8 #app p.rmd-impn { color: var(--v8-ink-2); }
/* The insurance that may help, whether she has it, and the portal's own link */
#v8 #app .rmd-ins { display: flex; flex-wrap: wrap; align-items: center; gap: var(--v8-2) var(--v8-5); padding-top: var(--v8-4); border-top: 1px solid var(--v8-line); }
#v8 #app .rmd-may-k { margin-right: 4px; color: var(--v8-ink-2); }
#v8 #app .rmd-has { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#v8 #app .rmd-has svg { width: 20px; height: 20px; flex: none; }
#v8 #app .rmd-has-y { color: var(--v8-green-t); }
#v8 #app .rmd-has-y svg { fill: var(--v8-green-t); }
#v8 #app .rmd-has-n { color: var(--v8-ink-2); }
#v8 #app .rmd-has-n svg { fill: var(--v8-ink-2); }
#v8 #app .rmd-act { margin-left: auto; }
#v8 #app .rmd-note { display: block; flex-basis: 100%; max-width: var(--v8-measure); color: var(--v8-ink-2); }

/* ---------- Narrow cards (a phone): the How often words stand along the axis, the plot keeps both columns ---------- */
/* The script's .rmd-nar (a 390 phone): each tag takes its quadrant's width, its icon above its name, so a name wraps at its words */
#v8 #app .rmd-nar .rmd-t { flex-direction: column; gap: 4px; padding: var(--v8-2) 10px 10px; }
#v8 #app .rmd-nar .rmd-ti { justify-content: start; }
/* The script's .rmd-list (a 320 phone): a list grouped by quadrant, each block tinted and named, no axes; its tags full width */
#v8 #app .rmd-list .rmd-g { grid-template-columns: minmax(0, 1fr); grid-template-areas: "plot"; }
#v8 #app .rmd-list :is(.rmd-yt, .rmd-ya, .rmd-xa, .rmd-xt) { display: none; }
#v8 #app .rmd-list .rmd-plot { grid-template-columns: minmax(0, 1fr); gap: var(--v8-2); }
#v8 #app .rmd-list .rmd-q { min-height: 0; border-radius: var(--v8-r-sm); }
#v8 #app .rmd-list .rmd-q .rmd-qn { position: static; display: block; max-width: none; padding: 12px 12px 0; text-align: left; }
#v8 #app .rmd-list .rmd-ts, #v8 #app .rmd-list .rmd-q-bl .rmd-ts, #v8 #app .rmd-list .rmd-q-br .rmd-ts { flex-direction: column; padding: var(--v8-2) 12px 12px; }
#v8 #app .rmd-list .rmd-q .rmd-ts:empty { display: none; }

@container rmd (max-width: 519px) {
  #v8 #app .rmd-g { grid-template-columns: 24px minmax(0, 1fr); column-gap: var(--v8-2); }
  #v8 #app .rmd-ya { align-items: center; padding: var(--v8-1) 0; }
  #v8 #app .rmd-ye { writing-mode: vertical-rl; transform: rotate(180deg); }
  #v8 #app .rmd-yl { margin-left: 0; }
  #v8 #app .rmd-q { min-height: 112px; }
  #v8 #app .rmd-q-tl .rmd-qn, #v8 #app .rmd-q-bl .rmd-qn { left: 8px; }
  #v8 #app .rmd-q-tr .rmd-qn, #v8 #app .rmd-q-br .rmd-qn { right: 8px; }
  #v8 #app .rmd-q-tl .rmd-qn, #v8 #app .rmd-q-tr .rmd-qn { top: 8px; }
  #v8 #app .rmd-q-bl .rmd-qn, #v8 #app .rmd-q-br .rmd-qn { bottom: 8px; }
  #v8 #app .rmd-qn { max-width: calc(100% - 16px); }
  #v8 #app .rmd-t { padding: 10px var(--v8-2); gap: 6px; }
  #v8 #app .rmd-pan { padding: var(--v8-4); }
  #v8 #app .rmd-act { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 639px) {
  #v8 #app .rmd table.rmd-evt tr.rmd-cur { border-radius: var(--v8-r-sm); background: var(--v8-white); padding: 8px 12px; }
  #v8 #app .rmd table.rmd-evt tr.rmd-cur > * { background: transparent; }
  #v8 #app .rmd table.rmd-evt th[scope="row"], #v8 #app .rmd table.rmd-evt thead th:first-child { padding-left: 0; }
  #v8 #app .rmd table.rmd-evt td.st-lk::before { content: "How often: "; color: var(--v8-ink-2); }
}
@media (prefers-reduced-motion: reduce) { #v8 #app .rmd-t { transition: none; } }
@media (forced-colors: active) {
  #v8 #app .rmd-q { outline: 1px solid CanvasText; }
  #v8 #app .rmd-t { border: 1px solid CanvasText; }
  #v8 #app .rmd-t[aria-expanded="true"] { border: 3px solid CanvasText; }
  #v8 #app .rmd-yl, #v8 #app .rmd-xl { background: CanvasText; }
}
