/**
 * Bootstrap 5.3.8 only (no Bootstrap 3 CSS/JS).
 *
 * Load order:
 *   1. vendor/bootstrap/5.3.8/bootstrap.min.css
 *   2. this file (old class names: panel, well, col-xs, pull-*, btn-default)
 *   3. style.css / master.css
 *
 * JS: bootstrap.bundle.min.js + bootstrap5-jquery-bridge.js
 * (keeps $().modal() / data-toggle working).
 */

/* --- Reboot: Bootstrap 5 img/p rules break old layouts --- */
img {
  max-width: none;
  vertical-align: baseline;
}
p {
  margin: 0 0 10px;
}

/*
 * Grid: Bootstrap 3 used floats + breakpoint media queries.
 * Do not collapse col-sm-12 and col-md-3 into one 100% rule — that stacks
 * Summary cards. Do not set width on .row > * (beats .col-md-3).
 */
.row {
  --bs-gutter-x: 30px;
  --bs-gutter-y: 0;
  display: block;
  margin-left: -15px;
  margin-right: -15px;
}
.row:before,
.row:after {
  display: table;
  content: " ";
}
.row:after {
  clear: both;
}
.row > *:not([class*="col-"]) {
  width: auto;
  max-width: none;
  padding-right: 0;
  padding-left: 0;
  margin-top: 0;
}
.row > [class*="col-"] {
  max-width: none;
  margin-top: 0;
  flex: 0 0 auto;
  float: left;
  box-sizing: border-box;
}
[class*="col-xs-"],
[class*="col-sm-"],
[class*="col-md-"],
[class*="col-lg-"],
[class*="col-"] {
  position: relative;
  min-height: 1px;
  padding-right: 15px;
  padding-left: 15px;
  float: left;
  box-sizing: border-box;
}

/* col-xs-* — all viewports (Bootstrap 3) */
.col-xs-1 { width: 8.33333333%; }
.col-xs-2 { width: 16.66666667%; }
.col-xs-3 { width: 25%; }
.col-xs-4 { width: 33.33333333%; }
.col-xs-5 { width: 41.66666667%; }
.col-xs-6 { width: 50%; }
.col-xs-7 { width: 58.33333333%; }
.col-xs-8 { width: 66.66666667%; }
.col-xs-9 { width: 75%; }
.col-xs-10 { width: 83.33333333%; }
.col-xs-11 { width: 91.66666667%; }
.col-xs-12 { width: 100%; }

@media (min-width: 768px) {
  .row > .col-sm-1, .col-sm-1 { width: 8.33333333%; }
  .row > .col-sm-2, .col-sm-2 { width: 16.66666667%; }
  .row > .col-sm-3, .col-sm-3 { width: 25%; }
  .row > .col-sm-4, .col-sm-4 { width: 33.33333333%; }
  .row > .col-sm-5, .col-sm-5 { width: 41.66666667%; }
  .row > .col-sm-6, .col-sm-6 { width: 50%; }
  .row > .col-sm-7, .col-sm-7 { width: 58.33333333%; }
  .row > .col-sm-8, .col-sm-8 { width: 66.66666667%; }
  .row > .col-sm-9, .col-sm-9 { width: 75%; }
  .row > .col-sm-10, .col-sm-10 { width: 83.33333333%; }
  .row > .col-sm-11, .col-sm-11 { width: 91.66666667%; }
  .row > .col-sm-12, .col-sm-12 { width: 100%; }
}

@media (min-width: 992px) {
  .row > .col-md-1, .col-md-1 { width: 8.33333333%; }
  .row > .col-md-2, .col-md-2 { width: 16.66666667%; }
  .row > .col-md-3, .col-md-3 { width: 25%; }
  .row > .col-md-4, .col-md-4 { width: 33.33333333%; }
  .row > .col-md-5, .col-md-5 { width: 41.66666667%; }
  .row > .col-md-6, .col-md-6 { width: 50%; }
  .row > .col-md-7, .col-md-7 { width: 58.33333333%; }
  .row > .col-md-8, .col-md-8 { width: 66.66666667%; }
  .row > .col-md-9, .col-md-9 { width: 75%; }
  .row > .col-md-10, .col-md-10 { width: 83.33333333%; }
  .row > .col-md-11, .col-md-11 { width: 91.66666667%; }
  .row > .col-md-12, .col-md-12 { width: 100%; }
}

@media (min-width: 1200px) {
  .row > .col-lg-1, .col-lg-1 { width: 8.33333333%; }
  .row > .col-lg-2, .col-lg-2 { width: 16.66666667%; }
  .row > .col-lg-3, .col-lg-3 { width: 25%; }
  .row > .col-lg-4, .col-lg-4 { width: 33.33333333%; }
  .row > .col-lg-5, .col-lg-5 { width: 41.66666667%; }
  .row > .col-lg-6, .col-lg-6 { width: 50%; }
  .row > .col-lg-7, .col-lg-7 { width: 58.33333333%; }
  .row > .col-lg-8, .col-lg-8 { width: 66.66666667%; }
  .row > .col-lg-9, .col-lg-9 { width: 75%; }
  .row > .col-lg-10, .col-lg-10 { width: 83.33333333%; }
  .row > .col-lg-11, .col-lg-11 { width: 91.66666667%; }
  .row > .col-lg-12, .col-lg-12 { width: 100%; }
}

/* Home metric cards: one stretched row like QA */
.row.flex-center {
  display: flex !important;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
}
.row.flex-center > [class*="col-"] {
  float: none;
  flex: 1 1 0;
  width: auto;
  max-width: none;
}

/* Widgets live in #frmmiddle, not as direct .row children */
#frmmiddle:after {
  content: "";
  display: table;
  clear: both;
}

/* --- Removed BS3 components still used in templates --- */
.well {
  min-height: 20px;
  padding: 19px;
  margin-bottom: 20px;
  background-color: #f5f5f5;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
}
.btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
}
.btn-default:hover,
.btn-default:focus {
  color: #333;
  background-color: #e6e6e6;
  border-color: #adadad;
}
.panel {
  margin-bottom: 20px;
  background-color: #fff;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}
.panel-body {
  padding: 15px;
}
.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid transparent;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}
.panel-title {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 16px;
  color: inherit;
}
.panel-default {
  border-color: #ddd;
}
.panel-default > .panel-heading {
  color: #333;
  background-color: #f5f5f5;
  border-color: #ddd;
}
.form-group {
  margin-bottom: 15px;
}
.control-label {
  margin-bottom: 0;
}
.help-block {
  display: block;
  margin-top: 5px;
  margin-bottom: 10px;
  color: #737373;
}
.input-group-addon {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  color: #555;
  text-align: center;
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.label {
  display: inline;
  padding: 0.2em 0.6em 0.3em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25em;
}
.label-default { background-color: #777; }
.label-primary { background-color: #337ab7; }
.label-success { background-color: #5cb85c; }
.label-info { background-color: #5bc0de; }
.label-warning { background-color: #f0ad4e; }
.label-danger { background-color: #d9534f; }
.close {
  float: right;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.2;
}
.hide {
  display: none !important;
}
.hidden {
  display: none !important;
}
.pull-left { float: left !important; }
.pull-right { float: right !important; }
.img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 4px dashed;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

/* BS3 JS uses .open; BS5 CSS only shows .dropdown-menu.show */
.open > .dropdown-menu {
  display: block;
}

/*
 * Restore Bootstrap 3.4 tooltip CSS. BS5 tooltip CSS is Popper-based
 * (.bs-tooltip-*, transform, inset, .tooltip-arrow::before) and breaks
 * bootstrap.min.js which still sets inline top/left + classes top/bottom.
 */
.tooltip {
  --bs-tooltip-arrow-width: 0;
  --bs-tooltip-arrow-height: 0;
  position: absolute;
  z-index: 1070;
  display: block;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.42857143;
  text-align: left;
  text-decoration: none;
  text-shadow: none;
  text-transform: none;
  letter-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  white-space: normal;
  opacity: 0;
}
.tooltip.in,
.tooltip.fade.in,
.fade.tooltip.in,
.fade:not(.show).in,
.tooltip.show,
.tooltip.fade.show {
  opacity: 0.9 !important;
  visibility: visible !important;
}
.tooltip.top {
  padding: 5px 0;
  margin-top: -3px;
}
.tooltip.right {
  padding: 0 5px;
  margin-left: 3px;
}
.tooltip.bottom {
  padding: 5px 0;
  margin-top: 3px;
}
.tooltip.left {
  padding: 0 5px;
  margin-left: -3px;
}
.tooltip-inner {
  max-width: 200px;
  padding: 3px 8px;
  color: #fff;
  text-align: center;
  background-color: #000;
  border-radius: 4px;
}
.tooltip-arrow,
.tooltip .tooltip-arrow {
  position: absolute;
  width: 0 !important;
  height: 0 !important;
  border-color: transparent;
  border-style: solid;
}
.tooltip .tooltip-arrow::before {
  content: none !important;
  display: none !important;
}
.tooltip.top .tooltip-arrow {
  top: auto;
  bottom: 0;
  left: 50%;
  margin-left: -5px;
  border-width: 5px 5px 0;
  border-top-color: #000;
}

/* QA seal tooltip (class .test) — white 400px box, gray arrow */
.tooltip.test-tooltip {
  --bs-tooltip-bg: #fff;
  --bs-tooltip-color: #000;
  --bs-tooltip-opacity: 0.9;
}
.tooltip.test-tooltip > .tooltip-inner {
  background-color: #fff;
  color: #000;
  border: 1px solid #bbb;
  padding: 5px;
  font-size: 12px;
  width: 400px;
  max-width: 400px;
  text-align: center;
}
.tooltip.test-tooltip.top > .tooltip-arrow,
.tooltip.test-tooltip.bs-tooltip-top > .tooltip-arrow,
.tooltip.test-tooltip.bs-tooltip-auto[data-popper-placement^="top"] > .tooltip-arrow {
  border-top: 5px solid #bbb;
  border-top-color: #bbb;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  margin-left: -5px;
  transform: none !important;
  inset: auto  auto 0 50% !important;
}
.tooltip.test-tooltip.top,
.tooltip.test-tooltip.bs-tooltip-top,
.tooltip.test-tooltip.bs-tooltip-auto {
  margin: 0;
  padding: 0;
}
.tooltip.bottom .tooltip-arrow {
  top: 0;
  bottom: auto;
  left: 50%;
  margin-left: -5px;
  border-width: 0 5px 5px;
  border-bottom-color: #000;
}
.tooltip.right .tooltip-arrow {
  top: 50%;
  left: 0;
  margin-top: -5px;
  border-width: 5px 5px 5px 0;
  border-right-color: #000;
}
.tooltip.left .tooltip-arrow {
  top: 50%;
  right: 0;
  margin-top: -5px;
  border-width: 5px 0 5px 5px;
  border-left-color: #000;
}

/* Keep table-cell tooltips next to the trigger (same as QA sibling insert) */
table.dataTable tbody td {
  overflow: visible;
}

table.dataTable td,
table.dataTable th {
  box-sizing: content-box;
}

/* --- Summary bar: keep title + banner + button on one 45px strip --- */
.inner-block .well .row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  height: 45px;
  margin-left: 0;
  margin-right: 0;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}
.inner-block .well .row > [class*="col-"] {
  float: none;
  max-width: none;
  padding-left: 8px;
  padding-right: 8px;
}
.inner-block .well .row > .col-md-3 {
  flex: 0 0 25%;
  width: 25% !important;
}
.inner-block .well .row > .col-md-8 {
  flex: 1 1 auto;
  width: auto !important;
}
.inner-block .well .row > .col-md-1 {
  flex: 0 0 auto;
  width: auto !important;
}

/* Header must stay ~68px so it does not cover the Summary well */
.header-main {
  max-height: 68px;
}
.header-main img {
  max-width: none;
  max-height: 58px;
}

/* BS5 .text-* uses !important and overrides the white totals on Home cards */
.found-box-Customize .totalnew h2,
.found-box-Customize .totalnew h2.text-success,
.found-box-Customize .totalnew h2.text-primary,
.found-box-Customize .totalnew h2.text-danger,
.found-box-Customize .totalnew h2.text-info {
  color: #fff !important;
}

/* BS3 form/button sizing (BS5 controls are taller / more padded) */
.form-control {
  height: 34px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: #555;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.form-control:focus {
  border-color: #66afe9;
  outline: 0;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
select.form-control {
  /* BS5 .form-control sets appearance:none; legacy selects need the native OS arrow */
  -webkit-appearance: menulist;
  -moz-appearance: menulist;
  appearance: auto;
  height: 34px;
  line-height: 1.42857143;
}
textarea.form-control,
select[multiple].form-control {
  height: auto;
}
.btn {
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  border-radius: 4px;
}

/* BS3 JS used .in; BS5 uses .show — keep both visible */
.fade.in {
  opacity: 1;
}
.collapse.in {
  display: block;
}
.modal.in {
  display: block;
}

/*
 * Info-circle glyph (FA5). Color inherits like QA:
 * .pass = green, .fail = red, .unknown = blue.
 */
.fa.fa-info-circle,
.fas.fa-info-circle {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-style: normal;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

/* QA striped table header (gray bar) — BS5 can flatten this */
.table-striped thead tr,
.table-striped > thead > tr,
table.dataTable.table-striped thead tr {
  color: #555;
  background-color: rgba(0, 0, 0, 0.09);
}

/*
 * CakePHP Paginator + BS3 markup: <ul class="pagination"><li><a>
 * BS5 expects .page-item / .page-link and does not style legacy li > a.
 */
.pagination {
  display: inline-block !important;
  padding-left: 0;
  margin: 20px 0;
  border-radius: 4px;
  list-style: none;
}
.pagination > li {
  display: inline-block;
}
.pagination > li > a,
.pagination > li > span {
  position: relative;
  float: none;
  display: inline-block;
  padding: 6px 12px !important;
  margin-left: -1px;
  line-height: 1.42857143;
  color: #337ab7 !important;
  text-decoration: none !important;
  background-color: #fff !important;
  border: 1px solid #ddd !important;
}
.pagination > li > a:hover,
.pagination > li > a:focus,
.pagination > li > span:hover,
.pagination > li > span:focus {
  z-index: 2;
  color: #23527c;
  background-color: #eee;
  border-color: #ddd;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
  margin-left: 0;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}
.pagination > li:last-child > a,
.pagination > li:last-child > span {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}
.pagination > .active > a,
.pagination > .active > a:hover,
.pagination > .active > a:focus,
.pagination > .active > span,
.pagination > .active > span:hover,
.pagination > .active > span:focus {
  z-index: 3;
  color: #fff !important;
  cursor: default;
  background-color: #337ab7 !important;
  border-color: #337ab7 !important;
}
.pagination > .disabled > a,
.pagination > .disabled > a:hover,
.pagination > .disabled > a:focus,
.pagination > .disabled > span,
.pagination > .disabled > span:hover,
.pagination > .disabled > span:focus {
  color: #777 !important;
  cursor: not-allowed;
  background-color: #fff !important;
  border-color: #ddd !important;
}

/*
 * BS3 .table-bordered / cell sizing for non-DataTable tables (e.g. Reports list).
 * DataTables keep datatables-bs5.css rules via .dataTable class.
 */
.table-striped:not(.dataTable) {
  /* QA/master.css odd-row tone; BS5 default is rgba(…, 0.05) via inset box-shadow */
  --bs-table-striped-bg: rgba(0, 0, 0, 0.02);
}
.table:not(.dataTable).table-bordered th,
.table:not(.dataTable).table-bordered td {
  border: 1px solid #ddd !important;
}
.table-striped:not(.dataTable) > thead > tr > th {
  color: #555 !important;
  background-color: rgba(0, 0, 0, 0.09) !important;
  --bs-table-bg: rgba(0, 0, 0, 0.09);
  --bs-table-bg-type: initial;
  box-shadow: none;
}
.table:not(.dataTable) > thead > tr > th,
.table:not(.dataTable) > tbody > tr > td,
.table:not(.dataTable) > tbody > tr > th,
.table:not(.dataTable) > tfoot > tr > td,
.table:not(.dataTable) > tfoot > tr > th {
  /* Match QA mylight/master compact cells (was BS3 default 8px) */
  padding: 4px !important;
  line-height: 1.42857143;
  vertical-align: top;
}

/*
 * Report list action buttons (.sub_tab .cutable) — mylight density.
 * Do not change global .btn (used on many non-list controls).
 */
.sub_tab .cutable .btn {
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.42857143;
}

/*
 * BS3 nav-tabs under .ss_nav: <ul.nav.nav-tabs><li.active><a>
 * BS5 nav-tabs under .ss_nav: <ul.nav.nav-tabs><li.nav-item><a.nav-link.active>
 * Scoped to .ss_nav only — leaves global .nav / DataTables alone.
 * Matches Assets/EASM tab chrome (settings integrations, SIEM, etc.).
 */
.ss_nav > ul.nav.nav-tabs,
.sub_tab .ss_nav > ul.nav.nav-tabs {
  display: block;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
  border-bottom: 1px solid #ddd;
  flex-wrap: unset;
}
.ss_nav > ul.nav.nav-tabs::after,
.sub_tab .ss_nav > ul.nav.nav-tabs::after {
  content: "";
  display: table;
  clear: both;
}
.ss_nav > ul.nav.nav-tabs > li,
.sub_tab .ss_nav > ul.nav.nav-tabs > li {
  float: left;
  margin-bottom: -1px;
  position: relative;
  display: block;
}
.ss_nav > ul.nav.nav-tabs > li > a,
.sub_tab .ss_nav > ul.nav.nav-tabs > li > a {
  position: relative;
  display: block;
  padding: 10px 15px;
  margin-right: 2px;
  line-height: 1.42857143;
  border: 1px solid transparent;
  border-radius: 4px 4px 0 0;
  text-decoration: none;
  color: #0081bb;
  background-color: transparent;
}
.ss_nav > ul.nav.nav-tabs > li > a:hover,
.ss_nav > ul.nav.nav-tabs > li > a:focus,
.sub_tab .ss_nav > ul.nav.nav-tabs > li > a:hover,
.sub_tab .ss_nav > ul.nav.nav-tabs > li > a:focus {
  text-decoration: none;
  background-color: #eee;
  border-color: #eee #eee #ddd;
}
.ss_nav > ul.nav.nav-tabs > li.active > a,
.ss_nav > ul.nav.nav-tabs > li.active > a:hover,
.ss_nav > ul.nav.nav-tabs > li.active > a:focus,
.sub_tab .ss_nav > ul.nav.nav-tabs > li.active > a,
.sub_tab .ss_nav > ul.nav.nav-tabs > li.active > a:hover,
.sub_tab .ss_nav > ul.nav.nav-tabs > li.active > a:focus,
.ss_nav > ul.nav.nav-tabs > li > a.nav-link.active,
.ss_nav > ul.nav.nav-tabs > li > a.nav-link.active:hover,
.ss_nav > ul.nav.nav-tabs > li > a.nav-link.active:focus,
.sub_tab .ss_nav > ul.nav.nav-tabs > li > a.nav-link.active,
.sub_tab .ss_nav > ul.nav.nav-tabs > li > a.nav-link.active:hover,
.sub_tab .ss_nav > ul.nav.nav-tabs > li > a.nav-link.active:focus {
  color: #555;
  cursor: default;
  background-color: #fff;
  border: 1px solid #ddd;
  border-bottom-color: transparent;
}

/*
 * Grid col-* on table cells: float layout breaks column alignment (Reports list).
 */
.table > thead > tr > th[class*="col-"],
.table > tbody > tr > td[class*="col-"],
.table > tbody > tr > th[class*="col-"] {
  float: none !important;
  display: table-cell !important;
  position: static;
  min-height: 0;
}

/*
 * jquery.multiselect2side: direct .row child without col-* must stay full width;
 * .w2 button columns stay narrow (master.css .w2 { width: 2% }).
 */
.report_columns .row > .ms2side__div,
.report_columns #col.row > .ms2side__div,
.schdule_multi_selectionbox .report_columns .row > .ms2side__div,
.schdule_multi_selectionbox .report_columns #col.row > .ms2side__div {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}
.report_columns .ms2side__select.col-md-3,
.schdule_multi_selectionbox .report_columns .ms2side__select.col-md-3 {
  float: none !important;
  width: 25% !important;
  box-sizing: border-box;
}
.report_columns .ms2side__select select,
.schdule_multi_selectionbox .report_columns .ms2side__select select {
  width: 100% !important;
}
.report_columns .ms2side__options.w2,
.report_columns .ms2side__updown.w2,
.schdule_multi_selectionbox .report_columns .ms2side__options.w2,
.schdule_multi_selectionbox .report_columns .ms2side__updown.w2 {
  width: 2% !important;
  min-width: 24px;
  flex: 0 0 auto;
  align-self: center;
}

/*
 * Profile dropdown: prevent Popper stretch on wide header items.
 */
.header-main .profile_details_drop .dropdown-menu {
  min-width: 10rem;
}

/*
 * Modal dialog width: BS5 default max-width is 500px; QA/BS3 used 600px at ≥768px.
 * Keep explicit size classes (modal-sm/lg/xl, modal-dialog-900, main-model-dv) unchanged.
 */
@media (min-width: 768px) {
  .modal-dialog:not(.modal-sm):not(.modal-lg):not(.modal-xl):not(.modal-dialog-900):not(.main-model-dv) {
    --bs-modal-width: 600px;
    max-width: 600px;
    width: 600px;
    margin: 30px auto;
  }
  /*
   * OnBoard / whitelist / rediscovery dialogs: onboardurl.css sets .main-model-dv
   * { width: 900px }. Restore that under BS5 (max-width / --bs-modal-width).
   */
  .modal-dialog.main-model-dv {
    --bs-modal-width: 900px;
    width: 900px;
    max-width: 900px;
    margin: 30px auto;
  }
}

/*
 * Modal header close button (BS5 flex + hybrid migration markup).
 *
 * Root cause of giant X:
 *   class="btn-close close" + &times;
 *   .close { font-size: 21px } scales BS5 .btn-close (em-based SVG) hugely,
 *   and the text × also renders.
 *
 * Keep title left / close top-right even when close precedes title in DOM
 * (BS3 floated .close right; BS5 flex ignores float).
 */
.modal-header > .modal-title {
  order: 1;
  flex: 1 1 auto;
  margin-right: auto;
}
.modal-header > .btn-close,
.modal-header > .close,
.modal-header > button.close {
  order: 2;
  margin-left: auto;
}
.modal-header .btn-close.close {
  float: none;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
  color: transparent;
  text-shadow: none;
  opacity: 1;
  width: 1em;
  height: 1em;
  padding: 0.25em;
  box-sizing: content-box;
  background-size: 1em;
}
/* Pure BS3-style text close inside BS5 flex header */
.modal-header > .close:not(.btn-close) {
  float: none;
  padding: 0;
  background: transparent;
  border: 0;
  appearance: none;
}

/*
 * BS5 .btn-close:focus uses a blue box-shadow (--bs-btn-close-focus-shadow).
 * QA/BS3 .close had no blue ring — only opacity change. Match that for modals.
 */
.modal-header .btn-close:focus,
.modal-header .btn-close:focus-visible,
.modal-header .btn-close:active {
  outline: 0;
  box-shadow: none;
  opacity: 0.75;
}
.modal {
  --bs-btn-close-focus-shadow: none;
}
