/* HBEDS Administration design system. Scoped to .hb (pages) and .hb-dialog (dialogs rendered at the provider root). */

.hb,
.hb-dialog {
    --hb-bg: #f3f4f6;
    --hb-surface: #ffffff;
    --hb-surface-muted: #f8f9fb;
    --hb-border: #e3e6eb;
    --hb-border-strong: #cdd2da;
    --hb-text: #1b2230;
    --hb-text-2: #535d6e;
    --hb-text-3: #68707f;
    --hb-accent: #c4231b;
    --hb-accent-hover: #a51d16;
    --hb-accent-soft: #fdeeed;
    --hb-accent-fill: #c4231b;
    --hb-accent-fill-hover: #a51d16;
    --hb-focus: #2f6fde;
    --hb-radius: 10px;
    --hb-radius-sm: 6px;
    --hb-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --hb-success: #157347;
    --hb-success-bg: #e5f4ec;
    --hb-success-dot: #22a06b;
    --hb-warning: #8a5300;
    --hb-warning-bg: #fff3dc;
    --hb-warning-dot: #e59a10;
    --hb-danger: #b42318;
    --hb-danger-bg: #fdecea;
    --hb-danger-dot: #e5484d;
    --hb-info: #1d5bbf;
    --hb-info-bg: #e7effc;
    --hb-info-dot: #3b82f6;
    --hb-neutral: #4b5565;
    --hb-neutral-bg: #eef0f3;
    --hb-neutral-dot: #9aa3b1;
    --hb-simulated: #5b3cc4;
    --hb-simulated-bg: #f0ebfd;
    --hb-simulated-dot: #8b6cf0;
    --hb-on-text: #ffffff;
    --hb-row-hover: #f6f8fb;
    --hb-row-changed: #fffaf0;
    --hb-skeleton-a: #eceef2;
    --hb-skeleton-b: #f5f6f8;
    --hb-chart-hover: rgba(30, 79, 143, .06);
    --hb-segment-gap: rgba(255, 255, 255, .7);
    --hb-warning-stripe: #f6d89a;
    --hb-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
    color: var(--hb-text);
    font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

:root[data-theme="dark"] .hb,
:root[data-theme="dark"] .hb-dialog {
    --hb-bg: #17181a;
    --hb-surface: #212226;
    --hb-surface-muted: #1b1c1f;
    --hb-border: #33353a;
    --hb-border-strong: #474a50;
    --hb-text: #e4e6ea;
    --hb-text-2: #b5bac2;
    --hb-text-3: #8d939c;
    --hb-accent: #e0473a;
    --hb-accent-hover: #ea6b60;
    --hb-accent-soft: rgba(224, 71, 58, .16);
    --hb-accent-fill: #9e3a32;
    --hb-accent-fill-hover: #b3463d;
    --hb-focus: #6ea8ff;
    --hb-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .25);
    --hb-success: #7dd3a0;
    --hb-success-bg: rgba(34, 160, 107, .16);
    --hb-success-dot: #3fbf7f;
    --hb-warning: #f2c46d;
    --hb-warning-bg: rgba(229, 154, 16, .16);
    --hb-warning-dot: #e8a33a;
    --hb-danger: #ff9b95;
    --hb-danger-bg: rgba(229, 72, 77, .18);
    --hb-danger-dot: #ef5f63;
    --hb-info: #93bbff;
    --hb-info-bg: rgba(59, 130, 246, .18);
    --hb-info-dot: #5b9bff;
    --hb-neutral: #b5bac2;
    --hb-neutral-bg: rgba(255, 255, 255, .08);
    --hb-neutral-dot: #7d8590;
    --hb-simulated: #bba8ff;
    --hb-simulated-bg: rgba(139, 108, 240, .18);
    --hb-simulated-dot: #9b82f5;
    --hb-on-text: #17181a;
    --hb-row-hover: rgba(255, 255, 255, .04);
    --hb-row-changed: rgba(229, 154, 16, .08);
    --hb-skeleton-a: rgba(255, 255, 255, .06);
    --hb-skeleton-b: rgba(255, 255, 255, .12);
    --hb-chart-hover: rgba(110, 168, 255, .08);
    --hb-segment-gap: rgba(0, 0, 0, .45);
    --hb-warning-stripe: rgba(229, 154, 16, .38);
}

.hb {
    contain: inline-size;
    margin: -1.1rem -1.5rem 0 -2rem;
    padding: 0 1.5rem 3rem 2rem;
    min-height: calc(100vh - 3.5rem);
    background: var(--hb-bg);
}

.hb *:focus-visible,
.hb-dialog *:focus-visible {
    outline: 2px solid var(--hb-focus);
    outline-offset: 2px;
}

.hb a {
    color: inherit;
}

.hb-mono {
    font-family: var(--hb-mono);
    font-size: .92em;
}

.hb-num {
    font-variant-numeric: tabular-nums;
}

.hb-muted {
    color: var(--hb-text-2);
}

.hb-subtle {
    color: var(--hb-text-3);
}

.hb-wrap {
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.hb-nowrap {
    white-space: nowrap;
}

/* ---------- Page header ---------- */

.hb-header {
    padding: 1.25rem 0 1rem;
}

.hb-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem;
    margin: 0 0 .5rem;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    color: var(--hb-text-3);
}

.hb-crumbs a {
    color: var(--hb-text-2);
    text-decoration: none;
}

.hb-crumbs a:hover {
    color: var(--hb-accent);
    text-decoration: underline;
}

.hb-crumbs li + li::before {
    content: "/";
    margin-right: .25rem;
    color: var(--hb-border-strong);
}

.hb-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem 1.5rem;
}

.hb-title-block {
    flex: 1 1 28rem;
    min-width: 0;
}

.hb-eyebrow {
    display: flex;
    align-items: center;
    gap: .375rem;
    margin-bottom: .25rem;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hb-accent);
}

.hb-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: var(--hb-text);
}

.hb-title:focus {
    outline: none;
}

.hb-subtitle {
    margin: .3rem 0 0;
    max-width: 52rem;
    color: var(--hb-text-2);
}

.hb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    margin-top: .5rem;
    font-size: 13px;
    color: var(--hb-text-2);
}

.hb-meta span b {
    font-weight: 500;
    color: var(--hb-text);
}

.hb-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

/* ---------- Module tabs ---------- */

.hb-module-nav {
    display: flex;
    gap: .25rem;
    margin: 0 -1.5rem 0 -2rem;
    padding: 0 1.5rem 0 2rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--hb-border);
    background: var(--hb-surface);
}

.hb-module-nav a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .8rem .75rem .7rem;
    border-bottom: 2px solid transparent;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    color: var(--hb-text-2);
}

.hb-module-nav a:hover {
    color: var(--hb-text);
}

.hb-module-nav a.active {
    border-bottom-color: var(--hb-accent);
    color: var(--hb-text);
}

.hb-module-nav .hb-module-brand {
    margin-right: .75rem;
    padding-left: 0;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--hb-text);
}

.hb-module-nav .hb-module-switch {
    margin-left: auto;
    color: var(--hb-text-3);
}

.hb-module-nav .hb-module-switch .mud-icon-root {
    font-size: 16px;
}

.hb-module-brand .hb-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--hb-accent-fill);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

/* ---------- Panels / sections ---------- */

.hb-panel {
    margin-bottom: 1rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    background: var(--hb-surface);
    box-shadow: var(--hb-shadow);
}

.hb-panel-head {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem 1rem;
    padding: 1rem 1.25rem .85rem;
}

.hb-panel-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--hb-text);
}

.hb-panel-desc {
    margin: .2rem 0 0;
    max-width: 60rem;
    font-size: 13px;
    color: var(--hb-text-2);
}

.hb-panel-head > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.hb-panel-actions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .375rem;
}

.hb-toolbar .mud-input,
.hb-toolbar .mud-select-input,
.hb-toolbar .mud-input-slot {
    font-size: 13.5px;
}

.hb-toolbar .mud-input.mud-input-outlined.mud-input-margin-dense .mud-input-slot {
    padding-top: 7px;
    padding-bottom: 7px;
}

.hb-panel-body {
    padding: 0 1.25rem 1.25rem;
}

.hb-panel-body.flush {
    padding: 0;
}

.hb-panel-foot {
    padding: .65rem 1.25rem;
    border-top: 1px solid var(--hb-border);
    background: var(--hb-surface-muted);
    border-radius: 0 0 var(--hb-radius) var(--hb-radius);
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    padding: 0 .4rem;
    border-radius: 999px;
    background: var(--hb-neutral-bg);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--hb-text-2);
}

.hb-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--hb-border);
    border-bottom: 1px solid var(--hb-border);
    background: var(--hb-surface-muted);
}

.hb-toolbar .hb-grow {
    flex: 1 1 16rem;
    min-width: 12rem;
}

.hb-toolbar-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--hb-text-3);
}

.hb-note {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .6rem .8rem;
    border-radius: var(--hb-radius-sm);
    background: var(--hb-surface-muted);
    border: 1px solid var(--hb-border);
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-note.info {
    background: var(--hb-info-bg);
    border-color: transparent;
    color: var(--hb-info);
}

.hb-note.warning {
    background: var(--hb-warning-bg);
    border-color: transparent;
    color: var(--hb-warning);
}

.hb-note.simulated {
    background: var(--hb-simulated-bg);
    border-color: transparent;
    color: var(--hb-simulated);
}

.hb-note .mud-icon-root {
    flex: none;
    font-size: 18px;
    margin-top: 1px;
}

/* ---------- Status badges ---------- */

.hb-status {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    height: 22px;
    padding: 0 .55rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

.hb-status::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.hb-status.nodot::before {
    display: none;
}

.hb-status.outline {
    background: transparent !important;
    box-shadow: inset 0 0 0 1px var(--hb-border-strong);
}

.hb-status.success { background: var(--hb-success-bg); color: var(--hb-success); }
.hb-status.success::before { background: var(--hb-success-dot); }
.hb-status.warning { background: var(--hb-warning-bg); color: var(--hb-warning); }
.hb-status.warning::before { background: var(--hb-warning-dot); }
.hb-status.danger { background: var(--hb-danger-bg); color: var(--hb-danger); }
.hb-status.danger::before { background: var(--hb-danger-dot); }
.hb-status.info { background: var(--hb-info-bg); color: var(--hb-info); }
.hb-status.info::before { background: var(--hb-info-dot); }
.hb-status.neutral { background: var(--hb-neutral-bg); color: var(--hb-neutral); }
.hb-status.neutral::before { background: var(--hb-neutral-dot); }
.hb-status.simulated { background: var(--hb-simulated-bg); color: var(--hb-simulated); }
.hb-status.simulated::before { background: var(--hb-simulated-dot); }

.hb-tag {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    height: 22px;
    padding: 0 .5rem;
    border-radius: var(--hb-radius-sm);
    border: 1px solid var(--hb-border);
    background: var(--hb-surface);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
    color: var(--hb-text-3);
}

.hb-tag.on {
    border-color: transparent;
    background: var(--hb-success-bg);
    color: var(--hb-success);
}

.hb-tag.warn {
    border-color: transparent;
    background: var(--hb-warning-bg);
    color: var(--hb-warning);
}

.hb-tag.unknown {
    border-color: transparent;
    background: var(--hb-neutral-bg);
    color: var(--hb-neutral);
}

.hb-tags.nowrap {
    flex-wrap: nowrap;
}

.hb-tag .paused {
    margin-left: .1rem;
    opacity: .8;
}

.hb-tag .mud-icon-root {
    font-size: 14px;
}

.hb-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .25rem;
}

/* ---------- Fields ---------- */

.hb-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 1rem 1.5rem;
    margin: 0;
}

.hb-fields.two {
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}

.hb-field {
    min-width: 0;
}

.hb-field dt {
    margin-bottom: .2rem;
    font-size: 12px;
    font-weight: 500;
    color: var(--hb-text-3);
}

.hb-field dd {
    margin: 0;
    font-size: 14px;
    color: var(--hb-text);
    overflow-wrap: anywhere;
}

.hb-field dd.empty {
    color: var(--hb-text-3);
}

.hb-field.wide {
    grid-column: 1 / -1;
}

.hb-group-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 1.5rem 0 .75rem;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--hb-text-3);
}

.hb-group-title:first-child {
    margin-top: 0;
}

.hb-group-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--hb-border);
}

/* ---------- KPIs ---------- */

.hb-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.hb-kpi {
    display: block;
    padding: .9rem 1rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    background: var(--hb-surface);
    box-shadow: var(--hb-shadow);
    text-decoration: none;
    color: inherit;
}

a.hb-kpi:hover,
button.hb-kpi:hover {
    border-color: var(--hb-border-strong);
}

button.hb-kpi {
    width: 100%;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.hb-kpi.selected {
    border-color: var(--hb-accent);
    box-shadow: 0 0 0 1px var(--hb-accent);
}

.hb-kpi-label {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--hb-text-2);
}

.hb-kpi-value {
    margin-top: .2rem;
    font-size: 26px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.hb-kpi-hint {
    margin-top: .1rem;
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-kpi .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ---------- Workspace (detail pages with section rail) ---------- */

.hb-workspace {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.hb-rail {
    position: sticky;
    top: 4.5rem;
    padding: .5rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    background: var(--hb-surface);
    box-shadow: var(--hb-shadow);
}

.hb-rail-group {
    padding: .65rem .6rem .3rem;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--hb-text-3);
}

.hb-rail a {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .42rem .6rem;
    border-radius: var(--hb-radius-sm);
    font-size: 13.5px;
    text-decoration: none;
    color: var(--hb-text-2);
}

.hb-rail a .mud-icon-root {
    flex: none;
    font-size: 18px;
    color: var(--hb-text-3);
}

.hb-rail a:hover {
    background: var(--hb-surface-muted);
    color: var(--hb-text);
}

.hb-rail a.active {
    background: var(--hb-accent-soft);
    font-weight: 500;
    color: var(--hb-accent-hover);
}

.hb-rail a.active .mud-icon-root {
    color: var(--hb-accent);
}

.hb-rail a .label {
    flex: 1;
    min-width: 0;
}

.hb-rail a .flag {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--hb-warning-dot);
}

.hb-rail a .flag.ok {
    background: var(--hb-success-dot);
}

.hb-content {
    min-width: 0;
    container-type: inline-size;
}

@container (max-width: 760px) {
    .hb-content .hb-grid > .span-4,
    .hb-content .hb-grid > .span-5,
    .hb-content .hb-grid > .span-6,
    .hb-content .hb-grid > .span-7,
    .hb-content .hb-grid > .span-8 {
        grid-column: span 12;
    }
}

/* ---------- Tables ---------- */

.hb .mud-table.hb-table,
.hb-dialog .mud-table.hb-table {
    border-radius: 0 0 var(--hb-radius) var(--hb-radius);
    box-shadow: none;
    background: transparent;
}

.hb-table .mud-table-container {
    border-radius: 0;
}

.hb-table .mud-table-head .mud-table-cell {
    padding: .55rem .75rem;
    border-bottom: 1px solid var(--hb-border);
    background: var(--hb-surface-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--hb-text-2);
    white-space: nowrap;
}

.hb-table .mud-table-body .mud-table-cell {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--hb-border);
    font-size: 13.5px;
    color: var(--hb-text);
    vertical-align: middle;
}

.hb-table .mud-table-head .mud-table-cell:first-child,
.hb-table .mud-table-body .mud-table-cell:first-child {
    padding-left: 1.25rem;
}

.hb-table .mud-table-head .mud-table-cell:last-child,
.hb-table .mud-table-body .mud-table-cell:last-child {
    padding-right: 1.25rem;
}

.hb-table .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: none;
}

.hb-table.clickable .mud-table-body .mud-table-row {
    cursor: pointer;
}

.hb-table .mud-table-body .mud-table-row:hover .mud-table-cell {
    background: var(--hb-row-hover);
}

.hb-table .mud-table-pagination {
    border-top: 1px solid var(--hb-border);
}

.hb-table .mud-table-pagination-toolbar {
    min-height: 44px;
    padding: 0 .75rem;
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-table .mud-table-pagination-caption,
.hb-table .mud-table-pagination .mud-select-input {
    font-size: 12.5px;
}

.hb-table .mud-table-pagination .mud-input-outlined,
.hb-table .mud-table-pagination .mud-select-input {
    background: transparent;
}

.hb-table .mud-table-sort-label {
    font-weight: 600;
}

.hb-table .actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.hb-cell-primary {
    display: block;
    font-weight: 500;
    color: var(--hb-text);
    text-decoration: none;
}

a.hb-cell-primary:hover {
    color: var(--hb-accent);
    text-decoration: underline;
}

.hb-cell-secondary {
    display: block;
    margin-top: .1rem;
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-cell-clip {
    display: inline-block;
    max-width: 15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.hb-cell-break {
    display: block;
    max-width: 26rem;
    overflow-wrap: anywhere;
}

.hb-row-actions {
    display: inline-flex;
    align-items: center;
    gap: .125rem;
}

.hb-row-actions .mud-icon-button {
    padding: 6px;
    color: var(--hb-text-3);
}

.hb-row-actions .mud-icon-button:hover {
    color: var(--hb-text);
}

.hb-row-actions .mud-icon-button.danger:hover {
    color: var(--hb-danger);
}

.hb-row-actions .mud-icon-button .mud-icon-root {
    font-size: 19px;
}

/* ---------- Empty / error / loading ---------- */

.hb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 2.25rem 1.25rem;
    text-align: center;
}

.hb-empty .glyph {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: .35rem;
    border-radius: 12px;
    background: var(--hb-neutral-bg);
    color: var(--hb-text-3);
}

.hb-empty.error .glyph {
    background: var(--hb-danger-bg);
    color: var(--hb-danger);
}

.hb-empty .title {
    font-size: 14.5px;
    font-weight: 600;
}

.hb-empty .text {
    max-width: 30rem;
    font-size: 13px;
    color: var(--hb-text-2);
}

.hb-empty .action {
    margin-top: .5rem;
}

.hb-skeleton {
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--hb-skeleton-a) 25%, var(--hb-skeleton-b) 50%, var(--hb-skeleton-a) 75%);
    background-size: 200% 100%;
    animation: hb-shimmer 1.2s infinite linear;
}

@keyframes hb-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.hb-alert {
    margin: 0 1.25rem 1rem;
}

.hb-panel-body > .hb-alert,
.hb-dialog .hb-alert {
    margin: 0 0 1rem;
}

/* ---------- Segmented control ---------- */

.hb-segmented {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--hb-border-strong);
    border-radius: 8px;
    background: var(--hb-surface);
}

.hb-segmented button {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    height: 30px;
    padding: 0 .7rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--hb-text-2);
    cursor: pointer;
}

.hb-segmented button:hover:not([disabled], [aria-checked="true"]) {
    color: var(--hb-text);
}

.hb-segmented button[aria-checked="true"] {
    background: var(--hb-text);
    color: var(--hb-on-text);
}

.hb-segmented button[disabled] {
    opacity: .5;
    cursor: default;
}

.hb-segmented .count {
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    opacity: .7;
}

/* ---------- Cards grid ---------- */

.hb-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.hb-grid > .span-4 { grid-column: span 4; }
.hb-grid > .span-5 { grid-column: span 5; }
.hb-grid > .span-6 { grid-column: span 6; }
.hb-grid > .span-7 { grid-column: span 7; }
.hb-grid > .span-8 { grid-column: span 8; }
.hb-grid > .span-12 { grid-column: span 12; }
.hb-grid > * > .hb-panel:only-child { height: calc(100% - 1rem); }

.hb-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hb-list > li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.25rem;
    border-top: 1px solid var(--hb-border);
}

.hb-list > li .grow {
    flex: 1;
    min-width: 0;
}

.hb-list > li strong {
    display: block;
    font-weight: 500;
}

.hb-list > li small {
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-list > li small a {
    color: var(--hb-accent);
    text-decoration: underline;
}

.hb-list > li a.hb-row-link {
    font-weight: 500;
    text-decoration: none;
}

.hb-list > li a.hb-row-link:hover {
    color: var(--hb-accent);
    text-decoration: underline;
}

.hb-nav-card {
    display: flex;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    color: inherit;
}

.hb-nav-card:hover .hb-nav-card-title {
    color: var(--hb-accent);
}

.hb-nav-card .glyph {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--hb-accent-soft);
    color: var(--hb-accent);
}

.hb-nav-card-title {
    font-size: 15px;
    font-weight: 600;
}

.hb-nav-card p {
    margin: .2rem 0 0;
    font-size: 13px;
    color: var(--hb-text-2);
}

/* ---------- Secret value ---------- */

.hb-secret {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: .2rem .5rem;
    border-radius: var(--hb-radius-sm);
    background: var(--hb-surface-muted);
    border: 1px solid var(--hb-border);
    font-family: var(--hb-mono);
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

/* ---------- Stepper (onboarding) ---------- */

.hb-steps {
    display: flex;
    gap: .5rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    counter-reset: hb-step;
}

.hb-steps li {
    display: flex;
    flex: 1;
    align-items: center;
    gap: .5rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--hb-border);
    font-size: 13px;
    font-weight: 500;
    color: var(--hb-text-3);
    counter-increment: hb-step;
}

.hb-steps li::before {
    content: counter(hb-step);
    display: grid;
    flex: none;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--hb-neutral-bg);
    font-size: 12px;
    font-weight: 600;
}

.hb-steps li.current {
    border-bottom-color: var(--hb-accent);
    color: var(--hb-text);
}

.hb-steps li.current::before {
    background: var(--hb-accent-fill);
    color: #fff;
}

.hb-steps li.done {
    border-bottom-color: var(--hb-success-dot);
    color: var(--hb-text-2);
}

.hb-steps li.done::before {
    content: "\2713";
    background: var(--hb-success-bg);
    color: var(--hb-success);
}

.hb-choice-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    overflow: hidden;
}

.hb-choice-list li + li {
    border-top: 1px solid var(--hb-border);
}

.hb-choice {
    display: flex;
    width: 100%;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1rem;
    border: none;
    background: var(--hb-surface);
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.hb-choice:hover:not([disabled]) {
    background: var(--hb-surface-muted);
}

.hb-choice[aria-pressed="true"] {
    background: var(--hb-accent-soft);
    box-shadow: inset 3px 0 0 var(--hb-accent);
}

.hb-choice[disabled] {
    cursor: default;
    opacity: .6;
}

.hb-choice .grow {
    flex: 1;
    min-width: 0;
}

.hb-choice strong {
    display: block;
    font-weight: 500;
}

.hb-choice small {
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.hb-option-card {
    display: flex;
    gap: .75rem;
    padding: .9rem 1rem;
    border: 1px solid var(--hb-border-strong);
    border-radius: var(--hb-radius);
    background: var(--hb-surface);
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.hb-option-card[aria-checked="true"] {
    border-color: var(--hb-accent);
    box-shadow: 0 0 0 1px var(--hb-accent);
    background: var(--hb-accent-soft);
}

.hb-option-card[disabled] {
    opacity: .5;
    cursor: default;
}

.hb-option-card .mud-icon-root {
    flex: none;
    color: var(--hb-accent);
}

.hb-option-card strong {
    display: block;
    font-weight: 600;
}

.hb-option-card small {
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-selected-entity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    background: var(--hb-surface-muted);
}

.hb-selected-entity .grow {
    flex: 1;
    min-width: 12rem;
}

.hb-selected-entity strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

/* ---------- MudBlazor overrides inside HBEDS ---------- */

.hb .mud-button-root,
.hb-dialog .mud-button-root {
    border-radius: var(--hb-radius-sm);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.hb .mud-button-filled.mud-button-filled-primary,
.hb-dialog .mud-button-filled.mud-button-filled-primary {
    background: var(--hb-accent-fill);
    box-shadow: none;
}

.hb .mud-button-filled.mud-button-filled-primary:hover,
.hb-dialog .mud-button-filled.mud-button-filled-primary:hover {
    background: var(--hb-accent-fill-hover);
}

.hb .mud-button-outlined.mud-button-outlined-default,
.hb-dialog .mud-button-outlined.mud-button-outlined-default {
    border-color: var(--hb-border-strong);
    background: var(--hb-surface);
    color: var(--hb-text);
}

.hb .mud-input-outlined,
.hb .mud-select-input,
.hb-dialog .mud-input-outlined,
.hb-dialog .mud-select-input {
    border-radius: var(--hb-radius-sm);
}

.hb .mud-input.mud-input-outlined .mud-input-outlined-border,
.hb-dialog .mud-input.mud-input-outlined .mud-input-outlined-border {
    border-radius: var(--hb-radius-sm);
}

.hb .hb-toolbar .mud-input-control,
.hb .hb-panel-head .mud-input-control {
    margin-top: 0;
}

.hb .mud-alert {
    border-radius: var(--hb-radius-sm);
}

.hb-dialog.mud-dialog {
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, .18);
}

.hb-dialog .mud-dialog-title {
    padding: 1.1rem 1.5rem .25rem;
    font-size: 17px;
    font-weight: 600;
}

.hb-dialog .mud-dialog-title .mud-typography {
    font-size: 17px;
    font-weight: 600;
}

.hb-dialog .mud-dialog-content {
    padding: .75rem 1.5rem 1rem;
}

.hb-dialog .mud-dialog-actions {
    gap: .5rem;
    padding: .85rem 1.5rem;
    border-top: 1px solid var(--hb-border);
    background: var(--hb-surface-muted);
    border-radius: 0 0 12px 12px;
}

.hb-dialog .mud-dialog-actions > :not(:first-child) {
    margin-left: 0 !important;
}

.hb-dialog-intro {
    margin: 0 0 1rem;
    font-size: 13px;
    color: var(--hb-text-2);
}

/* MudForm adds a gap-0 utility class from MudBlazor 9.12; HBEDS forms keep their field spacing. */
.mud-form.hb-form {
    display: grid;
    gap: 1rem !important;
}

.hb-form .mud-input-control {
    margin-top: 0;
}

.hb-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1rem;
}

.hb-form-section {
    margin: .25rem 0 -.25rem;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--hb-text-3);
}

.hb-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem .85rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius-sm);
    background: var(--hb-surface-muted);
}

.hb-switch-row strong {
    display: block;
    font-size: 13.5px;
    font-weight: 500;
}

.hb-switch-row small {
    font-size: 12px;
    color: var(--hb-text-2);
}

.hb-switch-row .mud-switch {
    margin: 0;
}

.hb-confirm {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.hb-confirm .glyph {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--hb-info-bg);
    color: var(--hb-info);
}

.hb-confirm .glyph.danger {
    background: var(--hb-danger-bg);
    color: var(--hb-danger);
}

.hb-confirm p {
    margin: .4rem 0 0;
    color: var(--hb-text-2);
}

.hb-section-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 1.25rem 0 .75rem;
}

.hb-section-label h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.hb-section-label:first-child {
    margin-top: 0;
}

.hb-block {
    padding: 1rem 1.1rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    background: var(--hb-surface);
}

.hb-block + .hb-block {
    margin-top: .75rem;
}

.hb-block.shared {
    border-style: dashed;
    background: var(--hb-surface-muted);
}

.hb-dialog .hb-table .mud-table-head .mud-table-cell:first-child,
.hb-dialog .hb-table .mud-table-body .mud-table-cell:first-child {
    padding-left: .85rem;
}

.hb-dialog .hb-table .mud-table-head .mud-table-cell:last-child,
.hb-dialog .hb-table .mud-table-body .mud-table-cell:last-child {
    padding-right: .85rem;
}

.hb-table-frame {
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    overflow: hidden;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .hb-grid > .span-4,
    .hb-grid > .span-5,
    .hb-grid > .span-6,
    .hb-grid > .span-7,
    .hb-grid > .span-8 {
        grid-column: span 12;
    }
}

@media (max-width: 1199.98px) {
    .hb-workspace {
        grid-template-columns: minmax(0, 1fr);
        gap: .75rem;
    }

    .hb-rail {
        position: static;
        display: flex;
        gap: .25rem;
        padding: .35rem;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .hb-rail-group {
        display: none;
    }

    .hb-rail a {
        flex: none;
        white-space: nowrap;
    }
}

@media (max-width: 640.98px) {
    .hb {
        margin: -1.1rem -1rem 0;
        padding: 0 1rem 2rem;
    }

    .hb-module-nav {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .hb-header-actions {
        width: 100%;
    }

    .hb-title {
        font-size: 20px;
    }

    .hb-panel-head,
    .hb-toolbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hb-panel-head {
        flex-wrap: wrap;
    }

    .hb-panel-body {
        padding: 0 1rem 1rem;
    }

    .hb-table .mud-table-head .mud-table-cell:first-child,
    .hb-table .mud-table-body .mud-table-cell:first-child {
        padding-left: 1rem;
    }

    .hb-steps li span {
        display: none;
    }
}

.hb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


.hb-warning-text {
    color: var(--hb-warning);
}

.hb-fixed-button {
    min-width: 5.75rem;
}

.hb-table .mud-table-body .mud-table-row.hb-row-changed .mud-table-cell {
    background: var(--hb-row-changed);
}

.hb-table .mud-table-body .mud-table-row.hb-row-changed .mud-table-cell:first-child {
    box-shadow: inset 3px 0 0 var(--hb-warning-dot);
}

.hb-strong {
    font-weight: 600;
}

.hb-table .mud-table-cell.hb-map-arrow {
    width: 1%;
    padding-left: 0 !important;
    padding-right: 0 !important;
    color: var(--hb-text-3);
}

.hb-source {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.hb-filter {
    width: 13.5rem;
}

.hb-table .mud-table-container {
    position: relative;
    overflow-x: auto;
}

/* ---------- Operational overview ---------- */

/* Dialogs render outside the page container, so they need the chart colors too. */
.hb,
.hb-dialog {
    --hb-age-0: #1e4f8f;
    --hb-age-1: #3b78c4;
    --hb-age-2: #7ea7da;
    --hb-age-3: #b8cfeb;
    --hb-age-4: #dde7f4;
    --hb-age-none: repeating-linear-gradient(135deg, #eef0f3 0 4px, #dfe3e8 4px 8px);
    --hb-arrival: #7ea7da;
    --hb-completion: #1e4f8f;
}

:root[data-theme="dark"] .hb,
:root[data-theme="dark"] .hb-dialog {
    --hb-age-0: #3b78c4;
    --hb-age-1: #2f619f;
    --hb-age-2: #284d7a;
    --hb-age-3: #233b59;
    --hb-age-4: #1f2c3e;
    --hb-age-none: repeating-linear-gradient(135deg, #222429 0 4px, #2a2d33 4px 8px);
    --hb-arrival: #5b8fd1;
    --hb-completion: #9cc2f2;
}

:root[data-theme="dark"] .hb-fresh-matrix td:not(.empty) {
    color: #ffffff;
}

.hb-ops-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
    padding: .6rem .9rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    background: var(--hb-surface);
    box-shadow: var(--hb-shadow);
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-ops-bar .grow {
    flex: 1 1 auto;
}

.hb-ops-bar b {
    font-weight: 600;
    color: var(--hb-text);
}

.hb-ops-bar .mud-switch {
    margin: 0;
}

.hb-ops-bar .mud-switch .mud-typography {
    font-size: 12.5px;
}

/* At most four cards per row: wide screens keep two rows and the cards grow wider rather than squeezing onto one line. */
.hb-signals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.hb-signals .hb-signal-database {
    grid-column: span 2;
}

.hb-signal {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;
    padding: .85rem 1rem .9rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    background: var(--hb-surface);
    box-shadow: var(--hb-shadow);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

.hb-signal::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--hb-neutral-dot);
}

.hb-signal.danger::before { background: var(--hb-danger-dot); }
.hb-signal.warning::before { background: var(--hb-warning-dot); }
.hb-signal.simulated::before { background: var(--hb-simulated-dot); }
.hb-signal.info::before { background: var(--hb-info-dot); }
.hb-signal.success::before { background: var(--hb-success-dot); }

a.hb-signal:hover {
    border-color: var(--hb-border-strong);
}

.hb-signal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hb-text-3);
}

.hb-signal-headline {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--hb-text);
}

.hb-signal-detail {
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-chart {
    position: relative;
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    gap: 0 .5rem;
    padding: 1rem 1.25rem .75rem 1rem;
}

.hb-chart-axis {
    position: relative;
    height: 180px;
    font-size: 11px;
    text-align: right;
    color: var(--hb-text-3);
    font-variant-numeric: tabular-nums;
}

.hb-chart-axis span {
    position: absolute;
    right: 0;
    transform: translateY(-50%);
}

.hb-chart-plot {
    position: relative;
    height: 180px;
    border-bottom: 1px solid var(--hb-border-strong);
    background-image: linear-gradient(var(--hb-border) 1px, transparent 1px);
    background-size: 100% 25%;
}

.hb-chart-bars {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    gap: 1px;
}

.hb-chart-col {
    position: relative;
    flex: 1 1 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.hb-chart-col:hover {
    background: var(--hb-chart-hover);
}

button.hb-chart-col {
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

button.hb-chart-col:focus-visible {
    outline: 2px solid var(--hb-accent);
    outline-offset: -2px;
}

.hb-chart-col .hb-chart-bar {
    display: block;
}

.hb-throughput-views {
    max-width: 100%;
}

/* The shared selected state fills with the text color, which reads as bright white in the dark theme; this switch uses the subdued neutral surface. */
.hb-throughput-views .hb-segmented button[aria-checked="true"] {
    background: var(--hb-neutral-bg);
    box-shadow: inset 0 0 0 1px var(--hb-border-strong);
    font-weight: 600;
    color: var(--hb-text);
}

.hb-throughput-views .hb-segmented button[aria-checked="true"] .count {
    opacity: .85;
}

.hb-throughput-views .hb-segmented button:focus-visible {
    outline: 2px solid var(--hb-accent);
    outline-offset: 1px;
}

.hb-copyable {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    max-width: 100%;
    min-width: 0;
    vertical-align: middle;
}

.hb-copyable .hb-copyable-tip {
    display: block;
    min-width: 0;
    overflow: hidden;
}

.hb-copyable-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-copyable-action {
    flex: none;
}

.hb-throughput-snapshot {
    min-width: 0;
}

.hb-throughput-snapshot .hb-copyable {
    display: flex;
}

/* A fixed width keeps the table column steady on desktop; stacked phone cards let the identifier shrink beside its label instead. */
@media (min-width: 600px) {
    .hb-throughput-identifier {
        width: 26rem;
        max-width: 100%;
    }

    /* Batch IDs are long GUIDs; the start identifies a batch and the copy button carries the rest. */
    .hb-outbound-batch .hb-throughput-identifier {
        width: 9.5rem;
    }
}

/* Table layout sizes cells to their content, so a viewport-relative cap is what lets the single-line identifier shrink inside a phone card. */
@media (max-width: 599.98px) {
    .hb-throughput-identifier {
        max-width: 45vw;
    }
}

.hb-copyable-heading {
    display: flex;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .hb-throughput-views,
    .hb-throughput-views .hb-segmented {
        width: 100%;
    }

    .hb-throughput-views .hb-segmented {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
}

.hb-throughput-row {
    cursor: pointer;
}

.hb-throughput-error {
    display: -webkit-box;
    max-width: 22rem;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--hb-danger);
}

.hb-chart-bar {
    width: 100%;
    min-height: 0;
    border-radius: 2px 2px 0 0;
    background: var(--hb-arrival);
}

.hb-chart-line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.hb-chart-line polyline {
    fill: none;
    stroke: var(--hb-completion);
    stroke-width: 2;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.hb-chart-x {
    position: relative;
    grid-column: 2;
    height: 1.4rem;
    font-size: 11px;
    color: var(--hb-text-3);
    font-variant-numeric: tabular-nums;
}

.hb-chart-x span {
    position: absolute;
    top: .3rem;
    transform: translateX(-50%);
    white-space: nowrap;
}

.hb-chart-x span.start {
    transform: none;
}

.hb-chart-x span.end {
    transform: translateX(-100%);
    text-align: right;
}

.hb-chart-x .date {
    font-weight: inherit;
}

/* Dated labels are too wide for every tick on a narrow chart: show every other tick, and on phones put the date above the time. */
@media (max-width: 899.98px) {
    .hb-chart-x.multi-day > span:nth-child(even) {
        display: none;
    }
}

@media (max-width: 599.98px) {
    .hb-chart-x.multi-day {
        height: 2.3rem;
    }

    .hb-chart-x.multi-day > span {
        line-height: 1.25;
        text-align: center;
    }

    .hb-chart-x.multi-day > span.start {
        text-align: left;
    }

    .hb-chart-x.multi-day > span.end {
        text-align: right;
    }

    .hb-chart-x.multi-day .date {
        display: block;
    }
}

.hb-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    font-size: 12px;
    color: var(--hb-text-2);
}

.hb-legend span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.hb-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.hb-legend i.line {
    height: 3px;
    border-radius: 2px;
}

.hb-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 2rem;
    padding: 0 1.25rem;
}

.hb-summary-row div {
    display: flex;
    flex-direction: column;
}

.hb-summary-row small {
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-summary-row strong {
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.hb-segbar {
    display: flex;
    height: 12px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--hb-neutral-bg);
}

.hb-segbar > span {
    min-width: 3px;
    height: 100%;
}

.hb-segbar > span + span {
    box-shadow: inset 1px 0 0 var(--hb-segment-gap);
}

.hb-seg-legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    gap: .3rem 1rem;
    margin: .6rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
}

.hb-seg-legend li {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
    color: var(--hb-text-2);
}

.hb-seg-legend li b {
    margin-left: auto;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--hb-text);
}

.hb-seg-legend li.zero {
    opacity: .55;
}

.hb-seg-select {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: .4rem;
    min-width: 0;
    margin: -.15rem -.3rem;
    padding: .15rem .3rem;
    border: 0;
    border-radius: 4px;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.hb-seg-select:hover {
    background: var(--hb-neutral-bg);
    color: var(--hb-text);
}

.hb-seg-select:focus-visible {
    outline: 2px solid var(--hb-accent);
    outline-offset: 1px;
}

.hb-seg-select b {
    margin-left: auto;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--hb-text);
}

.hb-segbar span.selectable {
    cursor: pointer;
}

.hb-segbar span.selectable:hover {
    filter: brightness(.9);
}

.hb-seg-legend i {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.age-0 { background: var(--hb-age-0); }
.age-1 { background: var(--hb-age-1); }
.age-2 { background: var(--hb-age-2); }
.age-3 { background: var(--hb-age-3); }
.age-4 { background: var(--hb-age-4); }
.age-none { background: var(--hb-age-none); }
.seq-received { background: #b8cfeb; }
.seq-parsed { background: #7ea7da; }
.seq-queued { background: #3b78c4; }
.seq-processing { background: #1e4f8f; }
.hb-segbar .danger, .hb-seg-legend i.danger, .tone-danger { background: var(--hb-danger-dot); }
.hb-segbar .warning, .hb-seg-legend i.warning, .tone-warning { background: var(--hb-warning-dot); }
.tone-success { background: var(--hb-success-dot); }
.tone-info { background: var(--hb-info-dot); }
.tone-simulated { background: var(--hb-simulated-dot); }
.tone-neutral { background: var(--hb-neutral-dot); }

.hb-big {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.hb-big small {
    font-size: 13px;
    font-weight: 400;
    color: var(--hb-text-2);
}

/* Reversed so a strip wider than its card opens scrolled to the newest windows; the padding keeps focus outlines inside the scroll area. */
.hb-strip-scroll {
    display: flex;
    flex-direction: row-reverse;
    margin: -3px;
    padding: 3px;
    overflow-x: auto;
}

/* As wide as the card, or as the cells' minimum widths need when that is wider. */
.hb-strip-track {
    flex: 1 0 auto;
    min-width: min-content;
}

.hb-strip {
    display: flex;
    gap: 1px;
    height: 22px;
    align-items: stretch;
}

.hb-strip > span {
    flex: 1 1 0;
    min-width: 2px;
    max-width: 14px;
    border-radius: 2px;
}

.hb-strip > span > button {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    cursor: pointer;
}

.hb-strip > span > button:hover {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25);
}

.hb-strip > span > button:focus-visible {
    outline: 2px solid var(--hb-accent);
    outline-offset: 1px;
}

.hb-strip-axis {
    display: flex;
    justify-content: space-between;
    margin-top: .25rem;
    font-size: 11px;
    color: var(--hb-text-3);
    font-variant-numeric: tabular-nums;
}

/* A reporting card is narrow on wide layouts, so its actions move below the title rather than squeezing the title and its status chip. */
.hb-target-head {
    flex-wrap: wrap;
}

.hb-target-head > div:first-child {
    flex-basis: 12rem;
}

.hb-target-head .hb-panel-title {
    flex-wrap: wrap;
    row-gap: .25rem;
}

.hb-target-card {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.hb-target-card .hb-block-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .35rem;
    font-size: 12px;
    font-weight: 600;
    color: var(--hb-text-3);
}

.hb-attention-row {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    gap: .25rem .75rem;
    align-items: start;
    padding: .7rem 1.25rem;
    border-top: 1px solid var(--hb-border);
}

.hb-attention-row .glyph {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--hb-danger-bg);
    color: var(--hb-danger);
}

.hb-attention-row .glyph.warning {
    background: var(--hb-warning-bg);
    color: var(--hb-warning);
}

.hb-attention-row .glyph.neutral {
    background: var(--hb-neutral-bg);
    color: var(--hb-neutral);
}

.hb-attention-row .glyph .mud-icon-root {
    font-size: 17px;
}

.hb-attention-row .what {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .5rem;
    font-weight: 500;
}

.hb-attention-row .meta {
    margin-top: .15rem;
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-attention-row .when {
    font-size: 12.5px;
    text-align: right;
    white-space: nowrap;
    color: var(--hb-text-2);
}

.hb-attention-row .when a {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    margin-top: .2rem;
    font-weight: 500;
    color: var(--hb-accent);
    text-decoration: none;
}

.hb-attention-row .when a:hover {
    text-decoration: underline;
}

.hb-link-button {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    margin-top: .2rem;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 500;
    color: var(--hb-accent);
    cursor: pointer;
}

.hb-link-button:hover {
    text-decoration: underline;
}

.hb-link-button:focus-visible {
    outline: 2px solid var(--hb-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.hb-link-button:disabled {
    color: var(--hb-text-3);
    cursor: default;
}

.hb-drilldown-title:focus {
    outline: none;
}

.hb-monitor-evidence small {
    color: var(--hb-text-2);
}

.hb-unmonitored {
    margin: .25rem 0 0;
    padding-left: 1rem;
}

.hb-condition-list {
    margin: .3rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: var(--hb-text-2);
}

.hb-condition-list > li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .15rem .4rem;
    padding: .1rem 0;
    border: 0;
}

.hb-condition-list > li.cleared {
    color: var(--hb-text-3);
}

.hb-condition-list .hb-tag {
    font-size: 11px;
}

.hb-context-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .4rem;
    margin-top: .3rem;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 12px;
    color: var(--hb-accent);
    cursor: pointer;
}

.hb-context-toggle:focus-visible {
    outline: 2px solid var(--hb-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.hb-context-detail {
    padding: .25rem 1rem .75rem 1.5rem;
    background: var(--hb-surface-muted);
}

.hb-context-coverage {
    display: grid;
    gap: .4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hb-context-coverage > li {
    display: grid;
    grid-template-columns: minmax(12rem, 18rem) auto minmax(0, 1fr);
    align-items: center;
    gap: .25rem .75rem;
    font-size: 12.5px;
}

.hb-context-coverage .code {
    display: flex;
    flex-wrap: wrap;
    gap: .15rem .4rem;
}

.hb-context-coverage small {
    color: var(--hb-text-2);
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .hb-context-coverage > li {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .hb-context-coverage small {
        grid-column: 1 / -1;
    }
}

.hb-status-counts {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .75rem;
}

.hb-status-counts > span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.hb-scroll {
    max-height: 30rem;
    overflow-y: auto;
}

.hb-chip-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.hb-chip-filter button {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    height: 26px;
    padding: 0 .6rem;
    border: 1px solid var(--hb-border-strong);
    border-radius: 999px;
    background: var(--hb-surface);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--hb-text-2);
    cursor: pointer;
}

.hb-chip-filter button[aria-pressed="true"] {
    border-color: var(--hb-text);
    background: var(--hb-text);
    color: var(--hb-on-text);
}

.hb-chip-filter button b {
    font-variant-numeric: tabular-nums;
}

.hb-not-monitored {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .6rem;
    padding: .7rem 1rem;
    border: 1px dashed var(--hb-border-strong);
    border-radius: var(--hb-radius);
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-not-monitored .hb-tag {
    font-weight: 500;
    letter-spacing: 0;
}

.hb-truncated {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: 12px;
    color: var(--hb-warning);
}

@media (max-width: 1199.98px) {
    .hb-signals {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hb-signals .hb-signal-database {
        grid-column: span 3;
    }
}

@media (max-width: 899.98px) {
    .hb-signals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hb-signals .hb-signal-database {
        grid-column: span 2;
    }
}

@media (max-width: 640.98px) {
    .hb-signals {
        grid-template-columns: minmax(0, 1fr);
    }

    .hb-signals .hb-signal-database {
        grid-column: auto;
    }

    .hb-attention-row {
        grid-template-columns: 2rem minmax(0, 1fr);
    }

    .hb-attention-row .when {
        grid-column: 2;
        text-align: left;
    }

    .hb-chart {
        padding-left: .5rem;
        padding-right: .75rem;
    }
}

.hb-fresh-matrix {
    width: 100%;
    min-width: 40rem;
    border-collapse: separate;
    border-spacing: 4px;
    font-variant-numeric: tabular-nums;
}

.hb-fresh-matrix thead th {
    padding: 0 .25rem .25rem;
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    color: var(--hb-text-3);
}

.hb-fresh-matrix tbody th {
    width: 15rem;
    padding: .25rem .75rem .25rem 0;
    text-align: left;
    font-weight: 400;
}

.hb-fresh-matrix tbody th strong {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
}

.hb-fresh-matrix tbody th small {
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-fresh-matrix td {
    height: 2.5rem;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.hb-fresh-matrix td.empty {
    background: var(--hb-surface-muted);
    font-weight: 400;
    color: var(--hb-text-3);
}

.hb-fresh-matrix td.age-0,
.hb-fresh-matrix td.age-1 {
    color: #fff;
}

.hb-fresh-matrix td.age-none {
    color: var(--hb-text);
}

/* ---------- Data retention ---------- */

.hb-retention-measured {
    font-size: 12.5px;
    color: var(--hb-text-2);
    white-space: nowrap;
}

.hb-retention .hb-panel-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.hb-retention-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 1rem 2rem;
    padding: 0 1.25rem 1rem;
}

.hb-retention-summary > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    min-width: 0;
}

.hb-retention-summary small {
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-retention-summary strong {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
}

.hb-retention-summary > div > span:not(.hb-status) {
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-retention-strip {
    width: 100%;
    height: 18px;
    gap: 3px;
}

.hb-retention-strip > span {
    flex: 1 1 0;
    max-width: none;
    border-radius: 3px;
}

.hb-retention-legend {
    width: 100%;
    margin-top: .25rem;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}

.hb-retention-note {
    font-size: 12.5px;
    color: var(--hb-warning);
}

.hb-retention-table-wrap {
    overflow-x: auto;
    border-top: 1px solid var(--hb-border);
}

.hb-retention-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.hb-retention-table th,
.hb-retention-table td {
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--hb-border);
    text-align: left;
    vertical-align: top;
}

.hb-retention-table thead th {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--hb-text-3);
    background: var(--hb-surface-muted);
}

.hb-retention-table tbody tr:last-child > * {
    border-bottom: 0;
}

.hb-retention-table th:first-child,
.hb-retention-table td:first-child {
    padding-left: 1.25rem;
}

.hb-retention-table tbody th {
    font-weight: 400;
    box-shadow: inset 3px 0 0 transparent;
}

.hb-retention-table tbody tr.danger th { box-shadow: inset 3px 0 0 var(--hb-danger-dot); }
.hb-retention-table tbody tr.warning th { box-shadow: inset 3px 0 0 var(--hb-warning-dot); }

.hb-retention-table .name {
    font-weight: 600;
    color: var(--hb-text);
}

.hb-retention-table small {
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-retention-table .limitation {
    display: flex;
    align-items: flex-start;
    gap: .3rem;
    margin-top: .2rem;
    color: var(--hb-text-2);
}

.hb-retention-table .limitation.unavailable {
    color: var(--hb-warning);
}

.hb-retention-table .limitation .mud-icon-root {
    flex: none;
    font-size: 14px;
    margin-top: 1px;
}

.hb-retention-table .bounded,
.hb-retention-table .lag {
    font-weight: 600;
}

.hb-retention-table tr.danger .lag { color: var(--hb-danger); }
.hb-retention-table tr.warning .lag { color: var(--hb-warning); }

@media (max-width: 1099.98px) {
    .hb-retention-summary {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .hb-retention-summary > div:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 1023.98px) {
    .hb-retention .hb-panel-head {
        flex-wrap: wrap;
    }

    .hb-retention-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .hb-retention-summary > div:nth-child(2) {
        grid-row: auto;
    }

    .hb-retention-table thead {
        display: none;
    }

    .hb-retention-table,
    .hb-retention-table tbody,
    .hb-retention-table tr,
    .hb-retention-table th,
    .hb-retention-table td {
        display: block;
    }

    .hb-retention-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: .5rem 1rem;
        padding: .85rem 1.25rem;
        border-bottom: 1px solid var(--hb-border);
    }

    .hb-retention-table tbody tr.danger { box-shadow: inset 3px 0 0 var(--hb-danger-dot); }
    .hb-retention-table tbody tr.warning { box-shadow: inset 3px 0 0 var(--hb-warning-dot); }

    .hb-retention-table tbody th,
    .hb-retention-table td,
    .hb-retention-table th:first-child,
    .hb-retention-table td:first-child {
        padding: 0;
        border: 0;
        box-shadow: none !important;
    }

    .hb-retention-table tbody th {
        grid-column: 1 / -1;
    }

    .hb-retention-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--hb-text-3);
    }
}

/* ---------- Management overview ---------- */

.hb-coverage-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .35rem;
    font-size: 13px;
}

.hb-coverage-head > span,
.hb-coverage-head > a {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    font-weight: 500;
    text-decoration: none;
}

.hb-coverage-head > a:hover {
    color: var(--hb-accent);
    text-decoration: underline;
}

.hb-coverage-head b {
    font-weight: 600;
    white-space: nowrap;
}

.hb-coverage-head small {
    font-weight: 400;
    color: var(--hb-text-3);
}

.hb-capabilities {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hb-capabilities .hb-segbar {
    height: 8px;
    border-radius: 4px;
}

.hb-capability-note {
    display: block;
    margin-top: .3rem;
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-capability-split {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem .9rem;
    margin-top: .35rem;
    font-size: 12px;
    color: var(--hb-text-2);
}

.hb-capability-split span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.hb-capability-split i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.hb-attention-list > li {
    align-items: flex-start;
}

.hb-attention-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .6rem;
}

.hb-more {
    display: inline-block;
    margin-top: .2rem;
    font-size: 12px;
    color: var(--hb-text-3);
}

button.hb-more {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.hb-mapchips + .hb-more {
    margin-top: .4rem;
}

.hb-more:hover {
    color: var(--hb-accent);
}

/* ---------- Readiness ---------- */

.hb-fixes {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin: .4rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.hb-fixes a {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: .45rem;
    padding: .15rem 0;
    text-decoration: none;
}

.hb-fixes a .mud-icon-root {
    margin-top: .2em;
    font-size: 14px;
    color: var(--hb-warning-dot);
}

.hb-fixes .msg {
    color: var(--hb-text);
}

.hb-fixes .where {
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-fixes a:hover .msg {
    color: var(--hb-accent);
    text-decoration: underline;
}

.hb-fixes.compact {
    gap: 0;
    margin-top: .25rem;
    font-size: 12.5px;
}

.hb-fixes.compact a {
    padding: .05rem 0;
}

.hb-req {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hb-req-group {
    padding: .55rem 1.25rem .35rem;
    border-top: 1px solid var(--hb-border);
    background: var(--hb-surface-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hb-text-3);
}

.hb-req-row {
    padding: .8rem 1.25rem;
    border-top: 1px solid var(--hb-border);
}

.hb-req-head {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
}

.hb-req-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--hb-neutral-bg);
    color: var(--hb-neutral);
}

.hb-req-icon .mud-icon-root {
    font-size: 16px;
}

.hb-req-icon.success { background: var(--hb-success-bg); color: var(--hb-success); }
.hb-req-icon.warning { background: var(--hb-warning-bg); color: var(--hb-warning); }
.hb-req-icon.info { background: var(--hb-info-bg); color: var(--hb-info); }

.hb-req-icon.large {
    width: 40px;
    height: 40px;
}

.hb-req-icon.large .mud-icon-root {
    font-size: 22px;
}

.hb-req-text {
    flex: 1;
    min-width: 0;
}

.hb-req-text strong,
.hb-req-text a.hb-row-link {
    display: block;
    font-weight: 500;
    text-decoration: none;
}

.hb-req-text a.hb-row-link:hover {
    color: var(--hb-accent);
    text-decoration: underline;
}

.hb-req-text small {
    display: block;
    margin-top: .1rem;
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-req-status {
    display: inline-flex;
    flex: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .35rem;
}

.hb-req-indent,
.hb-req-sub {
    margin-left: calc(26px + .75rem);
}

.hb-req-sub {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: .7rem;
    padding: .7rem .85rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius-sm);
    background: var(--hb-surface-muted);
}

.hb-req-subitem + .hb-req-subitem {
    padding-top: .75rem;
    border-top: 1px solid var(--hb-border);
}

.hb-req-subitem > small {
    display: block;
    margin-top: .3rem;
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-req-subhead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .5rem;
}

.hb-req-subhead a.hb-row-link {
    margin-right: auto;
    font-weight: 500;
    text-decoration: none;
}

.hb-req-subhead a.hb-row-link:hover {
    color: var(--hb-accent);
    text-decoration: underline;
}

.hb-req-subitem > small.hb-req-finding {
    margin-top: .25rem;
    color: var(--hb-text-3);
}

.hb-req-label {
    margin-right: auto;
    font-weight: 500;
}

.hb-req-links a {
    color: var(--hb-accent);
}

.hb-req-count {
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-mapchips {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin: .5rem 0 0;
    padding: 0;
    list-style: none;
}

.hb-mapchips li {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    max-width: 100%;
    padding: .2rem .5rem;
    border-radius: var(--hb-radius-sm);
    background: var(--hb-success-bg);
    font-size: 12px;
    color: var(--hb-success);
}

.hb-mapchips li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hb-text);
}

.hb-mapchips li b {
    font-weight: 500;
    white-space: nowrap;
}

.hb-mapchips li.missing {
    background: var(--hb-warning-bg);
    color: var(--hb-warning);
}

.hb-mapchips .mud-icon-root {
    flex: none;
    font-size: 14px;
}

.hb-readiness-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .75rem 1rem;
    padding: 1rem 1.25rem;
}

.hb-readiness-top > .grow {
    flex: 1 1 18rem;
    min-width: 0;
}

.hb-readiness-caps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, auto));
    gap: .35rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
}

.hb-readiness-caps li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    color: var(--hb-text-2);
}

.hb-readiness-body {
    padding: .1rem 1.25rem 1rem calc(1.25rem + 40px + 1rem);
}

.hb-readiness-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hb-text-3);
}

@media (max-width: 640.98px) {
    .hb-readiness-body {
        padding-left: 1rem;
    }

    .hb-readiness-caps {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .hb-req-row,
    .hb-req-group {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hb-req-head {
        flex-wrap: wrap;
    }

    .hb-req-status {
        justify-content: flex-start;
        width: 100%;
        padding-left: calc(26px + .75rem);
    }

    .hb-req-indent,
    .hb-req-sub {
        margin-left: 0;
    }
}
/* Configuration forms */
.hb-option-code {
    margin-left: .4rem;
    font-family: var(--hb-mono);
    font-size: 11.5px;
    color: var(--hb-text-3);
}

.hb-note .hb-note-list {
    margin: .35rem 0 0;
    padding-left: 1.1rem;
}

.hb-note .hb-note-action {
    margin-left: .25rem;
    padding: 0 .35rem;
    min-width: 0;
    vertical-align: baseline;
}

.hb-delivery-differences ul {
    margin: .35rem 0 .6rem;
    padding-left: 1.1rem;
}

.hb-delivery-differences li {
    margin: .1rem 0;
    overflow-wrap: anywhere;
}

.hb-folder-input .mud-input-adornment-start .mud-text {
    font-family: var(--hb-mono);
    color: var(--hb-text-3);
}

.hb-dialog .mud-input-outlined:has(input[readonly]) {
    background: var(--hb-surface-muted);
}

/* Bed category availability completeness */
.hb-answered {
    flex: 1 1 20rem;
    min-width: 0;
}

.hb-answered-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem 1rem;
    margin-bottom: .4rem;
}

.hb-answered-count {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: 13.5px;
    color: var(--hb-text-2);
}

.hb-answered-count b {
    font-size: 15px;
    font-weight: 600;
    color: var(--hb-text);
    font-variant-numeric: tabular-nums;
}

.hb-answered-count .ok {
    font-size: 18px;
    color: var(--hb-success-dot);
}

.hb-answered-legend {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .2rem .9rem;
    font-size: 12.5px;
    color: var(--hb-text-2);
    font-variant-numeric: tabular-nums;
}

.hb-answered-legend > span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.hb-answered-legend .attention {
    font-weight: 600;
    color: var(--hb-warning);
}

.hb-answered-legend .zero {
    opacity: .55;
}

.hb-answered-legend i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.hb-answered .unanswered,
.hb-answered-legend i.unanswered {
    background: repeating-linear-gradient(135deg, var(--hb-warning-bg) 0 4px, var(--hb-warning-stripe) 4px 6px);
    box-shadow: inset 0 0 0 1px var(--hb-warning-dot);
}

.hb-answered-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem 1rem;
    margin-left: auto;
    font-size: 13px;
}

/* Bed availability: baseline or reporting-context view, on its own row above the progress summary. */
.hb-context-picker {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
}

.hb-table .mud-table-body .mud-table-row.hb-row-unanswered .mud-table-cell:first-child {
    box-shadow: inset 3px 0 0 var(--hb-warning-dot);
}

@media (max-width: 640px) {
    .hb-answered-actions {
        justify-content: flex-start;
        margin-left: 0;
    }
}

/* Section links scroll below the fixed application bar. */
.hb-panel[id],
.hb-section-label[id] {
    scroll-margin-top: 4.5rem;
}

/* Database resource pressure */
.hb-db-bar {
    display: block;
    flex: 1 1 auto;
    height: 6px;
    min-width: 2rem;
    overflow: hidden;
    border-radius: 3px;
    background: var(--hb-neutral-bg);
}

.hb-db-bar.lg {
    height: 8px;
    border-radius: 4px;
}

.hb-db-bar > i {
    display: block;
    min-width: 2px;
    height: 100%;
    border-radius: inherit;
}

/* Four gauges in a row on desktop, wrapping to two rows when the card is narrow (tablet and phone). */
.hb-db-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: .3rem .9rem;
    margin-top: .15rem;
}

.hb-db-mini-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
    font-size: 12px;
    color: var(--hb-text-2);
}

.hb-db-mini-item .name {
    flex: none;
    white-space: nowrap;
}

.hb-db-mini-item b {
    flex: none;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--hb-text);
}

.hb-db-resources {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.hb-db-resource {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-width: 0;
    padding: .8rem .9rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius-sm);
    background: var(--hb-surface-muted);
}

.hb-db-resource.warning {
    border-color: var(--hb-warning-dot);
    background: var(--hb-warning-bg);
}

.hb-db-resource.danger {
    border-color: var(--hb-danger-dot);
    background: var(--hb-danger-bg);
}

.hb-db-resource .head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .35rem;
}

.hb-db-resource .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--hb-text);
}

.hb-db-resource .value {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--hb-text);
}

.hb-db-resource .value small {
    margin-left: .25rem;
    font-size: 12px;
    font-weight: 500;
    color: var(--hb-text-3);
}

.hb-db-resource .desc {
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-db-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    margin-bottom: .3rem;
}

@media (max-width: 899.98px) {
    .hb-db-resources {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Facility delivery consistency */
.hb-consistency {
    border-top: 1px solid var(--hb-border);
}

.hb-consistency-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .35rem 1rem;
    padding: 1rem 1.25rem .6rem;
    border-top: 1px solid var(--hb-border);
}

.hb-consistency > .hb-consistency-head {
    border-top: 0;
}

.hb-consistency-head h3 {
    margin: 0 0 .15rem;
    font-size: 14px;
    font-weight: 600;
}

.hb-consistency-head span {
    font-size: 12.5px;
    color: var(--hb-text-3);
}

.hb-consistency-head .meta {
    white-space: nowrap;
}

.hb-consistency-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.25fr);
    gap: .6rem;
    padding: 0 1.25rem 1rem;
}

.hb-consistency-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
    min-width: 0;
    padding: .7rem .85rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius-sm);
    background: var(--hb-surface-muted);
}

.hb-consistency-stat strong {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.1;
}

.hb-consistency-stat small {
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-consistency-stat.zero strong {
    color: var(--hb-text-3);
}

.hb-consistency-stat.warning small,
.hb-consistency-stat.danger small {
    color: var(--hb-text-2);
}

.hb-consistency-stat.warning {
    border-color: var(--hb-warning-dot);
    background: var(--hb-warning-bg);
}

.hb-consistency-stat.danger {
    border-color: var(--hb-danger-dot);
    background: var(--hb-danger-bg);
}

.hb-consistency-stat.overdue {
    border-style: dashed;
}

.hb-consistency-stat.overdue .label,
.hb-overdue {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--hb-warning);
}

.hb-consistency-stat.overdue.zero .label {
    color: var(--hb-text-2);
}

.hb-consistency-stat.overdue .mud-icon-root,
.hb-overdue .mud-icon-root {
    font-size: 16px;
}

.hb-overdue {
    margin-top: .3rem;
}

.hb-delivery-window {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 9rem;
    max-width: 16rem;
}

.hb-delivery-window .line {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.hb-delivery-window small {
    font-size: 12px;
    color: var(--hb-text-3);
}

.hb-delivery-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hb-consistency-note {
    margin: 0;
    padding: .75rem 1.25rem 1rem;
    font-size: 12px;
    color: var(--hb-text-3);
}

@media (max-width: 1199.98px) {
    .hb-consistency-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hb-consistency-stat.overdue {
        grid-column: span 2;
    }
}

@media (max-width: 640.98px) {
    .hb-consistency-summary {
        gap: .5rem;
    }

    .hb-consistency-stat {
        padding: .55rem .7rem;
    }

    .hb-delivery-cell {
        align-items: flex-end;
    }

    .hb-delivery-window {
        align-items: flex-end;
        max-width: none;
    }
}

/* Mapping rules and configuration issues */
.hb-classification {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem 1rem;
    margin: 0;
    min-width: 13.5rem;
}

.hb-classification > div {
    min-width: 0;
}

.hb-classification dt {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--hb-text-3);
}

.hb-classification dd {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--hb-text);
    overflow-wrap: break-word;
}

.hb-classification dd.hb-placeholder {
    font-size: 12px;
    font-style: italic;
    color: var(--hb-text-3);
}

.hb-source-note {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .35rem;
    font-size: 12px;
    color: var(--hb-warning);
}

.hb-source-note .mud-icon-root {
    font-size: 15px;
}

.hb-table .hb-subtle {
    white-space: nowrap;
}

.hb-priority {
    display: inline-grid;
    place-items: center;
    min-width: 2.25rem;
    height: 22px;
    padding: 0 .45rem;
    border-radius: var(--hb-radius-sm);
    background: var(--hb-neutral-bg);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--hb-text);
}

.hb-cell-secondary .hb-tag {
    height: 18px;
    margin-left: .35rem;
    padding: 0 .35rem;
    font-size: 10.5px;
}

.hb-tag.supplemental {
    border-color: transparent;
    background: var(--hb-info-bg);
    color: var(--hb-info);
}

.hb-cell-secondary .hb-warning-text {
    margin-left: .35rem;
}

/* Section headings and hints inside dialog forms leave room for the outlined fields' floating labels. */
.hb-form .hb-form-section {
    margin: .25rem 0 0;
}

.hb-form-hint {
    margin: -.6rem 0 .15rem;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--hb-text-3);
}

.hb-issue {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    min-width: 12rem;
    max-width: 24rem;
}

.hb-issue-beds {
    white-space: nowrap;
    color: var(--hb-text-2);
}

.hb-issue-beds b {
    font-size: 15px;
    font-weight: 600;
    color: var(--hb-text);
}

.hb-issue-times {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    white-space: nowrap;
    font-size: 12.5px;
}

.hb-issue-times small {
    display: inline-block;
    width: 3.75rem;
    color: var(--hb-text-3);
}

.hb-issue .hb-fix-link {
    margin-top: .3rem;
}

.hb-fix-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--hb-accent) !important;
    text-decoration: none;
}

.hb-fix-link:hover {
    text-decoration: underline;
}

.hb-fix-link .mud-icon-root {
    font-size: 16px;
}

.hb-issues-summary {
    font-size: 12.5px;
    color: var(--hb-text-2);
}

.hb-issue-callout {
    align-items: center;
}

.hb-issue-callout > span {
    flex: 1;
}

.hb-issue-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    height: 22px;
    padding: 0 .5rem;
    border-radius: 999px;
    background: var(--hb-warning-bg);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--hb-warning) !important;
    text-decoration: none;
}

.hb-table .hb-issue-badge {
    display: flex;
    width: fit-content;
}

.hb-issue-badge:hover {
    text-decoration: underline;
}

.hb-issue-badge .mud-icon-root {
    font-size: 15px;
}

.hb-mapchips li.missing a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hb-text);
    text-decoration: underline;
    text-decoration-color: var(--hb-warning-dot);
    text-underline-offset: 2px;
}

@media (max-width: 640.98px) {
    .hb-classification {
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
    }

    .hb-issue,
    .hb-issue-times {
        max-width: none;
        white-space: normal;
    }
}
/* ---------- Delivery timeline ---------- */

.hb-dt-kpis {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.hb-dt-kpis .hb-delivery-window {
    margin-top: .35rem;
    max-width: none;
}

.hb-dt-kpi-value {
    margin-top: .35rem;
    font-size: 15px;
    font-weight: 600;
}

.hb-dt {
    padding: .9rem 1rem 1rem;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    background: var(--hb-surface);
}

.hb-dt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem 1rem;
    margin-bottom: .85rem;
}

/* Reversed so a timeline wider than a phone opens scrolled to the latest opportunity. */
.hb-dt-scroll {
    display: flex;
    flex-direction: row-reverse;
    overflow-x: auto;
    padding: 3px 3px 2px;
}

.hb-dt-track {
    position: relative;
    flex: 1 0 0;
    min-width: 0;
    height: 66px;
    margin-right: 3px;
    background: repeating-linear-gradient(135deg, transparent 0 4px, var(--hb-neutral-bg) 4px 8px) top / 100% 30px no-repeat;
}

.hb-dt-strip {
    position: absolute;
    inset: 0 0 auto;
    height: 30px;
}

.hb-dt-cell {
    position: absolute;
    top: 0;
    bottom: 0;
    min-width: 3px;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--hb-surface);
    border-radius: 2px;
    cursor: pointer;
}

.hb-dt-cell.pending {
    background: repeating-linear-gradient(135deg, var(--hb-neutral-dot) 0 2px, transparent 2px 5px);
    box-shadow: inset 0 0 0 1px var(--hb-neutral-dot);
}

.hb-dt-cell:hover {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .28);
}

.hb-dt-cell:focus-visible {
    z-index: 2;
    outline: 2px solid var(--hb-focus);
    outline-offset: 1px;
}

.hb-dt-cell.selected {
    z-index: 1;
    box-shadow: 0 0 0 2px var(--hb-surface), 0 0 0 4px var(--hb-text);
}

.hb-dt-rug {
    position: absolute;
    top: 34px;
    left: 0;
    right: 0;
    height: 8px;
}

.hb-dt-rug i {
    position: absolute;
    top: 0;
    width: 1px;
    height: 8px;
    background: var(--hb-text-2);
}

.hb-dt-gap {
    position: absolute;
    top: 43px;
    height: 6px;
    border: 2px solid var(--hb-warning-dot);
    border-top: 0;
    border-radius: 0 0 3px 3px;
}

.hb-dt-axis {
    position: absolute;
    top: 51px;
    left: 0;
    right: 0;
    height: 14px;
    font-size: 11px;
    line-height: 14px;
    color: var(--hb-text-3);
    font-variant-numeric: tabular-nums;
}

.hb-dt-axis span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

.hb-legend i.hb-dt-pending-swatch {
    background: repeating-linear-gradient(135deg, var(--hb-neutral-dot) 0 2px, transparent 2px 4px);
    box-shadow: inset 0 0 0 1px var(--hb-neutral-dot);
}

.hb-legend i.hb-dt-receipt-swatch {
    width: 2px;
    background: var(--hb-text-2);
}

.hb-legend i.hb-dt-gap-swatch {
    height: 5px;
    border: 2px solid var(--hb-warning-dot);
    border-top: 0;
    border-radius: 0 0 2px 2px;
}

.hb-dt-summary {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-top: .75rem;
    font-size: 13px;
    color: var(--hb-text-2);
}

.hb-dt-runs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    font-size: 12px;
}

.hb-dt-run {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    padding: .25rem .55rem;
    border: 1px solid var(--hb-danger-dot);
    border-radius: 999px;
    background: var(--hb-danger-bg);
    color: var(--hb-text);
    font: inherit;
    cursor: pointer;
}

.hb-dt-run b {
    color: var(--hb-danger);
}

.hb-dt-run small {
    color: var(--hb-text-2);
}

.hb-dt-run:hover {
    border-color: var(--hb-danger);
}

.hb-dt-run:focus-visible {
    outline: 2px solid var(--hb-focus);
    outline-offset: 1px;
}

.hb-dt-detail {
    margin-top: 1rem;
}

.hb-dt-detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin-bottom: .85rem;
}

.hb-dt-detail-head strong {
    font-size: 15px;
    font-weight: 600;
}

.hb-dt-spacer {
    flex: 1;
}

.hb-dt-hint {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: 13px;
    color: var(--hb-text-3);
}

.hb-dt-hint .mud-icon-root {
    font-size: 18px;
}

@media (max-width: 640.98px) {
    .hb-dt {
        padding: .75rem;
    }

    .hb-dt-track.wide {
        min-width: 620px;
    }

    .hb-dt-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
    }

    .hb-dt-kpis .hb-kpi {
        padding: .7rem .75rem;
    }

    .hb-dt-kpis .hb-delivery-window {
        align-items: stretch;
        min-width: 0;
    }

    .hb-dt-head .hb-legend {
        gap: .3rem .75rem;
    }
}
/* ---------- Facility freshness matrix filter ---------- */

.hb-fresh-matrix td.selectable {
    padding: 0;
}

.hb-fresh-cell {
    display: block;
    width: 100%;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.hb-fresh-cell:hover {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .22);
}

:root[data-theme="dark"] .hb-fresh-cell:hover {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4);
}

.hb-fresh-cell:focus-visible {
    outline: 2px solid var(--hb-focus);
    outline-offset: 2px;
}

.hb-fresh-matrix td.selected {
    box-shadow: 0 0 0 2px var(--hb-surface), 0 0 0 4px var(--hb-text);
}

.hb-fresh-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .6rem;
    margin: 0 1.25rem .75rem;
    padding: .4rem .5rem .4rem .75rem;
    border: 1px solid var(--hb-info-dot);
    border-radius: var(--hb-radius-sm);
    background: var(--hb-info-bg);
    font-size: 13px;
    color: var(--hb-text);
}

.hb-fresh-filter:focus {
    outline: none;
}

.hb-fresh-filter:focus-visible {
    outline: 2px solid var(--hb-focus);
    outline-offset: 2px;
}

.hb-fresh-filter > span {
    flex: 1;
    min-width: 12rem;
}

.hb-fresh-filter .mud-icon-root {
    color: var(--hb-info);
}