/* Herotec R-P04 – editorial and tool styles. All selectors are scoped. */
#herotec-rp04-article,
#herotec-risk-matrix-5x5 {
  box-sizing: border-box;
  color: #233247;
  font-family: inherit;
  line-height: 1.9;
  max-width: 100%;
}
#herotec-rp04-article *,
#herotec-rp04-article *::before,
#herotec-rp04-article *::after,
#herotec-risk-matrix-5x5 *,
#herotec-risk-matrix-5x5 *::before,
#herotec-risk-matrix-5x5 *::after { box-sizing: border-box; }

#herotec-rp04-article { --rp04-navy:#17365d; --rp04-teal:#247e78; --rp04-ink:#233247; --rp04-muted:#607086; --rp04-line:#dce4ec; --rp04-soft:#f5f8fb; }
#herotec-rp04-article .hr04-shell { width: min(100%, 980px); margin-inline: auto; }
#herotec-rp04-article .hr04-hero { display:block; padding:clamp(22px,4vw,42px); border:1px solid var(--rp04-line); border-top:5px solid var(--rp04-navy); background:linear-gradient(145deg,#f8fbfd,#fff 62%); border-radius:12px; margin:0 0 30px; }
#herotec-rp04-article .hr04-kicker,#herotec-rp04-article .hr04-overline { color:var(--rp04-teal); font-weight:800; letter-spacing:.02em; margin:0 0 8px; }
#herotec-rp04-article .hr04-lead { font-size:1.12rem; line-height:2; margin:10px 0 18px; color:#32445a; }
#herotec-rp04-article .hr04-hero-visual { display:block; float:none; clear:both; width:100%; margin:22px auto; padding:16px; border:1px solid var(--rp04-line); border-radius:10px; background:#fff; }
#herotec-rp04-article .hr04-visual-title { color:var(--rp04-navy); font-weight:800; margin-bottom:12px; }
#herotec-rp04-article .hr04-visual-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; direction:ltr; }
#herotec-rp04-article .hr04-visual-grid span { display:grid; place-items:center; min-height:34px; border-radius:5px; font-size:.84rem; font-weight:800; }
#herotec-rp04-article .hr04-visual-grid .low { background:#e2f1e8; color:#28634b; }
#herotec-rp04-article .hr04-visual-grid .watch { background:#f7f0d7; color:#715b20; }
#herotec-rp04-article .hr04-visual-grid .caution { background:#f9e5cf; color:#8a4f21; }
#herotec-rp04-article .hr04-visual-grid .high { background:#f4dada; color:#8f3030; }
#herotec-rp04-article .hr04-visual-note { color:var(--rp04-muted); font-size:.88rem; margin:10px 0 0; }
#herotec-rp04-article .hr04-hero-deck { margin:18px 0 0; font-weight:600; }
#herotec-rp04-article .hr04-meta { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
#herotec-rp04-article .hr04-meta span { border:1px solid var(--rp04-line); background:#fff; color:var(--rp04-muted); border-radius:999px; padding:3px 12px; font-size:.85rem; }
#herotec-rp04-article .hr04-section { margin:30px 0; }
#herotec-rp04-article .hr04-section > h2 { color:var(--rp04-navy); font-size:clamp(1.25rem,2.3vw,1.65rem); line-height:1.55; margin:0 0 14px; padding-bottom:9px; border-bottom:1px solid var(--rp04-line); }
#herotec-rp04-article h3 { color:#25415f; font-size:1.12rem; margin:22px 0 8px; }
#herotec-rp04-article p { margin:0 0 14px; }
#herotec-rp04-article ul,#herotec-rp04-article ol { padding-inline-start:1.5rem; margin:8px 0 16px; }
#herotec-rp04-article li { margin:5px 0; }
#herotec-rp04-article a { color:#145f75; text-decoration:underline; text-underline-offset:3px; }
#herotec-rp04-article .hr04-summary { border:1px solid var(--rp04-line); background:var(--rp04-soft); border-radius:10px; padding:18px 22px; }
#herotec-rp04-article .hr04-summary ul { margin-bottom:0; }
#herotec-rp04-article .hr04-toc { border-inline-start:4px solid var(--rp04-teal); padding:12px 18px; background:#fbfcfd; }
#herotec-rp04-article .hr04-toc ol { columns:2; column-gap:32px; margin-bottom:0; }
#herotec-rp04-article .hr04-toc li { break-inside:avoid; }
#herotec-rp04-article .hr04-note { border-inline-start:4px solid #c18a42; background:#fbf7ef; padding:14px 18px; margin:18px 0; }
#herotec-rp04-article .hr04-formula { border:1px solid #d3e0ea; border-radius:10px; padding:18px; background:#f6fafc; text-align:center; margin:18px 0; }
#herotec-rp04-article .hr04-formula strong { display:block; font-size:clamp(1.2rem,3vw,1.65rem); color:var(--rp04-navy); direction:ltr; }
#herotec-rp04-article .hr04-formula small { display:block; color:var(--rp04-muted); margin-top:8px; }
#herotec-rp04-article .hr04-table-wrap { width:100%; overflow-x:auto; margin:16px 0; }
#herotec-rp04-article table { border-collapse:collapse; width:100%; min-width:560px; }
#herotec-rp04-article th,#herotec-rp04-article td { border:1px solid var(--rp04-line); padding:9px 11px; text-align:right; vertical-align:top; }
#herotec-rp04-article th { background:#edf3f8; color:#243f5c; }
#herotec-rp04-article .hr04-scenario-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:16px 0; }
#herotec-rp04-article .hr04-scenario { border:1px solid var(--rp04-line); border-radius:9px; padding:15px; background:#fff; }
#herotec-rp04-article .hr04-scenario h3 { margin:0 0 8px; }
#herotec-rp04-article .hr04-score { display:inline-block; direction:ltr; padding:2px 9px; border-radius:999px; background:#edf3f8; color:#203e5c; font-weight:800; margin:6px 0; }
#herotec-rp04-article .hr04-checklist { list-style:none; padding:0; }
#herotec-rp04-article .hr04-checklist li { padding-inline-start:26px; position:relative; }
#herotec-rp04-article .hr04-checklist li::before { content:"□"; position:absolute; inset-inline-start:0; color:var(--rp04-teal); font-weight:800; }
#herotec-rp04-article .hr04-faq details { border-bottom:1px solid var(--rp04-line); padding:12px 0; }
#herotec-rp04-article .hr04-faq summary { cursor:pointer; font-weight:800; color:#294968; }
#herotec-rp04-article .hr04-cta { border:1px solid #d3e0ea; border-radius:10px; padding:20px; background:#f5f9fb; margin:28px 0; }
#herotec-rp04-article .hr04-cta a { display:inline-block; margin-top:6px; font-weight:800; }
#herotec-rp04-article .hr04-source-list { font-size:.94rem; color:#4d5f74; }

/* Tool scope */
#herotec-risk-matrix-5x5 { --hrm-navy:#17365d; --hrm-teal:#247e78; --hrm-ink:#233247; --hrm-muted:#607086; --hrm-line:#dce4ec; --hrm-soft:#f5f8fb; border:1px solid var(--hrm-line); border-radius:14px; padding:clamp(14px,2.5vw,24px); background:#fff; margin:26px 0; }
#herotec-risk-matrix-5x5 button,#herotec-risk-matrix-5x5 input,#herotec-risk-matrix-5x5 select,#herotec-risk-matrix-5x5 textarea { font:inherit; max-width:100%; }
#herotec-risk-matrix-5x5 button { cursor:pointer; }
#herotec-risk-matrix-5x5 button:focus-visible,#herotec-risk-matrix-5x5 input:focus-visible,#herotec-risk-matrix-5x5 select:focus-visible,#herotec-risk-matrix-5x5 textarea:focus-visible,#herotec-risk-matrix-5x5 summary:focus-visible { outline:3px solid #2a7da0; outline-offset:2px; }
#herotec-risk-matrix-5x5 .hrm-tool-heading { border-bottom:1px solid var(--hrm-line); padding-bottom:14px; margin-bottom:16px; }
#herotec-risk-matrix-5x5 .hrm-tool-kicker { color:var(--hrm-teal); font-size:.82rem; font-weight:800; margin:0 0 5px; }
#herotec-risk-matrix-5x5 .hrm-tool-heading h2 { color:var(--hrm-navy); font-size:clamp(1.25rem,2.2vw,1.7rem); margin:0 0 7px; line-height:1.4; }
#herotec-risk-matrix-5x5 .hrm-tool-heading p { margin:0; color:var(--hrm-muted); }
#herotec-risk-matrix-5x5 .hrm-tool-actions { display:flex; flex-wrap:wrap; gap:8px; margin:14px 0; }
#herotec-risk-matrix-5x5 .hrm-btn { border:1px solid #b9c8d7; background:#fff; color:#233d5a; border-radius:7px; padding:8px 13px; font-weight:700; }
#herotec-risk-matrix-5x5 .hrm-btn-primary { color:#fff; background:var(--hrm-navy); border-color:var(--hrm-navy); }
#herotec-risk-matrix-5x5 .hrm-btn-danger { color:#8d3535; border-color:#e4bcbc; }
#herotec-risk-matrix-5x5 .hrm-btn-small { font-size:.88rem; padding:5px 10px; }
#herotec-risk-matrix-5x5 .hrm-btn:disabled { opacity:.45; cursor:not-allowed; }
#herotec-risk-matrix-5x5 .hrm-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; margin:16px 0; }
#herotec-risk-matrix-5x5 .hrm-kpi { border:1px solid var(--hrm-line); border-radius:8px; padding:10px; background:var(--hrm-soft); min-width:0; }
#herotec-risk-matrix-5x5 .hrm-kpi span { display:block; color:var(--hrm-muted); font-size:.78rem; }
#herotec-risk-matrix-5x5 .hrm-kpi strong { display:block; color:var(--hrm-navy); font-size:1.35rem; line-height:1.4; }
#herotec-risk-matrix-5x5 .hrm-section-title { color:var(--hrm-navy); font-size:1.15rem; margin:22px 0 10px; }
#herotec-risk-matrix-5x5 .hrm-matrix-panel { border:1px solid var(--hrm-line); border-radius:10px; padding:12px; background:#fbfcfd; }
#herotec-risk-matrix-5x5 .hrm-matrix-axis { text-align:center; color:#435a71; font-size:.88rem; font-weight:700; margin:0 0 8px; }
#herotec-risk-matrix-5x5 .hrm-matrix-grid { display:grid; grid-template-columns:60px repeat(5,minmax(0,1fr)); gap:5px; direction:ltr; width:100%; }
#herotec-risk-matrix-5x5 .hrm-matrix-corner,#herotec-risk-matrix-5x5 .hrm-matrix-head,#herotec-risk-matrix-5x5 .hrm-matrix-rowhead { display:flex; align-items:center; justify-content:center; text-align:center; font-size:.78rem; line-height:1.25; padding:4px; color:#344c65; font-weight:800; }
#herotec-risk-matrix-5x5 .hrm-matrix-head { background:#eaf0f5; border-radius:5px; min-height:30px; }
#herotec-risk-matrix-5x5 .hrm-matrix-rowhead { background:#eaf0f5; border-radius:5px; direction:rtl; font-size:.7rem; }
#herotec-risk-matrix-5x5 .hrm-matrix-cell { min-width:0; min-height:54px; padding:3px; border:1px solid rgba(29,55,80,.13); border-radius:6px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; color:#24364a; }
#herotec-risk-matrix-5x5 .hrm-cell-score { font-size:1rem; line-height:1.15; }
#herotec-risk-matrix-5x5 .hrm-cell-count { font-size:.62rem; line-height:1.3; opacity:.8; }
#herotec-risk-matrix-5x5 .hrm-cell-low,#herotec-risk-matrix-5x5 .hrm-level-low { background:#e2f1e8; color:#28634b; }
#herotec-risk-matrix-5x5 .hrm-cell-watch,#herotec-risk-matrix-5x5 .hrm-level-watch { background:#f7f0d7; color:#715b20; }
#herotec-risk-matrix-5x5 .hrm-cell-caution,#herotec-risk-matrix-5x5 .hrm-level-caution { background:#f9e5cf; color:#8a4f21; }
#herotec-risk-matrix-5x5 .hrm-cell-high,#herotec-risk-matrix-5x5 .hrm-level-high { background:#f4dada; color:#8f3030; }
#herotec-risk-matrix-5x5 .hrm-cell-unrated,#herotec-risk-matrix-5x5 .hrm-level-unrated,#herotec-risk-matrix-5x5 .hrm-level-neutral { background:#edf1f5; color:#46566a; }
#herotec-risk-matrix-5x5 .hrm-matrix-cell.is-selected { outline:3px solid #17365d; outline-offset:1px; box-shadow:0 0 0 2px #fff inset; }
#herotec-risk-matrix-5x5 .hrm-matrix-legend { display:flex; flex-wrap:wrap; gap:7px 14px; margin-top:10px; font-size:.79rem; color:#52657b; }
#herotec-risk-matrix-5x5 .hrm-matrix-legend span { display:inline-flex; align-items:center; gap:5px; }
#herotec-risk-matrix-5x5 .hrm-swatch { width:12px; height:12px; border-radius:3px; display:inline-block; border:1px solid rgba(0,0,0,.08); }
#herotec-risk-matrix-5x5 .hrm-cell-details { border-top:1px solid var(--hrm-line); margin-top:12px; padding-top:10px; }
#herotec-risk-matrix-5x5 .hrm-cell-details h4 { margin:0 0 8px; color:#2a4663; font-size:1rem; }
#herotec-risk-matrix-5x5 .hrm-cell-risk { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 10px; align-items:center; padding:8px 0; border-bottom:1px solid #e9eef3; }
#herotec-risk-matrix-5x5 .hrm-cell-risk span { color:var(--hrm-muted); font-size:.86rem; }
#herotec-risk-matrix-5x5 .hrm-cell-risk button { grid-column:2; grid-row:1 / span 2; }
#herotec-risk-matrix-5x5 .hrm-band-settings { margin:15px 0; padding:12px 14px; border:1px solid var(--hrm-line); border-radius:8px; }
#herotec-risk-matrix-5x5 .hrm-band-settings summary { font-weight:800; color:#2d4967; cursor:pointer; }
#herotec-risk-matrix-5x5 .hrm-band-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-top:12px; }
#herotec-risk-matrix-5x5 .hrm-field { min-width:0; margin:0 0 12px; }
#herotec-risk-matrix-5x5 .hrm-field label { display:block; font-weight:800; color:#314a63; margin:0 0 5px; }
#herotec-risk-matrix-5x5 .hrm-field small { display:block; color:var(--hrm-muted); font-size:.78rem; margin-top:3px; }
#herotec-risk-matrix-5x5 input[type="text"],#herotec-risk-matrix-5x5 input[type="number"],#herotec-risk-matrix-5x5 select,#herotec-risk-matrix-5x5 textarea { display:block; width:100%; border:1px solid #c8d3de; border-radius:6px; padding:9px 10px; color:#233247; background:#fff; min-height:42px; }
#herotec-risk-matrix-5x5 textarea { min-height:82px; resize:vertical; }
#herotec-risk-matrix-5x5 .hrm-form-panel { padding:16px; background:#f8fafc; border:1px solid var(--hrm-line); border-radius:10px; margin-top:16px; }
#herotec-risk-matrix-5x5 .hrm-form-panel h3 { color:var(--hrm-navy); margin:0 0 14px; font-size:1.12rem; }
#herotec-risk-matrix-5x5 .hrm-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px; }
#herotec-risk-matrix-5x5 .hrm-field-full { grid-column:1 / -1; }
#herotec-risk-matrix-5x5 .hrm-inline-check { display:flex; gap:8px; align-items:flex-start; margin:8px 0 12px; font-weight:700; }
#herotec-risk-matrix-5x5 .hrm-inline-check input { width:18px; height:18px; flex:0 0 auto; margin-top:5px; }
#herotec-risk-matrix-5x5 .hrm-form-errors,#herotec-risk-matrix-5x5 .hrm-feedback { padding:10px 13px; margin:10px 0; border-radius:7px; background:#f9e5cf; color:#783d18; }
#herotec-risk-matrix-5x5 .hrm-form-errors ul { margin:0; padding-inline-start:1.3rem; }
#herotec-risk-matrix-5x5 .hrm-feedback.is-success { background:#e2f1e8; color:#28634b; }
#herotec-risk-matrix-5x5 .hrm-feedback.is-error { background:#f4dada; color:#8f3030; }
#herotec-risk-matrix-5x5 .hrm-feedback.is-info { background:#eaf1f7; color:#2d4f70; }
#herotec-risk-matrix-5x5 .hrm-list-tools { display:grid; grid-template-columns:minmax(0,1.5fr) repeat(2,minmax(0,1fr)); gap:9px; margin:14px 0; }
#herotec-risk-matrix-5x5 .hrm-risk-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
#herotec-risk-matrix-5x5 .hrm-risk-card { border:1px solid var(--hrm-line); border-radius:9px; padding:12px; min-width:0; background:#fff; }
#herotec-risk-matrix-5x5 .hrm-card-top { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
#herotec-risk-matrix-5x5 .hrm-risk-id { display:block; font-size:.75rem; color:var(--hrm-muted); direction:ltr; text-align:right; }
#herotec-risk-matrix-5x5 .hrm-card-title-wrap h4 { margin:2px 0 0; color:#25415f; line-height:1.45; font-size:1rem; }
#herotec-risk-matrix-5x5 .hrm-level-badge { display:inline-block; border-radius:999px; padding:2px 8px; font-size:.75rem; font-weight:800; white-space:normal; text-align:center; }
#herotec-risk-matrix-5x5 .hrm-card-description { color:#52657a; margin:9px 0; font-size:.9rem; }
#herotec-risk-matrix-5x5 .hrm-card-meta { display:flex; flex-wrap:wrap; gap:5px 12px; color:#3e566f; font-size:.82rem; margin:8px 0; }
#herotec-risk-matrix-5x5 .hrm-card-line { margin:5px 0; color:#50637a; font-size:.86rem; }
#herotec-risk-matrix-5x5 .hrm-redline-note { border-inline-start:3px solid #9b3434; padding:4px 9px; color:#8b3030; background:#fbf0f0; margin:7px 0; font-size:.85rem; }
#herotec-risk-matrix-5x5 .hrm-residual-compare { display:grid; gap:4px; padding:9px; margin-top:9px; border-radius:6px; background:#f3f6f9; font-size:.82rem; color:#314a63; }
#herotec-risk-matrix-5x5 .hrm-card-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
#herotec-risk-matrix-5x5 .hrm-muted { color:var(--hrm-muted); margin:6px 0; }
#herotec-risk-matrix-5x5 .hrm-top-risks { display:grid; gap:5px; }
#herotec-risk-matrix-5x5 .hrm-top-row { display:grid; grid-template-columns:28px minmax(0,1fr) auto auto; gap:8px; align-items:center; padding:8px; border-bottom:1px solid #e8edf2; }
#herotec-risk-matrix-5x5 .hrm-rank { display:grid; place-items:center; border-radius:50%; width:24px; height:24px; background:#eaf0f5; font-weight:800; }
#herotec-risk-matrix-5x5 .hrm-privacy-note { margin-top:16px; padding:11px 14px; border-inline-start:4px solid var(--hrm-teal); background:#f2f8f7; color:#395c5a; font-size:.87rem; }
#herotec-risk-matrix-5x5 [hidden] { display:none !important; }

@media (max-width:760px) {
  #herotec-rp04-article .hr04-toc ol { columns:1; }
  #herotec-rp04-article .hr04-scenario-list { grid-template-columns:1fr; }
  #herotec-risk-matrix-5x5 .hrm-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #herotec-risk-matrix-5x5 .hrm-risk-list { grid-template-columns:1fr; }
  #herotec-risk-matrix-5x5 .hrm-matrix-grid { grid-template-columns:50px repeat(5,minmax(0,1fr)); gap:4px; }
  #herotec-risk-matrix-5x5 .hrm-matrix-cell { min-height:49px; }
  #herotec-risk-matrix-5x5 .hrm-matrix-rowhead { font-size:.65rem; padding:3px 1px; }
  #herotec-risk-matrix-5x5 .hrm-list-tools { grid-template-columns:1fr 1fr; }
  #herotec-risk-matrix-5x5 #hrm-search { grid-column:1 / -1; }
}
@media (max-width:430px) {
  #herotec-rp04-article .hr04-hero { padding:18px; }
  #herotec-risk-matrix-5x5 { padding:10px; border-radius:10px; }
  #herotec-risk-matrix-5x5 .hrm-matrix-grid { grid-template-columns:42px repeat(5,minmax(0,1fr)); gap:3px; }
  #herotec-risk-matrix-5x5 .hrm-matrix-cell { min-height:43px; border-radius:4px; }
  #herotec-risk-matrix-5x5 .hrm-cell-score { font-size:.9rem; }
  #herotec-risk-matrix-5x5 .hrm-cell-count { font-size:.56rem; }
  #herotec-risk-matrix-5x5 .hrm-matrix-corner,#herotec-risk-matrix-5x5 .hrm-matrix-head { font-size:.72rem; }
  #herotec-risk-matrix-5x5 .hrm-form-grid,#herotec-risk-matrix-5x5 .hrm-band-fields { grid-template-columns:1fr; }
  #herotec-risk-matrix-5x5 .hrm-top-row { grid-template-columns:24px minmax(0,1fr) auto; }
  #herotec-risk-matrix-5x5 .hrm-top-row button { grid-column:2 / -1; justify-self:start; }
  #herotec-risk-matrix-5x5 .hrm-cell-risk { grid-template-columns:1fr; }
  #herotec-risk-matrix-5x5 .hrm-cell-risk button { grid-column:auto; grid-row:auto; justify-self:start; }
}
@media print {
  #herotec-risk-matrix-5x5 { border:0; padding:0; color:#111; }
  #herotec-risk-matrix-5x5 .hrm-tool-actions,
  #herotec-risk-matrix-5x5 .hrm-form-panel,
  #herotec-risk-matrix-5x5 .hrm-band-settings,
  #herotec-risk-matrix-5x5 .hrm-list-tools,
  #herotec-risk-matrix-5x5 .hrm-card-actions,
  #herotec-risk-matrix-5x5 .hrm-cell-details button { display:none !important; }
  #herotec-risk-matrix-5x5 .hrm-risk-list { grid-template-columns:1fr 1fr; }
  #herotec-risk-matrix-5x5 .hrm-matrix-panel,#herotec-risk-matrix-5x5 .hrm-risk-card { break-inside:avoid; }
  #herotec-risk-matrix-5x5 .hrm-matrix-cell { print-color-adjust:exact; -webkit-print-color-adjust:exact; }
  #herotec-rp04-article .hr04-hero-visual { break-inside:avoid; }
}

/* Mobile tables become stacked cards instead of forcing page-level horizontal scroll. */
@media (max-width:760px) {
  #herotec-rp04-article .hr04-table-wrap { overflow:visible; }
  #herotec-rp04-article table { min-width:0; width:100%; display:block; }
  #herotec-rp04-article thead { display:none; }
  #herotec-rp04-article tbody { display:grid; gap:10px; }
  #herotec-rp04-article tbody tr { display:block; border:1px solid var(--rp04-line); border-radius:8px; overflow:hidden; background:#fff; }
  #herotec-rp04-article td { display:grid; grid-template-columns:minmax(82px,30%) minmax(0,1fr); gap:10px; width:100%; border:0; border-bottom:1px solid #edf1f5; padding:8px 10px; }
  #herotec-rp04-article td:last-child { border-bottom:0; }
  #herotec-rp04-article td::before { content:attr(data-label); font-weight:800; color:#314c67; }
}
