/* ix-risks-a.css: the risk map, direction A, "the map and its detail" (21 October 2026; owner: the risk-map workflow, designer A).
   Markup: ../../prototype/app/ix-risks-a.js (shown with ?risks=a before the hash). v8 tokens only, type 12/16/20 at 400/700 with
   !important on size and weight (the older rules force 400 by element), no font-size in a media or container query. White and
   light: the plot is hairlines on white; the level is the small rising bars inside each pill and one key above the map (no tinted
   zones); the only colour on the plot is the chosen event, its green pill and its green rings. Layout (positions, lanes, heights)
   is set by the script after measuring; this file draws */

#v8 #app .ra { container: ra / inline-size; color: var(--v8-ink); }
#v8 #app .ra .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Narrow: the map, the detail directly under its cost axis, then the placement note. Wide: the detail beside the map, the note
   under the map */
#v8 #app .ra-g { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--v8-6); align-items: start; }
@container ra (min-width: 880px) {
  #v8 #app .ra-g { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto 1fr; gap: 0 var(--v8-6); }
  #v8 #app .ra-mc { grid-column: 1; grid-row: 1; }
  #v8 #app .ra-dt { grid-column: 2; grid-row: 1 / span 2; }
  #v8 #app .cr .ra-g > p.ra-note { grid-column: 1; grid-row: 2; margin-top: var(--v8-4) !important; }
}
@container ra (max-width: 879px) { #v8 #app .ra-dt { padding-top: var(--v8-5); border-top: 1px solid var(--v8-line); } }

/* Above the map: the key of the three levels, the switch to the list at the right; then How often over the row names */
#v8 #app .ra-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--v8-4); min-height: 44px; margin: 0 0 var(--v8-2); }
#v8 #app .ra-k { display: inline-flex; align-items: center; min-height: 32px; }
#v8 #app .ra-k .rkb { gap: 8px; }
#v8 #app .ra-k .rkb-w { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; color: var(--v8-ink); white-space: nowrap; }
#v8 #app .ra-sw { min-height: 44px; margin-left: auto; font-size: var(--v8-fs-16) !important; font-weight: 400 !important; white-space: nowrap; }
#v8 #app .cr p.ra-yt, #v8 #app .cr p.ra-xt { margin: 0 !important; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; color: var(--v8-ink); }
#v8 #app .cr p.ra-yt { margin: var(--v8-2) 0 var(--v8-2) !important; }
#v8 #app .cr p.ra-xt { margin: 4px 0 0 !important; }

/* The small rising bars, one size in the key and the pills (rkBars' markup; insights.css colours the filled ones by level) */
#v8 #app :is(.ra-k, .ra-pb) .rkb-c { height: 12px; gap: 2px; }
#v8 #app :is(.ra-k, .ra-pb) .rkb-c > i { width: 4px; border-radius: 1px; }
#v8 #app :is(.ra-k, .ra-pb) .rkb-c > i:nth-child(1) { height: 5px; }
#v8 #app :is(.ra-k, .ra-pb) .rkb-c > i:nth-child(2) { height: 8px; }
#v8 #app :is(.ra-k, .ra-pb) .rkb-c > i:nth-child(3) { height: 12px; }

/* The plot: three equal rows on hairlines, light gridlines at the kept ticks */
#v8 #app .ra-plot { position: relative; min-height: 180px; }
#v8 #app .ra-bands { position: absolute; inset: 0; }
#v8 #app .ra-band { position: absolute; left: 0; right: 0; border-top: 1px solid var(--v8-line); }
#v8 #app .ra-band:last-of-type { border-bottom: 1px solid var(--v8-line); }
#v8 #app .ra-rl { position: absolute; left: 0; top: var(--mid, 50%); transform: translateY(-50%); font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; color: var(--v8-ink); }
#v8 #app .ra:not(.ra-wide) .ra-rl { top: 8px; transform: none; color: var(--v8-ink-2); }
#v8 #app .ra-gl { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid color-mix(in srgb, var(--v8-line) 55%, #fff); }
#v8 #app .ra-gl[hidden] { display: none; }
#v8 #app .ra-dots, #v8 #app .ra-pills { position: absolute; inset: 0; }
#v8 #app .ra-pills { pointer-events: none; }
#v8 #app .ra-pills > .ra-p { pointer-events: auto; }

/* The pills: a 44 target, the pill 32 inside it, centred on the event's cost: the level's bars, then the name. Its dot sits on the
   pill's lower edge exactly at the cost (--dx from the pill's left edge): grey on every pill but the chosen one, so the only
   coloured marks on the plot are the chosen event's */
#v8 #app .ra-p { position: absolute; left: 0; top: 0; height: 44px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; font: inherit; color: var(--v8-ink); }
#v8 #app .ra-pv { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 12px; border-radius: var(--v8-r-pill); background: #fff; box-shadow: inset 0 0 0 1px var(--v8-field); white-space: nowrap; }
#v8 #app .ra-pb { display: inline-flex; align-items: center; }
/* A phone's map: the same pill, tighter (so "Equipment theft or damage" fits a 320 phone's 238 px plot) */
#v8 #app .ra:not(.ra-wide) .ra-pv { gap: 6px; padding: 0 10px 0 8px; }
#v8 #app .ra:not(.ra-wide) .ra-pb .rkb-c > i { width: 3px; }
#v8 #app .ra-pn { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; }
#v8 #app .ra-pd { position: absolute; top: 100%; left: var(--dx, 50%); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--v8-line); box-shadow: 0 0 0 2px #fff, inset 0 0 0 1px rgba(0, 0, 0, .28); }
@media (hover: hover) { #v8 #app .ra-p:hover .ra-pv { background: var(--v8-hover); box-shadow: var(--v8-edge-hover); } }
/* The chosen pill: Fennia green, its bars white (the level stays in their heights), its dot solid green on white */
#v8 #app .ra-p[aria-checked="true"] .ra-pv { background: var(--v8-green); box-shadow: none; color: #fff; }
#v8 #app .ra-p[aria-checked="true"] .rkb-c > i { background: rgba(255, 255, 255, .38); }
#v8 #app .ra-p[aria-checked="true"] .rkb-c > i.on { background: #fff; }
#v8 #app .ra-p[aria-checked="true"] .ra-pd { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--v8-green); box-shadow: 0 0 0 2px #fff; }
/* The focus ring follows the pill's shape, not the 44 target around it (base.css 124 rings every focused control inside v8) */
#v8 #app .ra-p:focus, #v8 #app .ra-p:focus-visible { outline: none !important; }
#v8 #app .ra-p:focus-visible .ra-pv { outline: var(--v8-focus); outline-offset: 0 !important; box-shadow: var(--v8-focus-glow) !important; }
@media (forced-colors: active) { #v8 #app .ra-p[aria-checked="true"] .ra-pv { outline: 3px solid Highlight; } }

/* The chosen event's other examples: green rings in the rug under their rows, the cost beside each at 16 (left of the ring near
   the edge or where two would touch; 12 only where a measured collision is left) */
#v8 #app .ra-d { position: absolute; display: flex; align-items: center; gap: 6px; height: 24px; margin: -12px 0 0 -6px; }
#v8 #app .ra-d > i { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--v8-green); }
#v8 #app .ra-d > span { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; color: var(--v8-green-t); white-space: nowrap; font-variant-numeric: tabular-nums; }
#v8 #app .ra-d.ra-d-s > span { font-size: var(--v8-fs-14) !important; line-height: var(--v8-lh-14) !important; }
#v8 #app .ra-d.ra-d-l { flex-direction: row-reverse; transform: translateX(calc(-100% + 12px)); }
#v8 #app .ra-d { transition: transform .32s var(--v8-ease), opacity .2s linear; }
@media (prefers-reduced-motion: reduce) { #v8 #app .ra-d { transition: none; } }

/* The cost axis under the plot; the kept ticks only */
#v8 #app .ra-xa { position: relative; height: 32px; }
#v8 #app .ra-tk { position: absolute; top: 6px; white-space: nowrap; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; color: var(--v8-ink-2); font-variant-numeric: tabular-nums; }
#v8 #app .ra-tk[hidden] { display: none; }
#v8 #app .cr p.ra-note { margin: 0 !important; color: var(--v8-ink-2); max-width: var(--v8-measure); }

/* The list: the same events as the same radios on hairlines, highest risk first; the chosen one in the system's selected style
   (base.css 22: the light green wash with the 2 px green edge inside) */
#v8 #app .ra-list { margin: 0; padding: 0; border-top: 1px solid var(--v8-line); }
#v8 #app .ra-li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px var(--v8-4); width: 100%; min-height: 64px; padding: var(--v8-3); margin: 0; border: 0; border-bottom: 1px solid var(--v8-line); border-radius: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: var(--v8-ink); }
#v8 #app .ra-lw { grid-column: 1 / -1; }
#v8 #app .ra-lr .rkb-c { height: 16px; gap: 2px; }
#v8 #app .ra-lr .rkb-c > i { width: 6px; }
#v8 #app .ra-lr .rkb-c > i:nth-child(1) { height: 7px; }
#v8 #app .ra-lr .rkb-c > i:nth-child(2) { height: 11px; }
#v8 #app .ra-lr .rkb-c > i:nth-child(3) { height: 16px; }
#v8 #app .ra-lr .rkb { gap: 8px; }
#v8 #app .ra-ln { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 700 !important; }
#v8 #app .ra-lw { font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; color: var(--v8-ink-2); }
#v8 #app .ra-lr .rkb-w { font-size: var(--v8-fs-16) !important; font-weight: 400 !important; }
@media (hover: hover) { #v8 #app .ra-li:hover { background: var(--v8-hover); } #v8 #app .ra-li[aria-checked="true"]:hover { background: var(--v8-sel); box-shadow: var(--v8-st-sel-hover); } }
#v8 #app .ra-li[aria-checked="true"] { background: var(--v8-sel); box-shadow: var(--v8-st-sel); }
#v8 #app .ra-li:focus, #v8 #app .ra-li:focus-visible { outline: none !important; }
#v8 #app .ra-li:focus-visible { position: relative; z-index: 1; box-shadow: var(--v8-st-focus); }
#v8 #app .ra-li[aria-checked="true"]:focus-visible { background: var(--v8-sel); box-shadow: var(--v8-st-sel-focus); }
#v8 #app .ra-list[hidden], #v8 #app .ra-map[hidden] { display: none; }

/* The detail: the event's sentence, its level and what the level means, the insurance, the examples table Janne likes */
#v8 #app .ra-dt { container: radt / inline-size; min-width: 0; }
#v8 #app .ra-dh { display: flex; align-items: flex-start; gap: 12px; }
#v8 #app .ra-dic { flex: none; display: grid; place-items: center; width: 24px; height: 28px; }
#v8 #app .ra-dic svg { width: 24px; height: 24px; fill: currentColor; }
#v8 #app .cr h3.ra-dt-h { font-size: var(--v8-fs-20) !important; line-height: var(--v8-lh-lead) !important; font-weight: 700 !important; color: var(--v8-ink); outline: none; }
#v8 #app .ra-dlv { margin: var(--v8-3) 0 0; }
#v8 #app .cr p.ra-dlv-w { margin: 0 !important; }
#v8 #app .ra-dlv .rkb-w { font-size: var(--v8-fs-16) !important; font-weight: 700 !important; }
#v8 #app .cr p.ra-why { margin: var(--v8-2) 0 0 !important; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; color: var(--v8-ink); max-width: var(--v8-measure); }
#v8 #app .ra-ins { display: flex; flex-wrap: wrap; align-items: center; gap: var(--v8-2) var(--v8-4); margin: var(--v8-4) 0 0; padding: var(--v8-4) 0 0; border-top: 1px solid var(--v8-line); }
#v8 #app .cr p.ra-may { flex: 1 1 100%; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; }
#v8 #app .ra-has { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; }
#v8 #app .ra-has svg { width: 20px; height: 20px; flex: none; }
#v8 #app .ra-has-y { color: var(--v8-green-t); }
#v8 #app .ra-has-y svg { fill: var(--v8-green-t); }
#v8 #app .ra-has-n { color: var(--v8-ink-2); }
#v8 #app .ra-has-n svg { fill: var(--v8-ink-2); }
/* Insured for less than she told us: the coverage card's sentence, right under You have it, before the action */
#v8 #app .cr p.ra-amt { flex: 1 1 100%; margin: 0 !important; font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; color: var(--v8-ink); }
#v8 #app .ra-amt ~ .ra-act { flex: 1 1 100%; }
#v8 #app .ra-act { display: flex; align-items: center; }
#v8 #app .ra-act .v8-link { min-height: 44px; display: inline-flex; align-items: center; font-size: var(--v8-fs-16) !important; font-weight: 400 !important; }
#v8 #app .cr p.ra-needs { color: var(--v8-ink-2); font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; }

/* The examples table, and the map's legend: a solid green dot before the example the pill sits on, a green ring before each one
   drawn as a ring (both as the map draws them) */
#v8 #app table.ra-ex { width: 100%; margin: var(--v8-5) 0 0; border-collapse: collapse; }
#v8 #app table.ra-ex :is(.ra-hv, .ra-ho, .ra-hi, .ra-v, .ra-o, .ra-im) { white-space: nowrap; }
#v8 #app table.ra-ex th, #v8 #app table.ra-ex td { text-align: left; padding: 10px 12px 10px 0; vertical-align: middle; color: var(--v8-ink); font-size: var(--v8-fs-16) !important; line-height: var(--v8-lh-16) !important; font-weight: 400 !important; border-top: 1px solid var(--v8-line); }
#v8 #app table.ra-ex thead th { font-weight: 700 !important; border-top: 0; padding-bottom: 6px; }
#v8 #app table.ra-ex th.ra-hx { padding-left: 22px; }
#v8 #app table.ra-ex td.ra-v { font-weight: 700 !important; white-space: nowrap; }
#v8 #app table.ra-ex td.ra-im { padding-right: 0; }
#v8 #app .ra-exw { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 10px; align-items: start; }
#v8 #app .ra-exw > :not(.ra-mk) { grid-column: 2; }
#v8 #app .ra-exw > .st-src { justify-self: start; }
#v8 #app .ra-mk { grid-column: 1; grid-row: 1; width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; }
#v8 #app .ra-mk-at { background: var(--v8-green); }
#v8 #app .ra-mk-ring { background: #fff; box-shadow: inset 0 0 0 2px var(--v8-green); }
#v8 #app .ra-ext { display: block; }
#v8 #app .ra-ex .st-imp-c > i { width: 16px; }
#v8 #app .ra-ex .st-imp { gap: 8px; }
#v8 #app .ra-ex .st-imp b { min-width: 76px; }   /* the capsules line up from row to row whatever the word */

/* A narrow detail (beside the map, or a phone): Example and Impact on your business head the two sides; each example is its marker
   and name, then its cost and how often (they read for themselves; their heads stay for screen readers) with the impact at the
   right. The cost line starts at the row's edge, under the marker: indented, it pushed the impact onto a line of its own at 390 */
@container radt (max-width: 640px) {
  #v8 #app table.ra-ex, #v8 #app table.ra-ex thead, #v8 #app table.ra-ex tbody { display: block; }
  #v8 #app table.ra-ex tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--v8-2); padding: var(--v8-3) 0; border-top: 1px solid var(--v8-line); }
  #v8 #app table.ra-ex thead tr { border-top: 0; padding: 0 0 6px; justify-content: space-between; }
  #v8 #app table.ra-ex th, #v8 #app table.ra-ex td { display: block; padding: 0; border-top: 0; }
  #v8 #app table.ra-ex thead th { width: auto !important; }
  #v8 #app table.ra-ex th.ra-hx { padding-left: 22px; }
  #v8 #app table.ra-ex :is(.ra-hv, .ra-ho) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #v8 #app table.ra-ex.ra-noimp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #v8 #app table.ra-ex th[scope="row"] { flex: 1 1 100%; }
  #v8 #app table.ra-ex td.ra-o { color: var(--v8-ink-2); }
  #v8 #app table.ra-ex td.ra-im { margin-left: auto; }
  #v8 #app .ra-ex .st-imp-c > i { width: 12px; }
  #v8 #app .ra-ex .st-imp b { min-width: 72px; }
}
/* The narrowest detail (a 320 phone): no head row; each impact says what it is, as the levels card does on a phone */
@container radt (max-width: 300px) {
  #v8 #app table.ra-ex thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #v8 #app table.ra-ex td.ra-im { flex: 1 1 100%; margin-left: 0; display: flex; flex-wrap: wrap; gap: 4px; }
  #v8 #app table.ra-ex td.ra-im::before { content: "Impact on your business" / ""; flex: 1 1 100%; color: var(--v8-ink-2); }
}
