/* Boss HQ demo screen: Metrics. */
.mx {
  min-width: 0;
}
.mx-strip {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}
.mx-sh {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: 0;
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}
.mx-sh .ms {
  color: var(--warn);
}
.mx-sh .ms:last-child {
  margin-left: auto;
  color: var(--muted);
}
.mx-hseg {
  display: inline-block;
}
.mx-hseg::before {
  content: '\00b7\00a0';
  margin-left: 0.4em;
}
@media (max-width: 520px) {
  .mx-hseg {
    display: block;
  }
  .mx-hseg::before {
    content: none;
  }
}
.mx-sh.calm {
  color: var(--muted);
}
.mx-sh:hover {
  background: var(--sunk);
}
.mx-band {
  border-top: 1px solid var(--hair);
}
.mx-bcap {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 8px 18px 4px;
}
.mx-band.risk .mx-bcap {
  color: var(--risk);
}
.mx-band.attention .mx-bcap {
  color: var(--warn);
}
.mx-trow {
  display: grid;
  grid-template-columns: 28px minmax(130px, max-content) 1fr 1fr 28px;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-left: 3px solid var(--hair);
  cursor: pointer;
}
.mx-trow:hover {
  background: var(--sunk);
}
.mx-trow.risk {
  border-left-color: var(--risk);
}
.mx-trow.attention {
  border-left-color: var(--warn);
}
.mx-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--neutral);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mx-big {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.mx-trow.risk .mx-big {
  color: var(--risk);
}
.mx-trow.attention .mx-big {
  color: var(--warn);
}
.mx-tl {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mx-tl b {
  font-size: 13.5px;
  font-weight: 600;
}
.mx-tl small,
.mx-sub2 {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}
.mx-worst {
  font-size: 12.5px;
  color: var(--muted);
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mx-i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--input);
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  font-weight: 700;
  padding: 0;
  line-height: 1;
}
.mx-i:hover {
  color: var(--text);
  border-color: var(--accent);
}
.mx-calm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--hair);
}
.mx-q {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--hair);
  border-radius: 4px;
  background: var(--sunk);
  color: var(--muted);
  font-size: 12px;
}
.mx-q b {
  color: var(--ok);
  font-weight: 600;
}
.mx-q:hover {
  border-color: var(--accent);
  color: var(--text);
}
.mx-provrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 14px;
}
.mx-prov {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  min-width: 0;
}
.mx-refresh {
  flex: none;
}
@media (max-width: 640px) {
  .mx-provrow {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
/* Full-bleed tables with monospaced money columns, as in the real app. */
.mx-sec.card {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  margin-left: -28px;
  margin-right: -28px;
}
.mx-tbl td.num,
.mx-tbl th.num,
.mx-tbl tfoot td.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) {
  .mx-sec.card {
    margin-left: 0;
    margin-right: 0;
    border-left: 1px solid var(--hair);
    border-right: 1px solid var(--hair);
    border-radius: 4px;
  }
  .mx-tbl td.num {
    font-family: inherit;
  }
}
.mx-tabs {
  position: sticky;
  top: 58px;
  z-index: 5;
  background: var(--bg);
}
.mx-sec .card-head h2 {
  font-size: 16px;
  font-weight: 600;
}
.mx-sec .card-head .mx-ttl {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mx-sec .card-head .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mx-tbl td.mx-what {
  font-weight: 600;
}
.mx-tbl td.mx-detail {
  color: var(--muted);
  max-width: 420px;
}
@media (min-width: 769px) and (max-width: 1100px) {
  .mx-tbl td.mx-detail {
    min-width: 200px;
  }
}
.mx-tbl tr.mx-u0 td:first-child {
  box-shadow: inset 3px 0 0 var(--risk);
}
.mx-tbl tfoot td {
  padding: 10px 14px;
  font-weight: 700;
  border-top: 2px solid var(--hair);
  background: var(--sunk);
  font-size: 13px;
}
.mx-tbl tfoot td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mx-tbl td a {
  cursor: pointer;
}
.mx-foot {
  padding: 10px 18px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--hair);
}
.mx-compbar {
  display: flex;
  gap: 3px;
  height: 26px;
  margin: 14px 18px 4px;
}
.mx-seg {
  min-width: 26px;
  border: 0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 4px;
  color: var(--on-tone);
  cursor: pointer;
}
.mx-seg:hover {
  filter: brightness(1.1);
}
.mx-seg.risk {
  background: var(--risk);
}
.mx-seg.warn {
  background: var(--warn);
}
.mx-seg.ok {
  background: var(--ok);
}
.mx-seg.neutral {
  background: var(--neutral);
  color: var(--muted);
}
.mx-seg.cool {
  background: var(--input);
  color: var(--muted);
}
.mx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 4px 18px 12px;
  font-size: 11.5px;
  color: var(--muted);
}
.mx-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
.mx-legend i.risk {
  background: var(--risk);
}
.mx-legend i.warn {
  background: var(--warn);
}
.mx-legend i.ok {
  background: var(--ok);
}
.mx-legend i.neutral {
  background: var(--neutral);
  border: 1px solid var(--hair);
}
.mx-legend i.cool {
  background: var(--input);
}
.mx-docs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.mx-tr {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mx-trbar {
  width: 52px;
  height: 5px;
  border-radius: 3px;
  background: var(--neutral);
  overflow: hidden;
  display: inline-block;
}
.mx-trbar i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.mx-trbar i.ok {
  background: var(--ok);
}
@media (max-width: 900px) {
  .mx-trow {
    grid-template-columns: 28px minmax(120px, max-content) 1fr 28px;
  }
  .mx-worst {
    display: none;
  }
}
@media (max-width: 600px) {
  .mx-trow {
    grid-template-columns: 28px 1fr 28px;
    gap: 8px;
    padding: 10px 12px;
  }
  .mx-big {
    grid-column: 2;
    grid-row: 1;
    font-size: 19px;
  }
  .mx-tl {
    grid-column: 2;
  }
  .mx-rank {
    grid-row: 1 / span 2;
  }
  .mx-i {
    grid-column: 3;
    grid-row: 1;
  }
  .mx-tabs {
    top: 50px;
  }
  .mx-compbar {
    margin: 12px 12px 4px;
  }
  .mx-legend,
  .mx-foot,
  .mx-calm,
  .mx-sh {
    padding-left: 12px;
    padding-right: 12px;
  }
}
.mx-stale {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 4px;
  padding: 9px 14px;
  margin-bottom: 10px;
  font-size: 13px;
}

/* ---------- phone (m5): stacked cards, 44px targets ---------- */
@media (max-width: 768px) {
  .mx-sh {
    min-height: 48px;
  }
  .mx-q {
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }
  .mx-trow {
    min-height: 56px;
  }
  .mx-i {
    position: relative;
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    font-size: 0;
    margin: -10px;
  }
  .mx-i::before {
    content: 'i';
    position: absolute;
    inset: 11px;
    border: 1px solid var(--input);
    border-radius: 50%;
    background: var(--card);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mx-tabs {
    top: calc(54px + env(safe-area-inset-top));
    -webkit-overflow-scrolling: touch;
    margin-left: -14px;
    margin-right: -14px;
    padding: 0 14px;
    scroll-padding: 0 14px;
  }
  .mx-tabs .tab {
    flex: none;
    white-space: nowrap;
  }
  .mx-sec .card-head {
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .mx-sec .card-head .right {
    margin-left: 0;
    width: 100%;
  }
  .mx-compbar {
    height: 44px;
  }
  .mx-seg {
    min-width: 44px;
    font-size: 13px;
  }
  .mx-tbl-wrap,
  .mx-sec .tbl-wrap {
    overflow: visible;
  }
  .mx-tbl,
  .mx-tbl tbody,
  .mx-tbl tfoot,
  .mx-tbl tr,
  .mx-tbl td {
    display: block;
    width: 100%;
  }
  .mx-tbl thead {
    display: block;
  }
  .mx-tbl thead tr {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--hair);
    background: var(--sunk);
  }
  .mx-tbl thead th {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: auto !important;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--hair);
    border-radius: 22px;
    background: var(--card);
    white-space: nowrap;
  }
  .mx-tbl thead th:not(.sortable) {
    display: none;
  }
  .mx-tbl tbody tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--hair);
    position: relative;
  }
  .mx-tbl tbody tr.mx-u0 {
    box-shadow: inset 3px 0 0 var(--risk);
  }
  .mx-tbl tr.mx-u0 td:first-child {
    box-shadow: none;
  }
  .mx-tbl td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 4px 0;
    border: 0;
    text-align: right;
    max-width: none;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .mx-tbl td::before {
    content: attr(data-label);
    flex: none;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    text-align: left;
  }
  .mx-tbl td:first-child {
    display: block;
    text-align: left;
    font-size: 15px;
    padding-bottom: 6px;
  }
  .mx-tbl td:first-child::before {
    display: none;
  }
  .mx-tbl td[data-label='']::before {
    display: none;
  }
  .mx-tbl td.mx-detail {
    display: block;
    color: var(--muted);
    text-align: left;
  }
  .mx-tbl td.mx-detail::before {
    display: block;
    margin-bottom: 2px;
  }
  .mx-sec .card-head .right.mx-ionly {
    width: auto;
    margin-left: auto;
  }
  .mx-tbl td.empty {
    display: block;
    text-align: center;
  }
  .mx-tbl td.empty::before {
    display: none;
  }
  .mx-tbl tfoot tr {
    padding: 12px 14px;
    background: var(--sunk);
    border-top: 2px solid var(--hair);
  }
  .mx-tbl tfoot td {
    padding: 3px 0;
    border: 0;
    background: none;
    display: flex;
    justify-content: space-between;
  }
  .mx-tbl tfoot td:first-child {
    display: block;
  }
  .mx-tbl tfoot td:empty {
    display: none;
  }
  .mx-tbl tfoot td::before {
    content: attr(data-label);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .mx-tbl td a,
  .mx-tbl td .pill {
    min-height: 0;
  }
  .mx-tbl td a[data-go] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .mx-foot a {
    display: inline-block;
    padding: 12px 0;
  }
  .mx-legend {
    gap: 8px 16px;
  }
}
