/* Product chrome. Semantic tokens live in aiden-tokens.css (--aiden-* / --int-* aliases). */
html { scrollbar-gutter: stable; }
html, body {
    margin: 0;
    height: 100%;
    height: 100dvh;
    background: var(--int-canvas);
    color: var(--int-ink);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    overflow-x: clip;
}
body {
    font-family: var(--aiden-font-body);
}

.page-shell {
    max-width: var(--aiden-layout-content-max-width, 1440px);
    margin: 0 auto;
    min-width: 0;
}
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--aiden-space-4, 1rem);
    margin: 0 0 var(--aiden-space-section-gap, 2rem);
}
.page-heading h1,
.page-heading .mud-typography-h4,
.page-heading .mud-typography-h5 {
    margin: 0;
    color: var(--int-ink-strong);
    font-family: var(--aiden-font-display) !important;
    letter-spacing: 0;
    line-height: 1.15 !important;
}
.page-heading p,
.page-heading .mud-typography-subtitle2 {
    margin: 0.3rem 0 0;
    color: var(--int-muted) !important;
}
.page-kicker {
    margin: 0 0 0.25rem !important;
    color: var(--aiden-royal, var(--int-primary)) !important;
    font-family: var(--aiden-font-body) !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase;
}
.surface,
.mud-paper.surface {
    min-width: 0;
    border: 1px solid var(--int-line) !important;
    border-radius: var(--int-surface-radius) !important;
    background: var(--int-surface) !important;
    box-shadow: var(--int-surface-shadow) !important;
}
.kpi-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.kpi-card:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--int-primary) 28%, var(--int-line)) !important;
    box-shadow: 0 14px 28px rgba(27, 43, 74, 0.08) !important;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 0.65rem;
}

.dashboard-kpi-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.35rem;
    min-height: 4.75rem;
    padding: 0.65rem 0.75rem !important;
}

.dashboard-kpi-label {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: var(--int-muted, #66748c) !important;
    min-height: 2.1em;
}

.dashboard-kpi-value {
    font-size: 1.15rem !important;
    font-weight: 760 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em;
}

.dashboard-stack-primary {
    font-size: 0.85rem;
    font-weight: 650;
    line-height: 1.25;
    word-break: break-word;
}

.dashboard-stack-secondary {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.3;
    word-break: break-word;
}

.dashboard-status-clickable {
    cursor: pointer;
}

.dashboard-subtasks-table {
    border: 1px solid var(--int-line);
    border-radius: var(--int-surface-radius);
    overflow: hidden;
    background: var(--int-surface);
    box-shadow: none;
}

.dashboard-subtasks-table .mud-table-root {
    table-layout: fixed;
    width: 100%;
}

.status-soft-success.mud-chip {
    color: var(--int-success-fg) !important;
    background: var(--int-success-bg) !important;
    border: 1px solid var(--int-success-bd) !important;
}
.status-soft-error.mud-chip {
    color: var(--int-error-fg) !important;
    background: var(--int-error-bg) !important;
    border: 1px solid var(--int-error-bd) !important;
}
.status-soft-info.mud-chip {
    color: var(--int-info-fg) !important;
    background: var(--int-info-bg) !important;
    border: 1px solid var(--int-info-bd) !important;
}
.status-soft-warning.mud-chip {
    color: var(--int-warning-fg) !important;
    background: var(--int-warning-bg) !important;
    border: 1px solid var(--int-warning-bd) !important;
}
.status-soft-default.mud-chip {
    color: var(--int-muted) !important;
    background: color-mix(in srgb, var(--int-canvas) 70%, var(--int-surface)) !important;
    border: 1px solid var(--int-line) !important;
}
.status-soft-dark.mud-chip {
    color: var(--int-ink) !important;
    background: color-mix(in srgb, var(--int-primary) 10%, var(--int-surface)) !important;
    border: 1px solid var(--int-line-strong) !important;
}

/* Expression builder dictionary: avoid limelight-on-white; use light-blue text. */
.expression-dict-chip.mud-chip {
    color: var(--int-ink) !important;
    background: var(--int-surface) !important;
    border: 1px solid var(--int-line) !important;
}
.expression-dict-chip.mud-chip:hover {
    border-color: color-mix(in srgb, var(--code-accent, #9eb6d4) 55%, var(--int-line)) !important;
    background: color-mix(in srgb, var(--code-accent, #9eb6d4) 10%, var(--int-surface)) !important;
}
.expression-dict-chip__label {
    color: var(--int-ink-strong) !important;
}
.expression-dict-chip__template,
.expression-dict-chip__template code {
    font-size: 11px;
    line-height: 1.35;
    color: var(--code-accent, #9eb6d4) !important;
    opacity: 1 !important;
}

.mud-appbar.integrator-appbar {
    height: var(--integrator-topbar-height) !important;
    min-height: var(--integrator-topbar-height) !important;
    background: var(--int-appbar-bg) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--int-line);
    color: var(--mud-palette-appbar-text) !important;
box-shadow: none !important;
    /* Use theme AppBar band (1300) so Mud dialogs (1400) paint above chrome. */
    z-index: var(--mud-zindex-appbar, 1300) !important;
    overflow: visible !important;
}
.mud-appbar.integrator-appbar .mud-toolbar,
.mud-appbar.integrator-appbar .mud-toolbar-appbar,
.mud-appbar.integrator-appbar .mud-toolbar-gutters {
    overflow: visible !important;
}

/* Full-height sidebar from the top of the viewport (covers AppBar on the left). */
.mud-drawer.integrator-drawer {
    top: 0 !important;
    height: 100% !important;
    max-height: 100vh !important;
    z-index: 1305 !important;
}

/* Desktop: AppBar only spans the content area next to the open sidebar. */
@media (min-width: 960px) {
    .integrator-shell--drawer-open .mud-appbar.integrator-appbar {
        left: 272px !important;
        width: calc(100% - 272px) !important;
        right: auto !important;
    }
}
.mud-appbar.integrator-appbar .mud-icon-button {
    color: var(--mud-palette-appbar-text) !important;
}
.appbar-right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    white-space: nowrap;
    overflow: visible;
    position: relative;
    z-index: 1;
}
.login-display--drawer {
    width: 100%;
    margin-bottom: 0.35rem;
}
.login-display--drawer .login-display-nav {
    width: 100%;
}
.login-display--drawer .mud-nav-link {
    color: rgba(217, 230, 246, 0.92) !important;
    min-height: 2.15rem;
    padding-inline: 0.85rem !important;
}
.login-display--drawer .mud-nav-link.mud-disabled {
    opacity: 1 !important;
    color: rgba(217, 230, 246, 0.82) !important;
}
.login-display--drawer .mud-nav-link .mud-nav-link-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.login-display--drawer .mud-nav-link .mud-icon-root {
    color: rgba(217, 230, 246, 0.88) !important;
}
.appbar-menu {
    position: relative;
    z-index: 1;
}
/* Below AppBar (1300) so menu items stay clickable; still above page content. */
.appbar-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1290;
    background: transparent;
}
.appbar-menu-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 2;
    min-width: 13.5rem;
    padding: 0.35rem 0;
    border: 1px solid var(--int-line);
    border-radius: var(--aiden-radius-md, 0.5rem);
    background: var(--int-surface);
    box-shadow: var(--int-surface-shadow);
}
.appbar-menu-divider {
    height: 1px;
    margin: 0.25rem 0;
    background: var(--int-line);
}
.appbar-menu-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 2.4rem;
    padding: 0.4rem 0.85rem;
    border: 0;
    background: transparent;
    color: var(--int-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.appbar-menu-item:hover,
.appbar-menu-item:focus-visible {
    background: color-mix(in srgb, var(--aiden-royal) 8%, var(--int-surface));
    outline: none;
}
.theme-dark-mode .appbar-menu-panel {
    background: color-mix(in srgb, #121a2b 90%, var(--aiden-royal));
    border-color: var(--int-line);
}
.theme-dark-mode .appbar-menu-item {
    color: #e7f0ff;
}
.theme-dark-mode .appbar-menu-item:hover,
.theme-dark-mode .appbar-menu-item:focus-visible {
    background: color-mix(in srgb, var(--aiden-royal) 22%, #121a2b);
}
button.lang-badge {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    padding: 0.15rem 0.25rem;
    border-radius: var(--aiden-radius-md, 0.5rem);
}
button.lang-badge:hover,
button.lang-badge:focus-visible {
    background: color-mix(in srgb, var(--aiden-royal) 8%, var(--aiden-off-white));
    outline: none;
}
.theme-dark-mode button.lang-badge:hover,
.theme-dark-mode button.lang-badge:focus-visible {
    background: color-mix(in srgb, var(--aiden-royal) 22%, #101625);
}
.lang-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.25rem;
    cursor: pointer;
}
button.user-widget {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
}
.lang-badge__flag {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: cover;
    border-radius: var(--aiden-radius-full, 9999px);
    flex: 0 0 auto;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--aiden-royal) 22%, transparent);
}
.lang-badge__code {
    letter-spacing: 0.04em;
    color: var(--int-ink-strong);
    font-size: 0.8rem;
    font-weight: 700;
}
    .lang-menu-item__flag {
        width: 1.35rem;
        height: 1rem;
        object-fit: cover;
        border-radius: 2px;
        margin: 0;
        flex: 0 0 1.35rem;
        display: block;
        align-self: center;
        box-shadow: 0 0 0 1px color-mix(in srgb, var(--aiden-royal) 18%, transparent);
    }
    .lang-menu-item__label {
        flex: 1 1 auto;
        text-align: left;
        line-height: 1.25;
    }
.lang-dropdown {
    position: relative;
    outline: none;
}
.lang-menu {
    position: absolute;
    top: calc(100% + 0.3rem);
    right: 0;
    left: auto;
    z-index: 1310;
    min-width: 14rem;
    padding: 0.35rem 0;
    border: 1px solid var(--int-line);
    border-radius: var(--aiden-radius-md, 0.5rem);
    background: var(--int-surface);
    box-shadow: var(--int-surface-shadow);
}
    .lang-menu-item {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.65rem;
        flex-direction: row;
        width: 100%;
        min-height: 2.5rem;
        padding: 0.4rem 0.85rem;
        border: 0;
        background: transparent;
        color: var(--int-ink);
        font: inherit;
        text-align: left;
        cursor: pointer;
    }
.lang-menu-item:hover {
    background: color-mix(in srgb, var(--aiden-royal) 8%, var(--int-surface));
}
.dark-mode-toggle-button { flex: 0 0 auto; }

.mud-drawer.integrator-drawer,
.mud-drawer.integrator-drawer .mud-drawer-content {
    background: var(--int-sidebar-gradient) !important;
    color: #d9e6f6 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    font-family: var(--aiden-font-body) !important;
}
.mud-drawer.integrator-drawer .mud-drawer-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 !important;
}
.integrator-drawer-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}
.integrator-drawer-brand {
    height: var(--integrator-topbar-height);
    min-height: var(--integrator-topbar-height);
    max-height: var(--integrator-topbar-height);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 1rem;
    /* Match AppBar bottom border so the lines meet at the same Y. */
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    flex: 0 0 var(--integrator-topbar-height);
}
.integrator-brand-icon {
    flex: 0 0 auto;
    width: 2rem;
    height: 2.125rem;
    object-fit: contain;
    object-position: center;
}
.integrator-brand-title {
    color: #fff !important;
    font-family: var(--aiden-font-body) !important;
    font-size: 1.0625rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.integrator-drawer-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0.75rem 0.2rem 1rem;
}
.integrator-drawer-footer {
    flex: 0 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.35rem;
    height: var(--integrator-footer-height, 3rem);
    min-height: var(--integrator-footer-height, 3rem);
    padding: 0 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
}
.integrator-drawer-version {
    color: rgba(217, 230, 246, 0.72) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    user-select: text;
    white-space: nowrap;
    padding: 0 0.75rem;
}
.mud-drawer.integrator-drawer .mud-nav-link {
    margin: 0.15rem 0.55rem;
    border-radius: var(--aiden-radius-md, 0.5rem) !important;
    color: #d9e6f6 !important;
    font-family: var(--aiden-font-body) !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    min-height: 2.85rem;
    /* DS: content inset >= space-4 next to limelight active accent. */
    padding: 0.5rem 0.75rem 0.5rem 1rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.mud-drawer.integrator-drawer .mud-nav-link .mud-nav-link-icon,
.mud-drawer.integrator-drawer .mud-nav-link .mud-nav-link-text {
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1.2 !important;
}
.mud-drawer.integrator-drawer .mud-nav-link .mud-nav-link-icon {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    margin: 0 !important;
    justify-content: center;
}
.mud-drawer.integrator-drawer .mud-nav-link .mud-nav-link-icon .mud-icon-root {
    margin: 0 !important;
    font-size: 1.25rem !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
}
.mud-drawer.integrator-drawer .mud-nav-link .mud-nav-link-text,
.mud-drawer.integrator-drawer .mud-nav-link .mud-nav-link-text *,
.mud-drawer.integrator-drawer .mud-nav-link .mud-typography-body1,
.mud-drawer.integrator-drawer .mud-nav-link .mud-typography-body2,
.mud-drawer.integrator-drawer .mud-nav-link .mud-icon-root {
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    letter-spacing: inherit !important;
}
.mud-drawer.integrator-drawer .mud-nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.18) !important;
}
.mud-drawer.integrator-drawer .mud-nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.18) !important;
    box-shadow: inset 0.25rem 0 0 var(--aiden-limelight, #BFD730);
}
.mud-drawer.integrator-drawer .mud-navmenu {
    padding: 0;
}

/* Viewport shell: MudLayout is not a flex column by default — pin chrome explicitly. */
.integrator-shell {
    height: 100%;
    min-height: 0;
}
.mud-layout {
    background: var(--int-canvas);
    height: 100% !important;
    min-height: 0;
    overflow: hidden;
}
.integrator-main.mud-main-content,
.integrator-main {
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column;
    background: var(--int-canvas);
    /* AppBar offset via pt-*; leave room for fixed footer. */
    min-height: 100%;
    max-height: 100%;
    overflow: hidden;
    padding-bottom: var(--integrator-footer-height, 3rem) !important;
}
.integrator-main > .page-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 1rem;
}
/* Always fixed to the bottom of the screen; align top border with drawer version strip. */
.integrator-app-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0;
    height: var(--integrator-footer-height, 3rem);
    min-height: var(--integrator-footer-height, 3rem);
    padding: 0 1rem;
    border-top: 1px solid var(--int-line);
    background: var(--int-canvas);
    color: var(--aiden-royal, var(--int-primary));
    font-size: 0.78rem;
}
@media (min-width: 960px) {
    .integrator-shell--drawer-open .integrator-app-footer {
        left: 272px;
    }
}
.integrator-app-footer-logo {
    height: 1.5rem;
    width: auto;
}

.mud-paper:not(.mud-elevation-0):not(.mud-appbar) {
    border: 1px solid var(--int-line);
    border-radius: var(--int-surface-radius) !important;
    box-shadow: var(--int-surface-shadow) !important;
}
.mud-table {
    border: 1px solid var(--int-line);
    border-radius: var(--int-surface-radius);
    overflow: hidden;
    background: var(--int-surface);
    box-shadow: var(--int-surface-shadow);
}
.mud-table .mud-table-head .mud-table-cell {
    font-weight: 700 !important;
    color: var(--int-ink-strong) !important;
    background: color-mix(in srgb, var(--int-canvas) 65%, var(--int-surface));
}
/* Primary action = limelight; secondary = royal (Aiden DS action hierarchy). */
.mud-button-filled-primary {
    background: var(--aiden-color-action-primary, #BFD730) !important;
    color: var(--aiden-color-text-on-action, #32363D) !important;
    box-shadow: none !important;
}
.mud-button-filled-primary:hover {
    background: var(--aiden-color-action-primary-hover, #C9DD4F) !important;
}
.mud-button-filled-primary .mud-button-label,
.mud-button-filled-primary .mud-icon-root {
    color: inherit !important;
}
.mud-button-filled-secondary {
    background: var(--aiden-color-action-secondary, #3C5279) !important;
    color: var(--aiden-color-text-on-dark, #fff) !important;
    box-shadow: none !important;
}
.mud-button-filled-secondary:hover {
    filter: brightness(0.92);
}
.mud-button-outlined-secondary {
    border-color: var(--aiden-royal, var(--int-primary)) !important;
    color: var(--aiden-royal, var(--int-primary)) !important;
}
.theme-dark-mode .mud-button-outlined-secondary {
    border-color: var(--aiden-limelight) !important;
    color: var(--aiden-limelight) !important;
}
.theme-dark-mode .integrator-app-footer {
    color: color-mix(in srgb, var(--aiden-royal, var(--int-primary)) 72%, var(--aiden-cool-grey, #d7d9dd));
}
.mud-input:focus-within .mud-input-outlined-border,
.mud-input-control:focus-within .mud-input-outlined-border,
.mud-select:focus-within .mud-input-outlined-border,
.mud-autocomplete:focus-within .mud-input-outlined-border {
    border-color: transparent !important;
}
/* DS dropdown/input focus: 3px royal ring (24% mix), no bare outline-only. */
.mud-input:focus-within,
.mud-input-control:focus-within,
.mud-select:focus-within,
.mud-autocomplete:focus-within {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--aiden-royal, var(--int-primary)) 24%, transparent);
    border-radius: var(--int-control-radius);
    outline: 0;
}
.mud-input:focus-within .mud-input-underline:after,
.mud-input-control:focus-within .mud-input-underline:after {
    border-color: var(--aiden-color-border-focus, var(--int-primary)) !important;
}
.mud-drawer-header { border-bottom: 1px solid var(--int-line); }
.mud-drawer:not(.integrator-drawer) { background: var(--int-surface) !important; }
.listener-editor-panels .mud-expand-panel {
    border: 1px solid var(--int-line);
    border-radius: var(--int-control-radius) !important;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
/* ---- Operational shell + reusable component primitives (DS v0.2.0) ---- */
.status-dot {
    flex: 0 0 auto;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--aiden-radius-full, 9999px);
    background: var(--aiden-success);
}
.status-dot--error {
    background: var(--aiden-danger);
}
.nav-status-card .status-dot {
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 0 4px rgba(37, 211, 102, 0.55);
}
.env-pill {
    display: flex;
    align-items: center;
    gap: var(--aiden-space-2, 0.5rem);
    min-height: 2.5rem;
    border: 1px solid var(--aiden-cool-grey);
    border-radius: var(--aiden-radius-full, 9999px);
    padding: var(--aiden-space-2, 0.5rem) var(--aiden-space-3, 0.75rem);
    background: var(--aiden-off-white);
    color: var(--aiden-royal);
    font-size: 0.82rem;
    white-space: nowrap;
}
.env-pill .status-dot {
    background: var(--aiden-success);
}
.env-pill strong {
    color: var(--aiden-warm-black);
}
.env-pill span:not(.status-dot) {
    color: var(--aiden-royal);
}
.user-widget {
    display: flex;
    align-items: center;
    gap: var(--aiden-space-2, 0.5rem);
    min-height: 2.5rem;
    padding: var(--aiden-space-1, 0.25rem) var(--aiden-space-2, 0.5rem) var(--aiden-space-1, 0.25rem) var(--aiden-space-1, 0.25rem);
    border-radius: var(--aiden-radius-md, 0.5rem);
}
.user-widget--clickable {
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.user-widget--clickable:hover,
.user-widget--clickable:focus-visible {
    background: color-mix(in srgb, var(--aiden-royal) 8%, var(--aiden-off-white));
    outline: none;
}
.user-widget--clickable:focus-visible {
    box-shadow: 0 0 0 3px var(--int-focus-ring);
}
.user-menu-header {
    padding: 0.65rem 0.9rem 0.35rem;
    min-width: 12rem;
}
.user-menu-header__name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--int-ink-strong);
    line-height: 1.25;
}
.user-menu-header__meta {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--int-muted);
    line-height: 1.3;
}
.user-menu-popover.mud-popover,
.lang-menu-popover.mud-popover {
    border: 1px solid var(--int-line);
    border-radius: var(--aiden-radius-md, 0.5rem);
    box-shadow: var(--int-surface-shadow);
    overflow: hidden;
}
.lang-menu-item-content {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.theme-dark-mode .user-widget--clickable:hover,
.theme-dark-mode .user-widget--clickable:focus-visible {
    background: color-mix(in srgb, var(--aiden-royal) 22%, #101625);
}
.theme-dark-mode .user-menu-header__name {
    color: #fff;
}
.theme-dark-mode .user-menu-header__meta {
    color: color-mix(in srgb, #fff 70%, var(--aiden-cool-grey));
}
.user-widget .user-copy {
    display: grid;
    min-width: 0;
    line-height: 1.2;
    color: var(--aiden-warm-black);
}
.user-widget .user-copy strong {
    color: var(--aiden-warm-black);
    font-size: 0.82rem;
    white-space: nowrap;
}
.user-widget .user-copy small {
    margin-top: 0.1rem;
    color: var(--aiden-royal);
    font-size: 0.72rem;
    white-space: nowrap;
}
.avatar {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--aiden-radius-full, 9999px);
    background: color-mix(in srgb, var(--aiden-royal) 16%, var(--aiden-off-white));
    color: var(--aiden-royal);
    font-size: 0.72rem;
    font-weight: 700;
}
.nav-status-card {
    flex: 0 0 auto;
    margin: 0 0.55rem 0.55rem;
    padding: var(--aiden-space-3, 0.75rem);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--aiden-radius-md, 0.5rem);
    color: #fff;
    font-size: 0.72rem;
}
.nav-status-card span {
    display: flex;
    align-items: center;
    gap: var(--aiden-space-2, 0.5rem);
    font-weight: 700;
}
.nav-status-card small {
    display: block;
    margin-top: var(--aiden-space-2, 0.5rem);
    color: rgba(255, 255, 255, 0.55);
}

.metric-card {
    display: flex;
    align-items: center;
    gap: var(--aiden-space-4, 1rem);
    border: 1px solid var(--aiden-cool-grey);
    border-radius: var(--aiden-radius-md, 0.5rem);
    padding: var(--aiden-space-4, 1rem);
    background: var(--aiden-off-white);
}
.metric-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: var(--aiden-radius-md, 0.5rem);
    background: color-mix(in srgb, var(--aiden-royal) 12%, var(--aiden-off-white));
    color: var(--aiden-royal);
    font-size: 1.2rem;
}
.metric-icon--success {
    background: color-mix(in srgb, var(--aiden-success) 16%, var(--aiden-off-white));
    color: #087944;
}
.metric-icon--warning {
    background: color-mix(in srgb, var(--aiden-warning) 18%, var(--aiden-off-white));
    color: var(--aiden-warning);
}
.metric-icon--attention {
    background: color-mix(in srgb, var(--aiden-limelight) 22%, var(--aiden-off-white));
    color: var(--aiden-warm-black);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: var(--aiden-space-4, 1rem);
    flex-wrap: wrap;
    min-height: 3.5rem;
    padding: var(--aiden-space-3, 0.75rem) var(--aiden-space-4, 1rem);
    border: 1px solid var(--aiden-cool-grey);
    border-radius: var(--aiden-radius-md, 0.5rem);
    background: var(--aiden-off-white);
    color: var(--aiden-royal);
    font-size: 0.85rem;
}
.toolbar-status {
    color: #087944;
    font-weight: 700;
}
.toolbar-error {
    color: var(--aiden-danger);
    font-weight: 700;
}

.mud-table.table--compact,
.table--compact {
    margin-top: 0;
    font-size: 0.82rem;
}
.mud-table.table--compact .mud-table-head .mud-table-cell,
.table--compact th {
    color: var(--int-muted) !important;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}
.mud-table.table--compact .mud-table-cell,
.table--compact th,
.table--compact td {
    padding: var(--aiden-space-2, 0.5rem) var(--aiden-space-3, 0.75rem);
    white-space: nowrap;
}
.mud-table.table--compact .mud-table-container .mud-table-root .mud-table-body tr:hover,
.table--compact tbody tr:hover {
    background: color-mix(in srgb, var(--aiden-royal) 4%, var(--aiden-off-white));
}

/* Sticky trailing Actions column: stays visible while the table scrolls horizontally. */
.mud-table.table--compact .mud-table-container {
    overflow-x: auto;
}
.mud-table.table--compact .mud-table-root {
    border-collapse: separate;
    border-spacing: 0;
}
.mud-table.table--compact .mud-table-cell.table-col-actions,
.table--compact .table-col-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    white-space: nowrap !important;
    background: var(--int-surface);
    box-shadow: -8px 0 12px -8px rgba(27, 43, 74, 0.28);
}
.mud-table.table--compact .mud-table-head .mud-table-cell.table-col-actions,
.table--compact thead .table-col-actions {
    z-index: 3;
    background: color-mix(in srgb, var(--int-canvas) 65%, var(--int-surface));
}
.mud-table.table--compact .mud-table-body tr:hover > .mud-table-cell.table-col-actions,
.table--compact tbody tr:hover > .table-col-actions {
    background: color-mix(in srgb, var(--aiden-royal) 4%, var(--int-surface));
}
.mud-table.table--compact .mud-table-cell.table-col-clip,
.table--compact .table-col-clip {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.theme-dark-mode .mud-table.table--compact .mud-table-cell.table-col-actions,
.theme-dark-mode .table--compact .table-col-actions {
    background: color-mix(in srgb, #121a2b 86%, var(--aiden-royal));
    box-shadow: -8px 0 12px -8px rgba(0, 0, 0, 0.45);
}
.theme-dark-mode .mud-table.table--compact .mud-table-head .mud-table-cell.table-col-actions,
.theme-dark-mode .table--compact thead .table-col-actions {
    background: color-mix(in srgb, #121a2b 78%, var(--aiden-royal));
}
.theme-dark-mode .mud-table.table--compact .mud-table-body tr:hover > .mud-table-cell.table-col-actions,
.theme-dark-mode .table--compact tbody tr:hover > .table-col-actions {
    background: color-mix(in srgb, var(--aiden-royal) 18%, #121a2b);
}

/* Listeners: trigger cell wraps long webhook URLs on max 3 lines (no horizontal scroll). */
.listeners-trigger-cell {
    white-space: normal !important;
}
.listeners-webhook-path {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: var(--aiden-space-4, 1rem);
    padding: var(--aiden-space-7, 3rem);
    text-align: center;
}
.empty-icon {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    border: 1px solid var(--aiden-cool-grey);
    border-radius: var(--aiden-radius-md, 0.5rem);
    background: color-mix(in srgb, var(--aiden-royal) 6%, var(--aiden-off-white));
    color: var(--aiden-royal);
    font-size: 1.45rem;
}

.notice {
    background: color-mix(in srgb, var(--aiden-royal) 7%, var(--aiden-off-white));
    border-left: 0.35rem solid var(--aiden-royal);
    padding: var(--aiden-space-3, 0.75rem) var(--aiden-space-4, 1rem);
}
.notice--success {
    border-left-color: var(--aiden-success);
    background: color-mix(in srgb, var(--aiden-success) 7%, var(--aiden-off-white));
}
.notice--attention {
    border-left-color: var(--aiden-limelight);
}
.notice--error {
    border-left-color: var(--aiden-danger);
    background: color-mix(in srgb, var(--aiden-danger) 7%, var(--aiden-off-white));
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: var(--aiden-radius-full, 9999px);
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
}
.status-pill--neutral {
    background: color-mix(in srgb, var(--aiden-royal) 12%, var(--aiden-off-white));
    color: var(--aiden-royal);
}
.status-pill--success {
    background: color-mix(in srgb, var(--aiden-success) 18%, var(--aiden-off-white));
    color: #087944;
}

.split-view {
    display: grid;
    grid-template-columns: minmax(15rem, 0.72fr) minmax(0, 1fr) minmax(20rem, 1.15fr);
    gap: var(--aiden-space-4, 1rem);
    min-height: 32rem;
}
.pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    border: 1px solid var(--aiden-cool-grey);
    border-radius: var(--aiden-radius-md, 0.5rem);
    background: var(--aiden-off-white);
}
.pane-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--aiden-space-2, 0.5rem);
    min-height: 3.5rem;
    padding: var(--aiden-space-3, 0.75rem) var(--aiden-space-4, 1rem);
    border-bottom: 1px solid var(--aiden-cool-grey);
    background: color-mix(in srgb, var(--aiden-off-white) 96%, var(--aiden-royal));
}
.pane-list-item {
    padding: var(--aiden-space-3, 0.75rem) var(--aiden-space-4, 1rem);
    border-bottom: 1px solid var(--aiden-cool-grey);
    cursor: pointer;
    transition: background 0.2s ease;
}
.pane-list-item:hover {
    background: color-mix(in srgb, var(--aiden-royal) 4%, var(--aiden-off-white));
}
.pane-list-item[aria-current="true"] {
    background: color-mix(in srgb, var(--aiden-royal) 8%, var(--aiden-off-white));
    box-shadow: inset 0.25rem 0 0 var(--aiden-limelight);
}

.confirm-row {
    display: flex;
    align-items: flex-start;
    gap: var(--aiden-space-3, 0.75rem);
    flex-wrap: wrap;
    margin-top: var(--aiden-space-4, 1rem);
    padding: var(--aiden-space-3, 0.75rem) var(--aiden-space-4, 1rem);
    border: 1px solid color-mix(in srgb, var(--aiden-sapphire) 35%, var(--aiden-off-white));
    border-radius: var(--aiden-radius-md, 0.5rem);
    background: color-mix(in srgb, var(--aiden-sapphire) 8%, var(--aiden-off-white));
}

.tabs {
    display: flex;
    gap: var(--aiden-space-2, 0.5rem);
    overflow-x: auto;
    padding: var(--aiden-space-2, 0.5rem);
    margin-bottom: var(--aiden-space-4, 1rem);
    border: 1px solid var(--aiden-cool-grey);
    border-radius: var(--aiden-radius-md, 0.5rem);
    background: var(--aiden-off-white);
    scrollbar-width: thin;
}

.theme-dark-mode .env-pill {
    border-color: color-mix(in srgb, var(--int-line) 65%, var(--aiden-cool-grey));
    background: color-mix(in srgb, #101625 82%, var(--aiden-royal));
}
.theme-dark-mode .env-pill strong {
    color: #fff;
}
.theme-dark-mode .env-pill span:not(.status-dot) {
    color: color-mix(in srgb, #fff 78%, var(--aiden-cool-grey));
}
.theme-dark-mode .user-widget .user-copy strong {
    color: #fff;
}
.theme-dark-mode .user-widget .user-copy small {
    color: color-mix(in srgb, var(--aiden-cool-grey) 76%, #fff);
}
.theme-dark-mode .avatar {
    background: color-mix(in srgb, var(--aiden-royal) 36%, #101625);
    color: #e7f0ff;
}
.theme-dark-mode .status-dot {
    background: color-mix(in srgb, var(--aiden-success) 86%, #7ae6b0);
}
.theme-dark-mode .nav-status-card {
    border-color: rgba(255, 255, 255, 0.22);
    background: color-mix(in srgb, #121a2b 72%, var(--aiden-royal));
}
.theme-dark-mode .nav-status-card small {
    color: rgba(255, 255, 255, 0.68);
}
.theme-dark-mode .metric-card,
.theme-dark-mode .toolbar,
.theme-dark-mode .pane,
.theme-dark-mode .tabs,
.theme-dark-mode .mud-table.table--compact {
    border-color: var(--int-line);
    background: color-mix(in srgb, #121a2b 86%, var(--aiden-royal));
}
.theme-dark-mode .metric-icon {
    background: color-mix(in srgb, var(--aiden-royal) 28%, #101625);
    color: #d9e6f6;
}
.theme-dark-mode .metric-icon--success {
    background: color-mix(in srgb, var(--aiden-success) 26%, #101625);
    color: #7ae6b0;
}
.theme-dark-mode .metric-icon--warning {
    background: color-mix(in srgb, var(--aiden-warning) 26%, #101625);
    color: #ffb4ad;
}
.theme-dark-mode .metric-icon--attention {
    background: color-mix(in srgb, var(--aiden-limelight) 24%, #101625);
    color: #f3f9cd;
}
.theme-dark-mode .toolbar,
.theme-dark-mode .toolbar-status,
.theme-dark-mode .toolbar-error {
    color: #d9e6f6;
}
.theme-dark-mode .toolbar-status {
    color: #7ae6b0;
}
.theme-dark-mode .toolbar-error {
    color: #ffb4ad;
}
.theme-dark-mode .mud-table.table--compact .mud-table-head .mud-table-cell {
    color: color-mix(in srgb, #fff 70%, var(--aiden-cool-grey)) !important;
    background: color-mix(in srgb, #121a2b 88%, var(--aiden-royal));
}
.theme-dark-mode .mud-table.table--compact .mud-table-container .mud-table-root .mud-table-body tr:hover {
    background: color-mix(in srgb, var(--aiden-royal) 14%, #121a2b);
}
.theme-dark-mode .empty-icon {
    border-color: var(--int-line);
    background: color-mix(in srgb, var(--aiden-royal) 20%, #101625);
    color: #d9e6f6;
}
.theme-dark-mode .notice {
    background: color-mix(in srgb, var(--aiden-royal) 16%, #101625);
    color: #e7f0ff;
}
.theme-dark-mode .notice--success {
    background: color-mix(in srgb, var(--aiden-success) 16%, #101625);
}
.theme-dark-mode .notice--error {
    background: color-mix(in srgb, var(--aiden-danger) 14%, #101625);
}
.theme-dark-mode .status-pill--neutral {
    background: color-mix(in srgb, var(--aiden-royal) 28%, #101625);
    color: #d9e6f6;
}
.theme-dark-mode .status-pill--success {
    background: color-mix(in srgb, var(--aiden-success) 22%, #101625);
    color: #7ae6b0;
}
.theme-dark-mode .split-view .pane-header {
    border-bottom-color: var(--int-line);
    background: color-mix(in srgb, #121a2b 84%, var(--aiden-royal));
}
.theme-dark-mode .pane-list-item {
    border-bottom-color: var(--int-line);
}
.theme-dark-mode .pane-list-item:hover {
    background: color-mix(in srgb, var(--aiden-royal) 16%, #121a2b);
}
.theme-dark-mode .pane-list-item[aria-current="true"] {
    background: color-mix(in srgb, var(--aiden-royal) 22%, #121a2b);
}
.theme-dark-mode .confirm-row {
    border-color: color-mix(in srgb, var(--aiden-sapphire) 48%, #101625);
    background: color-mix(in srgb, var(--aiden-sapphire) 16%, #101625);
    color: #e7f0ff;
}

/* ---- User guide (/help) ---- */
.help-layout {
    display: grid;
    grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr);
    gap: var(--aiden-space-4, 1rem);
    align-items: start;
}
.help-toc {
    position: sticky;
    top: calc(var(--integrator-topbar-height, 4rem) + 0.75rem);
    padding: 0.85rem 0.75rem;
}
.help-toc__title {
    margin: 0 0 0.5rem !important;
    color: var(--int-ink-strong) !important;
}
.help-toc__nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.help-toc__link {
    display: block;
    border-radius: var(--aiden-radius-sm, 0.35rem);
    padding: 0.35rem 0.5rem;
    color: var(--int-muted);
    font-size: 0.82rem;
    line-height: 1.3;
    text-decoration: none;
}
.help-toc__link:hover,
.help-toc__link:focus-visible {
    color: var(--int-ink-strong);
    background: color-mix(in srgb, var(--int-primary) 8%, var(--int-surface));
    outline: none;
}
.help-content {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}
.help-section {
    padding: 1rem 1.15rem 1.1rem;
    scroll-margin-top: calc(var(--integrator-topbar-height, 4rem) + 0.75rem);
}
.help-section .mud-typography-h5 {
    margin: 0 0 0.55rem !important;
    color: var(--int-ink-strong) !important;
    font-family: var(--aiden-font-display) !important;
}
.help-section .mud-typography-body1 {
    margin: 0 0 0.55rem !important;
    color: var(--int-ink) !important;
    line-height: 1.5 !important;
}
.help-section__subtitle {
    margin: 0.75rem 0 0.35rem !important;
    color: var(--int-ink-strong) !important;
}
.help-list {
    margin: 0 0 0.65rem;
    padding-left: 1.2rem;
    color: var(--int-ink);
    line-height: 1.45;
}
.help-list li + li {
    margin-top: 0.35rem;
}
.help-list--ordered {
    padding-left: 1.35rem;
}
.help-code {
    font-family: var(--aiden-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
    font-size: 0.84em;
    padding: 0.1em 0.35em;
    border-radius: var(--aiden-radius-sm, 0.35rem);
    background: color-mix(in srgb, var(--int-primary) 8%, var(--int-surface));
    color: var(--int-ink-strong);
    word-break: break-word;
}
.help-pre {
    margin: 0.5rem 0 0.85rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--int-line);
    border-radius: var(--int-surface-radius);
    background: color-mix(in srgb, var(--int-canvas) 70%, var(--int-surface));
    overflow-x: auto;
}
.help-pre .help-code {
    padding: 0;
    background: transparent;
    white-space: pre;
    display: block;
    font-size: 0.8rem;
    line-height: 1.45;
}
.help-note {
    margin: 0.35rem 0 0 !important;
    color: var(--int-muted) !important;
}
.theme-dark-mode .help-code {
    background: color-mix(in srgb, var(--aiden-royal) 18%, #101625);
    color: #e7f0ff;
}
.theme-dark-mode .help-pre {
    background: color-mix(in srgb, #121a2b 88%, var(--aiden-royal));
    border-color: var(--int-line);
}
@media (max-width: 960px) {
    .help-layout {
        grid-template-columns: 1fr;
    }
    .help-toc {
        position: static;
    }
    .help-toc__nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

@media (max-width: 640px) {
    .page-heading { align-items: stretch; flex-direction: column; }
    .env-pill span:not(.status-dot),
    .user-widget .user-copy {
        display: none;
    }
    .user-widget {
        padding: 0;
    }
    .language-select-container {
        width: 18ch;
        min-width: 18ch;
        max-width: 18ch;
        flex-basis: 18ch;
    }
}

/* ---- New version banner (works without Blazor circuit) ---- */
.aiden-new-version-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--int-primary-deeper, #243447);
    color: #f8fafc;
    box-shadow: 0 -8px 28px rgba(16, 29, 56, 0.28);
    border-top: 1px solid color-mix(in srgb, var(--int-secondary, #BED731) 55%, transparent);
}
.aiden-new-version-banner[hidden] {
    display: none !important;
}
.aiden-new-version-banner__inner {
    max-width: var(--aiden-layout-content-max-width, 1440px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.aiden-new-version-banner__message {
    flex: 1 1 16rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}
.aiden-new-version-banner__reload {
    appearance: none;
    border: none;
    cursor: pointer;
    border-radius: var(--aiden-radius-md, 0.5rem);
    padding: 0.55rem 1rem;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--aiden-color-text-on-action, #32363D);
    background: var(--aiden-color-action-primary, var(--int-secondary, #BFD730));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.aiden-new-version-banner__reload:hover {
    filter: brightness(1.05);
}
.aiden-new-version-banner__reload:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.theme-dark-mode .aiden-new-version-banner {
    background: #0f121a;
    border-top-color: color-mix(in srgb, var(--int-secondary, #BED731) 40%, #33323e);
}
