/* ============================================================
   BSLR — interactive risk matrix widget
   Loaded only by /modules/risk-assessment.html. Every rule is scoped
   under .rmx so nothing collides with bslr.css or capture-demo.css.
   Adapted from the supplied widget; values and behaviour unchanged.
   ============================================================ */

.rmx{
  --rbrand:#336380; --rbrand-2:#2C5670; --rcta:#EC8822; --rink:#1E1B2E;
  --rmuted:#64748B; --rred:#DC2626; --ramber:#D97706; --rgreen:#16A34A;
  --rborder:#E2E8F0; --rsoft:#F8FAFC; --rtint:#EEF4F7; --rtintb:#CDDDE6;
  display:flex; flex-direction:column; align-items:center; gap:14px; margin-top:44px;
}
.rmx *{ box-sizing:border-box }

.rmx .widget{
  width:100%; max-width:760px; background:#fff; border:1px solid var(--rborder);
  border-radius:12px; overflow:hidden; box-shadow:0 10px 30px rgba(30,27,46,.10);
}
.rmx .whead{
  background:var(--rbrand); color:#fff; display:flex; align-items:center; gap:10px;
  padding:12px 18px; flex-wrap:wrap;
}
.rmx .whead .logo{ font-weight:700; letter-spacing:2px; font-size:15px }
.rmx .whead .mod{ font-size:12.5px; color:#D8E4EB }
.rmx .whead .tchip{ margin-left:auto; font-size:11px; background:rgba(255,255,255,.16); border-radius:99px; padding:4px 11px }
.rmx .wbody{ padding:18px }
.rmx .qt{ font-size:15px; font-weight:700; color:var(--rink) }
.rmx .qs{ font-size:12px; color:var(--rmuted); margin-top:3px; line-height:1.5 }

.rmx .grp{ margin-top:15px }
.rmx .gl{ font-size:10.5px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:var(--rmuted); margin-bottom:7px }
.rmx .chips{ display:flex; gap:7px; flex-wrap:wrap }
.rmx .chip{
  border:1px solid var(--rborder); background:#fff; border-radius:8px; padding:7px 11px;
  font-size:12px; font-weight:600; color:#334155; cursor:pointer; text-align:left;
  font-family:inherit; transition:border-color .12s ease, background-color .12s ease;
}
.rmx .chip:hover{ border-color:var(--rbrand) }
.rmx .chip small{ display:block; font-weight:400; font-size:10px; color:var(--rmuted); margin-top:2px }
.rmx .chip.on{ border-color:var(--rbrand); background:var(--rtint); color:var(--rbrand-2); box-shadow:inset 0 0 0 1px var(--rbrand) }
.rmx .chip.on small{ color:var(--rbrand-2) }

.rmx .ctl{
  margin-top:14px; display:flex; align-items:center; gap:10px; width:100%;
  border:1px dashed var(--rtintb); background:var(--rsoft); border-radius:8px;
  padding:10px 13px; cursor:pointer; user-select:none; font-family:inherit;
  text-align:left; color:var(--rink);
}
.rmx .ctl:hover{ border-color:var(--rbrand) }
.rmx .ctl .box{
  width:17px; height:17px; border:2px solid var(--rbrand); border-radius:4px; flex:none;
  display:flex; align-items:center; justify-content:center; font-size:11px; color:#fff; background:#fff;
}
.rmx .ctl.on .box{ background:var(--rbrand) }
.rmx .ctl .cl{ font-size:12.5px; font-weight:600 }
.rmx .ctl .cl small{ display:block; font-weight:400; font-size:11px; color:var(--rmuted); margin-top:2px; line-height:1.45 }

.rmx .out{ display:grid; grid-template-columns:200px 1fr; gap:16px; margin-top:16px; align-items:start }

/* matrix */
.rmx .mx{ display:grid; grid-template-columns:repeat(5,34px); grid-auto-rows:34px; gap:3px; position:relative }
.rmx .cell{ border-radius:5px; position:relative }
.rmx .b1{ background:#EDF2F5 } .rmx .b2{ background:#FDF6D8 }
.rmx .b3{ background:#FBE3CB } .rmx .b4{ background:#F6CFCB }
.rmx .cell .dot{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center }
.rmx .dot .inh{ width:14px; height:14px; border-radius:50%; border:2.5px solid var(--rbrand-2); background:transparent }
.rmx .dot .res{ width:14px; height:14px; border-radius:50%; background:var(--rbrand) }
.rmx .axl{ font-size:9.5px; color:#94a3b8; text-align:center; margin-top:5px }
.rmx .axv{ font-size:9.5px; color:#94a3b8; writing-mode:vertical-rl; transform:rotate(180deg); margin-right:5px; text-align:center }
.rmx .mxwrap{ display:flex }
.rmx .legend{ display:flex; gap:10px; font-size:10px; color:var(--rmuted); margin-top:8px; flex-wrap:wrap }
.rmx .legend .lg{ display:flex; align-items:center; gap:5px }
.rmx .sw{ width:10px; height:10px; border-radius:3px }

/* score tiles */
.rmx .scores{ display:flex; gap:10px; flex-wrap:wrap }
.rmx .stile{ flex:1; min-width:150px; border:1px solid var(--rborder); border-radius:9px; padding:11px 13px }
.rmx .stile .sl{ font-size:10px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:var(--rmuted) }
.rmx .stile .sv{ font-size:25px; font-weight:700; margin-top:4px; color:var(--rink) }
.rmx .stile .calc{ font-size:10.5px; color:var(--rmuted); margin-top:2px }
.rmx .band{ display:inline-block; font-size:10px; font-weight:800; letter-spacing:.5px; text-transform:uppercase; border-radius:4px; padding:3px 8px; margin-top:6px }
.rmx .bd-low{ background:#f0f4f8; color:#334155 }
.rmx .bd-med{ background:#fef9e7; color:#713f12 }
.rmx .bd-high{ background:#fef0e6; color:#7c2d12 }
.rmx .bd-crit{ background:#fcebeb; color:#791f1f }
.rmx .stile.res-t{ border-color:var(--rtintb); background:var(--rsoft) }
.rmx .stile.hide{ display:none }

/* verification gate */
.rmx .gate{ margin-top:12px; border-radius:9px; padding:12px 14px; font-size:12.5px; line-height:1.55; border:1px solid }
.rmx .gate b{ display:block; font-size:11px; letter-spacing:.5px; text-transform:uppercase; margin-bottom:4px }
.rmx .gate.on{ background:#FEF6F6; border-color:#F3D9D9; color:#5B2020 }
.rmx .gate.on b{ color:#791f1f }
.rmx .gate.off{ background:var(--rsoft); border-color:var(--rborder); color:var(--rmuted) }
.rmx .gate.off b{ color:#64748B }
.rmx .vrow{ margin-top:9px; display:flex; gap:8px; align-items:center }
.rmx .vrow .vf{ flex:1; border:1px solid #F3D9D9; background:#fff; border-radius:6px; padding:8px 11px; font-size:12px; color:#334155 }
.rmx .vrow .vf b{ display:inline; font-size:12px; text-transform:none; letter-spacing:0; color:var(--rink); margin:0 }

.rmx .wfoot{ padding:10px 18px; background:var(--rsoft); border-top:1px solid var(--rborder); font-size:10.5px; color:#64748B; line-height:1.5 }

/* caption under the widget */
.rmx .caption{ max-width:760px; width:100%; font-size:12px; color:#64748B; display:flex; gap:10px; align-items:center; flex-wrap:wrap }
.rmx .rbadge{
  font-size:10px; font-weight:800; letter-spacing:.5px; text-transform:uppercase;
  color:#7c2d12; background:#fef0e6; border:1px solid #fed7aa; border-radius:4px;
  padding:3px 8px; white-space:nowrap;
}

@media (max-width:640px){
  .rmx{ margin-top:32px }
  .rmx .wbody{ padding:14px }
  .rmx .out{ grid-template-columns:1fr; gap:18px }
  /* Keep the fixed 34px cells: .mx sits inside a flex .mxwrap, so 1fr tracks
     have no basis to resolve against and collapse to ~10px per cell.
     5x34 + 4x3 gap = 182px, which fits a 375px viewport comfortably. */
  .rmx .stile{ min-width:0 }
}
