.hhd-aw-governance-page {
    display: grid;
    gap: var(--hhd-space-5, 1.25rem);
}

.hhd-aw-governance-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--hhd-space-4, 1rem);
}

.hhd-aw-governance-tree-wrap {
    min-width: 0;
    overflow: hidden;
}

.hhd-aw-governance-tree .e-treegrid {
    border: 0;
}

.hhd-aw-state-pill,
.hhd-aw-health-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: .2rem .6rem;
    border: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.25));
    border-radius: 999px;
    background: var(--hhd-surface-subtle, rgba(127,127,127,.08));
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
}

.hhd-aw-health-pill.is-normal { color: var(--hhd-status-success-foreground, #176b3a); background: var(--hhd-status-success-surface, rgba(46,160,89,.1)); }
.hhd-aw-health-pill.is-attention { color: var(--hhd-status-warning-foreground, #8a5700); background: var(--hhd-status-warning-surface, rgba(235,170,35,.12)); }
.hhd-aw-health-pill.is-blocked { color: var(--hhd-status-error-foreground, #a52b2b); background: var(--hhd-status-error-surface, rgba(212,61,61,.11)); }
.hhd-aw-health-pill.is-degraded { color: var(--hhd-status-warning-foreground, #8a5700); background: var(--hhd-status-warning-surface, rgba(235,170,35,.12)); }
.hhd-aw-health-pill.is-not-materialized { color: var(--hhd-status-info-foreground, #245b8f); background: var(--hhd-status-info-surface, rgba(44,116,184,.11)); }

.hhd-aw-version {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hhd-text-muted, #667085);
    font-family: var(--hhd-font-mono, ui-monospace, SFMono-Regular, Consolas, monospace);
    font-size: .76rem;
}

.hhd-aw-governance-detail {
    display: grid;
    gap: 1rem;
}

.hhd-aw-detail-status {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.hhd-aw-detail-section {
    padding: 1rem .15rem;
}

.hhd-aw-detail-lead {
    margin: 0 0 1rem;
    color: var(--hhd-text-secondary, #475467);
    line-height: 1.55;
}

.hhd-aw-property-grid,
.hhd-aw-technical-grid,
.hhd-aw-diagnostic dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin: 0;
}

.hhd-aw-property-grid > div,
.hhd-aw-technical-grid > div,
.hhd-aw-diagnostic dl > div {
    min-width: 0;
    padding: .75rem;
    border: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.18));
    border-radius: var(--hhd-radius-md, .75rem);
    background: var(--hhd-surface-subtle, rgba(127,127,127,.04));
}

.hhd-aw-property-grid dt,
.hhd-aw-technical-grid dt,
.hhd-aw-diagnostic dt {
    margin-bottom: .25rem;
    color: var(--hhd-text-muted, #667085);
    font-size: .76rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.hhd-aw-property-grid dd,
.hhd-aw-technical-grid dd,
.hhd-aw-diagnostic dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.hhd-aw-technical-grid code,
.hhd-aw-diagnostic-technical code {
    font-family: var(--hhd-font-mono, ui-monospace, SFMono-Regular, Consolas, monospace);
    font-size: .78rem;
}

.hhd-aw-diagnostic-list {
    display: grid;
    gap: .8rem;
    padding: 1rem .15rem;
}

.hhd-aw-diagnostic {
    padding: 1rem;
    border: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.2));
    border-radius: var(--hhd-radius-lg, 1rem);
    background: var(--hhd-surface-card, var(--hhd-surface, #fff));
}

.hhd-aw-diagnostic header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .65rem;
    margin-bottom: .8rem;
}

.hhd-aw-diagnostic-technical {
    margin-top: .8rem;
    border-top: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.18));
    padding-top: .7rem;
}

.hhd-aw-diagnostic-technical summary {
    cursor: pointer;
    color: var(--hhd-text-secondary, #475467);
    font-weight: 650;
}

.hhd-aw-diagnostic-empty {
    display: flex;
    gap: .8rem;
    align-items: flex-start;
    margin: 1rem .15rem;
    padding: 1rem;
    border-radius: var(--hhd-radius-lg, 1rem);
    background: var(--hhd-status-success-surface, rgba(46,160,89,.08));
}

.hhd-aw-diagnostic-empty p { margin: .25rem 0 0; color: var(--hhd-text-secondary, #475467); }

.hhd-aw-dependency-list {
    display: grid;
    gap: .6rem;
    list-style: none;
    margin: 0;
    padding: 1rem .15rem;
}

.hhd-aw-dependency-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem;
    border: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.18));
    border-radius: var(--hhd-radius-md, .75rem);
}

.hhd-aw-dependency-list span { color: var(--hhd-text-muted, #667085); font-size: .78rem; }

.hhd-aw-detail-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: .25rem;
}

.hhd-aw-advanced-host {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.18));
}

.hhd-aw-advanced-host > header { margin-bottom: 1rem; }
.hhd-aw-advanced-host > header > span { color: var(--hhd-text-muted, #667085); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hhd-aw-advanced-host > header h3 { margin: .2rem 0; }
.hhd-aw-advanced-host > header p { margin: 0; color: var(--hhd-text-secondary, #475467); }

@media (max-width: 1024px) {
    .hhd-aw-governance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .hhd-aw-governance-summary { grid-template-columns: 1fr; }
    .hhd-aw-property-grid,
    .hhd-aw-technical-grid,
    .hhd-aw-diagnostic dl { grid-template-columns: 1fr; }
    .hhd-aw-governance-tree-wrap { overflow-x: auto; }
}

/* R01-I02-FIX02 — scalable governance workspace */
.hhd-aw-workspace-card {
    overflow: hidden;
}

.hhd-aw-workspace-tabs {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.18));
    background: var(--hhd-surface-subtle, rgba(127,127,127,.04));
}

.hhd-aw-workspace-tabs button {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 38px;
    padding: .45rem .8rem;
    border: 1px solid transparent;
    border-radius: var(--hhd-radius-pill, 999px);
    color: var(--hhd-text-secondary, #475467);
    background: transparent;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.hhd-aw-workspace-tabs button:hover,
.hhd-aw-workspace-tabs button:focus-visible {
    color: var(--hhd-text-primary, #101828);
    background: var(--hhd-surface-panel, #fff);
    border-color: var(--hhd-border-subtle, rgba(127,127,127,.18));
}

.hhd-aw-workspace-tabs button.is-active {
    color: var(--hhd-accent, #2563eb);
    background: var(--hhd-accent-soft, rgba(37,99,235,.08));
    border-color: color-mix(in srgb, var(--hhd-accent, #2563eb) 28%, transparent);
}

.hhd-aw-workspace-tabs button > span {
    min-width: 1.55rem;
    height: 1.55rem;
    display: inline-grid;
    place-items: center;
    padding-inline: .35rem;
    border-radius: 999px;
    background: var(--hhd-surface-elevated, #fff);
    font-size: .72rem;
}

.hhd-aw-governance-workspace {
    height: clamp(460px, 58vh, 650px);
    min-height: 0;
    overflow: hidden;
}

.hhd-aw-explorer-shell,
.hhd-aw-attention-shell {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.hhd-aw-workspace-filters {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(240px, 1.7fr) minmax(150px, .8fr) minmax(170px, .9fr) auto auto;
    align-items: end;
    gap: .65rem;
    padding: .8rem .9rem;
    border-bottom: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.18));
    background: var(--hhd-surface-panel, #fff);
}

.hhd-aw-attention-filters {
    grid-template-columns: minmax(240px, 1fr) minmax(170px, .45fr) minmax(180px, .5fr) auto;
}

.hhd-aw-filter-field {
    min-width: 0;
    display: grid;
    gap: .28rem;
}

.hhd-aw-filter-field > span,
.hhd-aw-filter-check > span {
    color: var(--hhd-text-secondary, #475467);
    font-size: .73rem;
    font-weight: 650;
}

.hhd-aw-filter-field input,
.hhd-aw-filter-field select {
    width: 100%;
    min-height: 38px;
    padding: .42rem .62rem;
    color: var(--hhd-text-primary, #101828);
    background: var(--hhd-surface-elevated, #fff);
    border: 1px solid var(--hhd-border, rgba(127,127,127,.28));
    border-radius: var(--hhd-radius-sm, .55rem);
    font: inherit;
    font-size: .83rem;
}

.hhd-aw-filter-check {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .55rem;
    white-space: nowrap;
}

.hhd-aw-filter-check input {
    width: 1rem;
    height: 1rem;
}

.hhd-aw-result-count {
    align-self: center;
    justify-self: end;
    color: var(--hhd-text-muted, #667085);
    font-size: .75rem;
    white-space: nowrap;
}

.hhd-aw-governance-tree-wrap,
.hhd-aw-attention-grid-wrap {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.hhd-aw-governance-tree-wrap > .e-treegrid,
.hhd-aw-governance-tree-wrap > .e-grid,
.hhd-aw-attention-grid-wrap > .e-grid {
    height: 100% !important;
}

.hhd-aw-attention-diagnostic-cell {
    min-width: 0;
    display: grid;
    gap: .16rem;
}

.hhd-aw-attention-diagnostic-cell strong,
.hhd-aw-attention-diagnostic-cell span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hhd-aw-attention-diagnostic-cell span {
    color: var(--hhd-text-muted, #667085);
    font-size: .76rem;
}

.hhd-aw-attention-open {
    color: var(--hhd-accent, #2563eb);
    font-size: 1rem;
    font-weight: 700;
}

.hhd-aw-summary-action-card {
    min-width: 0;
    display: block;
    width: 100%;
    padding: 1.15rem;
    text-align: left;
    color: inherit;
    border: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.18));
    border-radius: var(--hhd-radius-md, .75rem);
    background: var(--hhd-surface-panel, #fff);
    box-shadow: var(--hhd-shadow-xs, 0 1px 2px rgba(16,24,40,.06));
    font: inherit;
    cursor: pointer;
}

.hhd-aw-summary-action-card:hover,
.hhd-aw-summary-action-card:focus-visible {
    border-color: color-mix(in srgb, var(--hhd-accent, #2563eb) 38%, var(--hhd-border-subtle, rgba(127,127,127,.18)));
    box-shadow: var(--hhd-shadow-sm, 0 2px 6px rgba(16,24,40,.1));
}

.hhd-aw-summary-action-header {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.hhd-aw-summary-action-card > strong {
    display: block;
    margin-top: .85rem;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    line-height: 1.1;
}

.hhd-aw-summary-action-card > p {
    margin: .45rem 0 0;
    color: var(--hhd-text-tertiary, #667085);
    font-size: var(--hhd-font-size-xs, .78rem);
    line-height: 1.45;
}

.hhd-aw-summary-action-link {
    display: inline-block;
    margin-top: .55rem;
    color: var(--hhd-accent, #2563eb);
    font-size: .76rem;
    font-weight: 700;
}

.hhd-aw-detail-diagnostic-count {
    align-self: center;
    color: var(--hhd-text-muted, #667085);
    font-size: .76rem;
    font-weight: 650;
}

.hhd-aw-component-summary {
    display: grid;
    gap: .7rem;
    margin-bottom: 1rem;
    padding: .85rem;
    border: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.18));
    border-radius: var(--hhd-radius-md, .75rem);
    background: var(--hhd-surface-subtle, rgba(127,127,127,.04));
}

.hhd-aw-component-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.hhd-aw-component-summary-header > span {
    color: var(--hhd-text-muted, #667085);
    font-size: .76rem;
}

.hhd-aw-component-list {
    max-height: 260px;
    display: grid;
    align-content: start;
    gap: .4rem;
    margin: 0;
    padding: 0 .15rem 0 0;
    overflow: auto;
    list-style: none;
}

.hhd-aw-component-list li {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: .45rem;
    padding: .48rem .55rem;
    border-radius: var(--hhd-radius-sm, .55rem);
    background: var(--hhd-surface-panel, #fff);
}

.hhd-aw-component-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 650;
}

.hhd-aw-component-diagnostics {
    min-width: 1.5rem;
    height: 1.5rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--hhd-status-warning-foreground, #8a5700);
    background: var(--hhd-status-warning-surface, rgba(235,170,35,.12));
    font-size: .7rem;
    font-weight: 700;
}

.hhd-aw-diagnostic-browser {
    height: min(520px, 58vh);
    min-height: 320px;
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
    gap: .8rem;
    padding: .85rem .15rem .15rem;
    overflow: hidden;
}

.hhd-aw-diagnostic-compact-list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: .35rem;
    overflow: auto;
    padding-right: .15rem;
}

.hhd-aw-diagnostic-row {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .55rem;
    text-align: left;
    color: inherit;
    border: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.18));
    border-radius: var(--hhd-radius-sm, .55rem);
    background: var(--hhd-surface-panel, #fff);
    font: inherit;
    cursor: pointer;
}

.hhd-aw-diagnostic-row:hover,
.hhd-aw-diagnostic-row:focus-visible,
.hhd-aw-diagnostic-row.is-selected {
    border-color: color-mix(in srgb, var(--hhd-accent, #2563eb) 36%, var(--hhd-border-subtle, rgba(127,127,127,.18)));
    background: var(--hhd-accent-soft, rgba(37,99,235,.06));
}

.hhd-aw-diagnostic-row-copy {
    min-width: 0;
    display: grid;
    gap: .12rem;
}

.hhd-aw-diagnostic-row-copy strong,
.hhd-aw-diagnostic-row-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hhd-aw-diagnostic-row-copy small {
    color: var(--hhd-text-muted, #667085);
}

.hhd-aw-diagnostic-detail {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: .85rem;
    border: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.2));
    border-radius: var(--hhd-radius-md, .75rem);
    background: var(--hhd-surface-card, var(--hhd-surface, #fff));
}

.hhd-aw-diagnostic-detail > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .8rem;
}

.hhd-aw-diagnostic-detail > header > div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
}

.hhd-aw-diagnostic-affected {
    color: var(--hhd-text-muted, #667085);
    font-size: .75rem;
    font-weight: 650;
}

.hhd-aw-diagnostic-detail > dl,
.hhd-aw-diagnostic-detail .hhd-aw-diagnostic-technical dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    margin: 0;
}

.hhd-aw-diagnostic-detail > dl > div,
.hhd-aw-diagnostic-detail .hhd-aw-diagnostic-technical dl > div {
    min-width: 0;
    padding: .68rem;
    border: 1px solid var(--hhd-border-subtle, rgba(127,127,127,.18));
    border-radius: var(--hhd-radius-sm, .55rem);
    background: var(--hhd-surface-subtle, rgba(127,127,127,.04));
}

.hhd-aw-diagnostic-detail dt {
    margin-bottom: .2rem;
    color: var(--hhd-text-muted, #667085);
    font-size: .7rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.hhd-aw-diagnostic-detail dd {
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
    .hhd-aw-workspace-filters {
        grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(150px, .55fr));
    }
    .hhd-aw-filter-check,
    .hhd-aw-result-count { grid-column: auto; }
}

@media (max-width: 768px) {
    .hhd-aw-governance-workspace { height: 68vh; min-height: 460px; }
    .hhd-aw-workspace-filters,
    .hhd-aw-attention-filters {
        grid-template-columns: 1fr 1fr;
    }
    .hhd-aw-filter-field.is-search { grid-column: 1 / -1; }
    .hhd-aw-result-count { justify-self: start; }
    .hhd-aw-diagnostic-browser {
        height: auto;
        min-height: 0;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(150px, 34vh) minmax(260px, 1fr);
    }
    .hhd-aw-component-list li { grid-template-columns: minmax(0, 1fr) auto; }
    .hhd-aw-component-list .hhd-aw-state-pill { display: none; }
    .hhd-aw-diagnostic-detail > dl,
    .hhd-aw-diagnostic-detail .hhd-aw-diagnostic-technical dl { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .hhd-aw-workspace-tabs { overflow-x: auto; }
    .hhd-aw-workspace-filters,
    .hhd-aw-attention-filters { grid-template-columns: 1fr; }
    .hhd-aw-filter-field.is-search { grid-column: auto; }
    .hhd-aw-filter-check { padding-inline: 0; }
    .hhd-aw-governance-summary { grid-template-columns: 1fr; }
}

/* FIX03 single hierarchy, contextual ancestors and bounded activity */
.hhd-aw-site-centric-note{display:flex;align-items:flex-start;gap:.55rem;margin:.25rem 0 .75rem;padding:.65rem .8rem;border:1px solid var(--hhd-border-subtle);border-radius:var(--hhd-radius-md);background:var(--hhd-surface-subtle);color:var(--hhd-text-secondary);font-size:.86rem}
.hhd-aw-node-name.is-context-ancestor{opacity:.68;font-style:italic}
.hhd-aw-context-ancestor-badge{display:inline-flex;margin-inline-start:.45rem;padding:.1rem .4rem;border:1px solid var(--hhd-border-subtle);border-radius:999px;font-size:.7rem;color:var(--hhd-text-tertiary);vertical-align:middle}
.hhd-aw-activity-grid-wrap{min-height:0;max-height:28rem;overflow:hidden;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:.65rem}
.hhd-aw-activity-more{display:flex;justify-content:flex-end}
.hhd-aw-governance-tree-wrap{min-height:22rem;max-height:min(64dvh,720px);overflow:hidden}
.hhd-aw-explorer-shell{min-height:0}


/* FIX03-FIX02 observable TreeGrid behaviour */
.hhd-aw-branch-feedback{display:flex;align-items:center;gap:.55rem;margin:0 0 .7rem;padding:.58rem .72rem;border:1px solid var(--hhd-border-subtle);border-radius:var(--hhd-radius-md);background:var(--hhd-surface-subtle);color:var(--hhd-text-secondary);font-size:.82rem}
.hhd-aw-branch-feedback.is-error{border-color:color-mix(in srgb,var(--hhd-danger) 45%,var(--hhd-border-subtle));color:var(--hhd-danger)}
.hhd-aw-branch-retry,.hhd-aw-tree-detail-button{appearance:none;border:1px solid var(--hhd-border-subtle);border-radius:999px;background:var(--hhd-surface-panel);color:var(--hhd-text-primary);font:inherit;font-size:.75rem;font-weight:var(--hhd-weight-semibold);padding:.28rem .58rem;cursor:pointer}
.hhd-aw-branch-retry:hover,.hhd-aw-branch-retry:focus-visible,.hhd-aw-tree-detail-button:hover,.hhd-aw-tree-detail-button:focus-visible{border-color:var(--hhd-border-strong);background:var(--hhd-surface-selected);outline:2px solid transparent}
.hhd-aw-governance-tree .e-toolbar{border-radius:var(--hhd-radius-md) var(--hhd-radius-md) 0 0}
.hhd-aw-governance-tree .e-filtermenudiv{opacity:.82}
@media (max-width:640px){.hhd-aw-tree-detail-button{padding:.25rem .48rem}.hhd-aw-branch-feedback{align-items:flex-start;flex-wrap:wrap}}

/* FIX03-FIX03 actionable rows */
.hhd-aw-row-actions.e-dropdown-btn,
.hhd-aw-row-actions.e-btn {
    min-height:32px;
    min-width:96px;
    padding:.3rem .62rem;
    border:1px solid var(--hhd-border-subtle);
    border-radius:999px;
    background:var(--hhd-surface-panel);
    color:var(--hhd-text-primary);
    font-size:var(--hhd-font-size-xs);
    font-weight:var(--hhd-weight-semibold);
}
.hhd-aw-row-actions.e-dropdown-btn:hover,
.hhd-aw-row-actions.e-dropdown-btn:focus-visible,
.hhd-aw-row-actions.e-btn:hover,
.hhd-aw-row-actions.e-btn:focus-visible {
    border-color:var(--hhd-border-strong);
    background:var(--hhd-surface-selected);
}

