.bm-wrap {
  max-width: 1280px;
  margin: 0 auto;
}

.bm-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  overflow: hidden;
}
.bm-card h3 {
  margin: .1rem 0 .15rem;
  font-size: 1.05rem;
}
.bm-card .bm-sub {
  color: #6b7280;
  font-size: .82rem;
  margin-bottom: .8rem;
}
.bm-cwrap {
  position: relative;
  width: 100%;
}
.bm-cwrap-300 { height: 300px; }
.bm-cwrap-340 { height: 340px; }
.bm-cwrap-400 { height: 400px; }

.bm-hidden { display: none; }

.bm-legend {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: .76rem;
  color: #64748b;
  margin-top: .6rem;
}
.bm-pkey {
  display: flex;
  gap: .5rem 1rem;
  flex-wrap: wrap;
  font-size: .72rem;
  color: #475569;
  margin-top: .5rem;
}
.bm-pkey .bm-c1 { color: var(--immat-principle-1, #9BC052); }
.bm-pkey .bm-c2 { color: var(--immat-principle-2, #F5AE00); }
.bm-pkey .bm-c3 { color: var(--immat-principle-3, #E86DA4); }
.bm-pkey .bm-c4 { color: var(--immat-principle-4, #5BABDF); }
.bm-legend .bm-sw {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 3px;
}
.bm-note {
  background: #f1f7fb;
  border: 1px solid #cfe2ef;
  border-left: 4px solid var(--hiqa-blue, #0182ac);
  border-radius: 8px;
  padding: .65rem .95rem;
  font-size: .85rem;
  color: #2f4a5e;
  margin: .4rem 0 .9rem;
}
.bm-note.bm-tbc {
  background: #f6f1fb;
  border-color: #d6c4f0;
  border-left-color: #6f42c1;
  color: #4b2c80;
}
.bm-orgfooter {
  margin-top: 1.75rem;
  padding: 1rem 1.1rem;
  border-top: 2px solid #cbd5e1;
  font-size: .8rem;
  color: #475569;
  line-height: 1.55;
}

.bm-facet4 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}
.bm-facet4 > div, .bm-facetorg > div {
  min-width: 0;
}
.bm-facet4 .bm-ft {
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: .15rem;
}
.bm-facetorg {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .7rem;
}
.bm-facetorg .bm-ot {
  font-size: .72rem;
  font-weight: 700;
  color: #334155;
}
@media (max-width: 820px) {
  .bm-facet4, .bm-facetorg {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .bm-facet4, .bm-facetorg {
    grid-template-columns: minmax(0, 1fr);
  }
  .bm-pkey, .bm-legend {
    gap: .4rem .6rem;
  }
}

table.bm-ht {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
table.bm-ht th, table.bm-ht td {
  border: 1px solid #e5e7eb;
  padding: .3rem .38rem;
  text-align: center;
}
table.bm-ht td.bm-l {
  text-align: left;
  white-space: nowrap;
}
table.bm-ht thead th {
  background: #f8fafc;
  font-size: .72rem;
}
table.bm-ht thead th.bm-fth {
  vertical-align: top;
}
table.bm-ht thead th.bm-fth select {
  display: block;
  margin: .25rem auto 0;
  font-weight: 400;
  font-size: .66rem;
  max-width: 120px;
  padding: .15rem .2rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}
.bm-ht tr.bm-orow {
  cursor: pointer;
}
.bm-ht tr.bm-orow:hover td {
  background: #f1f5f9;
}
.bm-ht .bm-tg {
  display: inline-block;
  width: 12px;
  font-size: .6rem;
  color: #94a3b8;
  transition: transform .15s;
  margin-right: .3rem;
}
.bm-ht .bm-tg.bm-open {
  transform: rotate(90deg);
}
.bm-ht tr.bm-drow td {
  font-size: .74rem;
  border-top: 1px dashed #eef1f4;
}
.bm-ht tr.bm-drow td.bm-dn {
  padding-left: 1.7rem;
  color: #475569;
  text-align: left;
}
.bm-ht td.bm-dtcell {
  text-align: left;
  max-width: 220px;
  white-space: normal;
}
/* Principle colours label the header only — score cells in the body sit on a maturity-coloured
   background (.bm-v1-.bm-v5 below), so they stay dark/bold for contrast instead of tinted. */
table.bm-ht thead .bm-c1 {
  color: var(--immat-principle-1, #9BC052);
}
table.bm-ht thead .bm-c2 {
  color: var(--immat-principle-2, #F5AE00);
}
table.bm-ht thead .bm-c3 {
  color: var(--immat-principle-3, #E86DA4);
}
table.bm-ht thead .bm-c4 {
  color: var(--immat-principle-4, #5BABDF);
}
table.bm-ht thead .bm-cT {
  color: var(--hiqa-teal-blue, #019587);
}
table.bm-ht tbody .bm-c1, table.bm-ht tbody .bm-c2, table.bm-ht tbody .bm-c3, table.bm-ht tbody .bm-c4, table.bm-ht tbody .bm-cT {
  color: #1f2937;
  font-weight: 600;
}
.bm-v1 {
  background: #E2EFD9;
}
.bm-v2 {
  background: #C5E0B4;
}
.bm-v3 {
  background: #A9D18E;
}
.bm-v4 {
  background: #92D050;
}
.bm-v5 {
  background: #00B050;
  color: #fff;
}
tr.bm-avg td {
  font-weight: 700;
  background: #eef4f8;
}
tr.bm-you td {
  box-shadow: inset 3px 0 0 #1a8a3f;
}

.bm-chip {
  display: inline-block;
  font-size: .66rem;
  background: #eef2f7;
  border: 1px solid #d7dee7;
  color: #334155;
  border-radius: 10px;
  padding: 1px 7px;
  margin: 1px 2px;
  white-space: nowrap;
}

.bm-hqfilters {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: .7rem;
}
.bm-hqfilters select {
  font-size: .8rem;
  padding: .35rem .5rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  max-width: 230px;
}
.bm-controls {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .8rem;
  flex-wrap: wrap;
}
.bm-controls label {
  font-weight: 700;
  font-size: .85rem;
  color: #374151;
}
.bm-controls select {
  font-size: .86rem;
  padding: .4rem .6rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.bm-natcfg {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin: 0 0 1.3rem;
}
.bm-natcfg .bm-small {
  font-size: .82rem;
  color: #64748b;
  margin: .1rem 0 .8rem;
}
.bm-natrow {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin: .55rem 0;
}
.bm-natrow label {
  font-size: .88rem;
  font-weight: 600;
  min-width: 330px;
  color: #334155;
}
.bm-natrow label .bm-muted {
  font-weight: 400;
  color: #94a3b8;
}
.bm-natrow input {
  width: 88px;
  font-size: .9rem;
  padding: .35rem .5rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
}
.bm-adjnote {
  font-size: .8rem;
  color: #b45309;
  font-weight: 600;
}
.bm-resetbtn {
  font-size: .78rem;
  background: none;
  border: none;
  color: #0182ac;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

@media (max-width: 480px) {
  .bm-natrow label {
    min-width: 0;
    width: 100%;
  }
}

.bm-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: #64748b;
}

.bm-pdf-header {
  position: fixed;
  left: -9999px;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #fff;
  padding: 12px 0;
}
.bm-pdf-header-title {
  margin: 0 0 .25rem;
  font-size: 22px;
  font-weight: 300;
  color: var(--hiqa-teal-blue, #019587);
}
.bm-pdf-header-subtitle {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}
.bm-pdf-header-logo {
  height: 70px;
  flex-shrink: 0;
}
.bm-pdf-exporting .bm-colf {
  display: none;
}
.bm-pdf-exporting table.bm-ht thead th.bm-fth {
  vertical-align: middle;
}
