/* v17: scoped additions; existing RiskNET shell, typography and menus retained. */
.progress.shiny-file-input-progress:not(.rn-upload__progress) {
  height: 1.6rem !important;
  min-height: 1.6rem;
  margin-top: .5rem;
  margin-bottom: .35rem;
  border-radius: .45rem;
  background: #e5eaf2;
  overflow: hidden;
}
.shiny-file-input-progress:not(.rn-upload__progress) .progress-bar {
  height: 100% !important;
  min-height: 1.6rem;
  line-height: 1.6rem !important;
  font-size: .8rem;
  font-weight: 600;
  color: #172D57 !important;
  background-color: #F5B335 !important;
  text-align: center;
  white-space: nowrap;
}
.rn-upload-status {display: block; min-height: 1.25em; color: #172D57; font-size: .8rem; margin-top: .2rem;}
.rn-page-intro {max-width: 72rem; color: #64748b; line-height: 1.6; margin: 1rem 0 1.4rem;}
.rn-notice {padding: .9rem 1.1rem; border-radius: .8rem; line-height: 1.55; margin: 1rem 0;}
.rn-notice-success {background: #e7efed; color: #2b655b;}
.rn-notice-warning {background: #fbf3e2; color: #695016;}
.rn-table-exports {display: flex; align-items: center; justify-content:flex-end; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 0 0 .75rem; border-top: 0; background:transparent;}
.rn-table-exports a.btn {font-size: .78rem; padding: .36rem .7rem; border: 1px solid #cbd5e1; border-radius: .5rem; background: #fff; color: #284383; box-shadow: none;}
.rn-table-exports a.btn:hover {border-color: #284383; background: #f4f7fb;}
.rn-table-exports a.btn[aria-disabled="true"],
.rn-table-exports a.btn[aria-disabled="true"]:hover {border-color: #dce4ef; background: #f1f4f8; color: #5f6d80; cursor: not-allowed;}
.rn-table-exports a.btn:focus-visible, .rn-report-card a:focus-visible {outline: 3px solid #F5B335; outline-offset: 3px;}
.rn-preview-row {display: flex; flex-wrap: wrap; align-items: start; gap: 1rem; margin: .8rem 0 1.2rem;}
.rn-dist-preview {flex: 0 1 216px; width: 216px; margin: 0; padding: .4rem .6rem .6rem; border: 1px solid #dce4ef; border-radius: .7rem; background: #fff;}
.rn-dist-preview svg {display: block; width: 100%; height: 86px;}
.rn-dist-preview figcaption {display: flex; flex-direction: column; gap: .15rem; padding: 0 .2rem; line-height: 1.35; align-items: center; text-align: center;}
.rn-dist-preview strong {font-size: .75rem; color: #172D57; text-align: center; width: 100%;}
.rn-dist-preview small {font-size: .65rem; color: #64748b;}
.rn-mini-axis {fill: none; stroke: none;}
.rn-mini-curve {fill: none; stroke: #284383; stroke-width: 2.4; stroke-linejoin: round;}
.rn-mini-fill {fill: #284383; fill-opacity: .08; stroke: none;}
.rn-mini-line {fill: none; stroke: #284383; stroke-width: 7; stroke-linecap: round;}
.rn-examples-page > .rn-card, .rn-example-parameters, .rn-example-catalogue {padding: 1.5rem; margin: 0 0 1.5rem;}
.rn-example-selector .form-group {margin-bottom: 0;}
.rn-cause-event-effects {display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 0 0 1.5rem;}
.rn-cause-event-effects .rn-card {padding: 1.45rem; margin: 0;}
.rn-cause-event-effects h3 {font-size: 1.1rem; line-height: 1.35; margin: .85rem 0; color: #172D57;}
.rn-cause-event-effects p {font-size: .92rem; line-height: 1.6; color: #536176; margin-bottom: 0;}
.rn-event-card {border-top: 3px solid #F5B335 !important;}
.rn-mini-label {font-size: .66rem; letter-spacing: .1em; font-weight: 600; color: #284383;}
.rn-example-model {display: flex; flex-direction: column; gap: 1.1rem; padding: 1.5rem; margin: 0; height: 100%;}
.rn-example-model-content{display:flex;flex-direction:column;gap:1rem;flex:1;min-height:100%;}
.rn-example-model-content > div:first-child {flex: 1; min-width: 0;}
.rn-example-model-content > .rn-preview-row {margin-top:auto; justify-content:flex-start; align-items:flex-end;}
.rn-example-model h2 {font-size: 1.5rem; color: #172D57;}
.rn-example-model p {line-height: 1.6; margin-bottom: .6rem;}
.rn-example-model small, .rn-example-assumptions {color: #64748b;}
.rn-example-actions {display: flex; align-items: center; gap: 1.5rem; margin-top: 1rem; padding-top: 0;}
.rn-example-actions small {max-width: 38rem; color: #64748b;}
.rn-example-catalogue summary {color: #172D57; font-weight: 600; cursor: pointer;}
.rn-report-page .section-hero-title, .rn-examples-page .section-hero-title {font-size: clamp(1.8rem, 3vw, 2.65rem); line-height: 1.08; color: var(--rn-navy-900);}
@media (max-width: 1200px) {
  .rn-example-model {display: block;}
  .rn-example-model > .rn-preview-row {justify-content: flex-start;}
}
@media (max-width: 720px) {
  .rn-cause-event-effects {grid-template-columns: 1fr;}
  .rn-example-actions {flex-direction: column; align-items: stretch; gap: .8rem;}
  .rn-dist-preview {flex-basis: 180px; max-width: 100%;}
}

.rn-visually-hidden {position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important;}


/* Example revision 3: two-stage selection and model alternatives */
.rn-example-selector-grid {display:grid;grid-template-columns:minmax(220px,.8fr) minmax(320px,1.6fr);gap:1rem;align-items:end;}
.rn-example-selector-grid .form-group {margin-bottom:0;}
.rn-example-risk-type {display:inline-flex;align-items:center;padding:.38rem .72rem;border-radius:999px;background:rgba(245,179,53,.16);color:#172D57;font-size:.82rem;font-weight:800;margin:.1rem 0 .8rem;}
.rn-example-model-grid,.rn-example-parameter-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.5rem;align-items:start;margin:0 0 1.5rem;}
.rn-example-model-grid .rn-example-model {margin:0;display:flex;}
.rn-example-model-grid .rn-example-model .rn-preview-row {justify-content:flex-start;margin-top:1rem;}
.rn-example-model-primary {border-top:4px solid #284383;}
.rn-example-model-alternative {border-top:4px solid #F5B335;}
.rn-example-primary {border-top:4px solid #284383;}
.rn-example-alternative {border-top:4px solid #F5B335;}
.rn-example-assumption-card {margin:0 0 1.5rem!important;}
.rn-example-parameters {display:flex;flex-direction:column;min-height:0;}
.rn-example-parameters .table {margin-bottom:.25rem;}
.rn-example-selector {margin-bottom:1.5rem!important;}
.rn-example-actions .btn-secondary {background:#fff!important;color:#284383!important;border:1px solid #284383!important;border-radius:10px;font-weight:700;}
.rn-example-actions .btn-secondary:hover {background:#eef3fb!important;color:#172D57!important;}
@media(max-width:900px){.rn-example-selector-grid,.rn-example-model-grid,.rn-example-parameter-grid{grid-template-columns:1fr;}}

/* Example data-calibration alternative */
.rn-example-model-data{grid-column:1/-1;border-top:4px solid #2F7D66;background:linear-gradient(180deg,#fff,#f8fcfb);}
.rn-example-data-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(220px,.7fr);gap:1.5rem;align-items:center;}
.rn-example-data-copy{min-width:0;}
.rn-example-data-visual{display:flex;justify-content:flex-end;align-items:center;}
.rn-example-data-visual .rn-dist-preview{margin-left:auto;}
.rn-example-data-action{margin-top:1rem;}
.rn-data-calibration-preview .rn-data-bar{fill:rgba(245,179,53,.48);stroke:#E98A00;stroke-width:1;}
.rn-data-calibration-preview .rn-data-fit{fill:none;stroke:#284383;stroke-width:3;stroke-linecap:round;}
.rn-data-calibration-preview .rn-data-dot{fill:#172D57;}
@media(max-width:900px){.rn-example-model-data{grid-column:auto}.rn-example-data-layout{grid-template-columns:1fr}.rn-example-data-visual{justify-content:flex-start}.rn-example-data-visual .rn-dist-preview{margin-left:0;}}

/* Empirical XLSX/CSV preview */
.rn-empirical-preview{margin:1rem 0;padding:1rem;border:1px solid #dce4ef;border-radius:1rem;background:#f8fafc;}
.rn-empirical-preview .rn-subtitle{margin-top:0;}
.rn-table-scroll{max-width:100%;overflow:auto;border-radius:.7rem;background:#fff;}
.rn-table-scroll table{font-size:.86rem;white-space:nowrap;}

/* Revision 6: expanded export tables */
.export-workbench-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
.export-workbench-grid .export-card{grid-column:1/-1;position:static!important;}
@media(max-width:900px){.export-workbench-grid{grid-template-columns:1fr}.export-workbench-grid .export-card{grid-column:auto;}}

/* Revision 7: compact frequency interpretation inside measure portfolio */
.portfolio-poisson-guide{margin-top:.35rem;grid-template-columns:minmax(220px,1fr) minmax(150px,.55fr);}
.portfolio-poisson-guide .poisson-expectation{grid-column:1/-1;margin-top:.15rem;}
@media(max-width:720px){.portfolio-poisson-guide{grid-template-columns:1fr;}}

/* Stochastic's longer navigation remains usable on short desktop screens. */
@media (min-width:1180px) and (max-height:820px){
  .navbar-brand,.sidebar>.brand-title,.brand-title{min-height:110px!important}
  .brand-title,.sidebar>.brand-title{padding-top:12px!important;padding-bottom:12px!important}
  .navbar-collapse,.side-nav{top:110px!important;bottom:205px!important;transform:none!important;overflow-x:hidden!important;overflow-y:auto!important}
}
