/* Blazor Error UI */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Initial Blazor WASM boot (index.html): centered brand + progress ring */
.blazor-boot-screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 2rem 1.5rem 3rem;
    background: linear-gradient(160deg, #eef2ff 0%, #f1f5f9 38%, #e8f0fe 100%);
}

.blazor-boot-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 22rem;
    margin-bottom: 1.75rem;
}

.blazor-boot-brand-accent {
    width: 48px;
    height: 3px;
    margin: 0 0 1rem;
    border-radius: 2px;
    background: linear-gradient(90deg, #1b6ec2, #4f9de8);
}

.blazor-boot-title {
    font-size: clamp(1.35rem, 4.2vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.25;
    color: #0f172a;
    margin: 0;
    text-align: center;
}

.blazor-boot-tagline {
    font-size: 0.9375rem;
    color: #64748b;
    margin: 0.5rem 0 0;
    text-align: center;
    line-height: 1.45;
}

.blazor-boot-spinner-wrap {
    position: relative;
    width: 8rem;
    height: 8rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 0;
    flex-shrink: 0;
}

    .loading-progress circle {
        fill: none;
        stroke: #e2e8f0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.08s ease-out;
        }

.loading-progress-text {
    position: relative;
    margin-top: 1.35rem;
    min-height: 1.35rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: #475569;
    letter-spacing: 0.02em;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading…");
    }

/* Workflow Designer (admin/workflows) */
.wd-workflow-host {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.wd-workflow-root {
    /* Anchor on viewport so the height chain through Radzen tabs is deterministic
       and the inner canvas-scroll has a bounded size to scroll inside.
       No min-height: it would force the root to overflow `article` on small viewports
       and the canvas scrollbar at the bottom would be clipped. */
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: calc(100vh - 170px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.wd-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 8px;
    background: rgba(0,0,0,0.02);
    flex: 0 0 auto;
}

.wd-topbar-column {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    max-height: 45vh;
    min-height: 0;
}

.wd-validation-panel {
    flex: 0 0 auto;
    max-height: 22vh;
    overflow-y: auto;
    padding: 0 8px 8px;
}

.wd-validation-panel .alert {
    margin-bottom: 0.5rem;
}

.wd-validation-panel .alert:last-child {
    margin-bottom: 0;
}

.wd-validation-ok {
    padding: 0 8px 8px;
    font-size: 0.9rem;
    color: var(--color-green-600);
}

.wd-topbar-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wd-topbar-spacer {
    flex: 1 1 auto;
}

.wd-rootstep-pill {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(0,0,0,0.03);
    font-size: 0.9rem;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wd-layout {
    /* Grid keeps the properties panel pinned to the viewport edge; the canvas scrolls
       inside column 1 only and cannot push the panel off-screen via min-content width. */
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    gap: 0;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.wd-layout--panel-open {
    grid-template-columns: minmax(0, 1fr) 6px var(--wd-properties-panel-width, 320px);
}

.wd-layout > .wd-canvas-wrap {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.wd-properties-splitter {
    grid-column: 2;
    grid-row: 1;
    width: 6px;
    cursor: col-resize;
    margin: 0 2px;
    border-radius: 4px;
    background: transparent;
    touch-action: none;
}

.wd-properties-splitter:hover,
.wd-resizing-properties-panel .wd-properties-splitter {
    background: rgba(37, 140, 251, 0.35);
}

.wd-properties-panel {
    grid-column: 3;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wd-properties-panel.wd-panel {
    max-height: none;
    /* Scroll lives in .wd-properties-panel-body when chrome is present. */
    overflow: hidden;
}

.wd-properties-panel-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.wd-properties-chrome-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-slate-500);
}

.wd-properties-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.wd-properties-reveal-btn {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: auto;
    min-width: 2.75rem;
    height: auto;
    padding: 0.65rem 0.45rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-right: none;
    border-radius: 8px 0 0 8px;
    background: var(--color-white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    color: inherit;
}

.wd-properties-reveal-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    line-height: 1;
}

.wd-properties-reveal-btn:hover {
    background: rgba(37, 140, 251, 0.08);
}

.wd-resizing-properties-panel {
    cursor: col-resize;
    user-select: none;
}

.wd-resizing-properties-panel .wd-canvas-scroll,
.wd-resizing-properties-panel .wd-properties-panel-body {
    pointer-events: none;
}

.wd-entity-page {
    max-width: 1100px;
}

.wd-panel {
    background: var(--color-white);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 12px;
    max-height: 100%;
    /* Internal scroll only when content overflows; page never scrolls globally. */
    overflow: auto;
}

.wd-panel .rz-tabview-panels {
    padding-top: 10px;
}

.wd-side-panel {
    padding: 8px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.wd-side-panel > .rz-tabview {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.wd-side-panel > .rz-tabview > .rz-tabview-panels {
    flex: 1 1 auto;
    overflow: auto;
    min-height: 0;
}

.tenant-create-dialog .rz-dialog-content {
    overflow-x: clip;
}

.wd-properties-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.wd-properties-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.wd-prop-section {
    margin-bottom: 0.25rem;
}

/* Workflow viewer — compact inspector (tool panel, not document/markdown) */
.wd-viewer-inspector {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.wd-viewer-block + .wd-viewer-block {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.wd-viewer-label,
.wd-viewer-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-blue-600);
    margin-bottom: 0.25rem;
}

.wd-viewer-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    padding: 0;
    margin: 0 0 0.25rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
}

.wd-viewer-section-toggle .wd-viewer-section-title {
    margin-bottom: 0;
}

.wd-viewer-section-toggle .bi {
    font-size: 0.75rem;
    color: var(--color-blue-600);
    flex-shrink: 0;
}

.wd-viewer-section-toggle:hover .wd-viewer-section-title {
    text-decoration: underline;
}

.wd-viewer-value {
    font-weight: 500;
}

.wd-viewer-value-inline {
    font-weight: 600;
    color: var(--color-slate-900);
}

.wd-viewer-muted {
    color: var(--color-slate-500);
}

.wd-viewer-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.78em;
    word-break: break-word;
}

.wd-viewer-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.wd-viewer-list li + li {
    margin-top: 0.2rem;
}

.wd-viewer-table {
    font-size: inherit;
    margin-bottom: 0;
    --bs-table-cell-padding-y: 0.2rem;
    --bs-table-cell-padding-x: 0.35rem;
    --bs-table-color: var(--color-slate-900);
    --bs-table-bg: transparent;
}

.wd-viewer-table thead th {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-slate-500);
    border-bottom-width: 1px;
    white-space: nowrap;
}

.wd-viewer-table td {
    vertical-align: top;
    word-break: break-word;
}

.wd-viewer-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wd-viewer-action-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    background: rgba(0, 0, 0, 0.02);
}

.wd-viewer-action-route {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.45rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.wd-viewer-action-name {
    font-weight: 600;
    color: var(--color-slate-900);
}

.wd-viewer-action-arrow {
    color: var(--color-slate-500);
    flex-shrink: 0;
}

.wd-viewer-action-detail + .wd-viewer-action-detail {
    margin-top: 0.4rem;
}

.wd-viewer-detail-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-slate-500);
    margin-bottom: 0.15rem;
}

.wd-viewer-detail-list,
.wd-viewer-user-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.wd-viewer-detail-list li + li,
.wd-viewer-user-list li + li {
    margin-top: 0.15rem;
}

.wd-viewer-user-list li {
    word-break: break-word;
}

.wd-viewer-more {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    text-decoration: none;
    vertical-align: baseline;
}

.wd-viewer-more:hover {
    text-decoration: underline;
}

.wd-viewer-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.05rem 0.35rem;
    margin-right: 0.35rem;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.07);
    color: var(--color-slate-500);
    vertical-align: baseline;
}

.wd-transition-route {
    font-size: 0.95rem;
    word-break: break-word;
}

.wd-json-viewer-modal {
    width: min(920px, calc(100vw - 2rem));
    top: 8vh;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
}

.wd-subpanel {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    background: rgba(0,0,0,0.02);
}

.wd-muted {
    color: var(--color-slate-500);
    font-size: 0.9rem;
}

.wd-palette {
    display: flex;
    gap: 0.5rem;
}

.wd-palette-item {
    border: 1px dashed rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: grab;
    user-select: none;
    background: rgba(0,0,0,0.02);
}

.wd-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wd-entity-grid {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.wd-center {
    display: flex;
    justify-content: center;
}

.wd-canvas-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.wd-canvas-toolbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.wd-canvas-zoom-label {
    min-width: 3.25rem;
    text-align: center;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    color: var(--color-slate-500);
}

.wd-canvas-zoom-surface {
    position: relative;
    flex-shrink: 0;
}

.wd-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.wd-canvas-scroll {
    flex: 1 1 0;
    /* As a flex item, default min-width is min-content (= the 4000px canvas width).
       Force it to 0 so this element can be smaller than its content and actually scroll.
       Same applies to min-height for the vertical scrollbar. */
    min-width: 0;
    min-height: 0;
    width: 100%;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    /* Only the canvas viewport scrolls (horizontally + vertically) by default. */
    overflow: auto;
    background: var(--color-white);
}

.wd-canvas {
    position: relative;
    background-image: radial-gradient(circle at 1px 1px, rgba(0,0,0,0.08) 1px, transparent 0);
    background-size: 20px 20px;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.wd-edges {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wd-edge-line {
    color: rgba(0,0,0,0.35);
    stroke: rgba(0,0,0,0.35);
    stroke-width: 2;
    fill: none;
    pointer-events: auto;
    cursor: pointer;
}

.wd-edge-hit {
    stroke: transparent;
    stroke-width: 14;
    fill: none;
    pointer-events: stroke;
    cursor: pointer;
}

.wd-edge-selected {
    color: #258cfb;
    stroke: #258cfb;
    stroke-width: 4;
}

.wd-edge-invalid {
    color: #dc3545;
    stroke: #dc3545;
    stroke-width: 4;
}

.wd-edge-preview {
    color: rgba(37, 140, 251, 0.65);
    stroke: rgba(37, 140, 251, 0.65);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 6 4;
    pointer-events: none;
}

.wd-entity-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wd-entity-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.wd-entity-field-name {
    flex: 1 1 auto;
    min-width: 140px;
}

.wd-entity-field-type {
    flex: 0 0 130px;
}

.wd-entity-field-flags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
}

.wd-entity-field-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 0.8rem;
    color: var(--color-slate-500, #6c757d);
    white-space: nowrap;
}

.wd-entity-field-delete {
    flex: 0 0 auto;
}

.wd-entity-field-enums {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 8px 28px;
    width: calc(100% - 28px);
}

.wd-edges polygon {
    fill: currentColor;
}

.wd-node {
    position: absolute;
    box-sizing: border-box;
    background: var(--color-white);
    border: 1px solid rgba(0,0,0,0.18);
    border-radius: 10px;
    padding: 8px 28px 10px 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.wd-node-alias {
    border-style: dashed;
    border-color: rgba(13, 110, 253, 0.45);
    background: rgba(13, 110, 253, 0.05);
}

.wd-node-alias .wd-node-title {
    display: block;
}

.wd-node-alias-badge {
    font-size: 0.62rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 999px;
    line-height: 1;
    white-space: nowrap;
    position: absolute;
    left: 10px;
    bottom: 8px;
    opacity: 0.75;
    color: rgba(33, 37, 41, 0.78);
    border: 1px solid rgba(33, 37, 41, 0.16);
    background: transparent;
}

.wd-node-selected {
    border-color: #258cfb;
    box-shadow: 0 0 0 0.2rem rgba(37,140,251,0.25);
}

.wd-node-root {
    background: rgba(25, 135, 84, 0.14);
    border-color: rgba(25, 135, 84, 0.65);
}

.wd-node-root.wd-node-selected {
    border-color: #258cfb;
    box-shadow: 0 0 0 0.2rem rgba(37, 140, 251, 0.28);
}

.wd-node-current {
    outline: 3px solid #fd7e14;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(253, 126, 20, 0.35);
}

.wd-read-only .wd-node {
    cursor: pointer;
}

.wd-read-only .wd-node-port,
.wd-read-only .wd-node-remove,
.wd-read-only .wd-node-resize-handle {
    display: none;
}

.wd-node-end {
    background: rgba(253, 126, 20, 0.14);
    border-color: rgba(253, 126, 20, 0.65);
}

.wd-node-end.wd-node-selected {
    border-color: #258cfb;
    box-shadow: 0 0 0 0.2rem rgba(37, 140, 251, 0.28);
}

.wd-node-root.wd-node-end {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.16) 0%, rgba(253, 126, 20, 0.18) 100%);
    border-color: rgba(25, 135, 84, 0.45);
    box-shadow: inset 0 0 0 1px rgba(253, 126, 20, 0.35);
}

.wd-node-root.wd-node-end.wd-node-selected {
    border-color: #258cfb;
    box-shadow: 0 0 0 0.2rem rgba(37, 140, 251, 0.28), inset 0 0 0 1px rgba(253, 126, 20, 0.3);
}

/* Alias view of a terminal step: keep dashed alias chrome with orange emphasis */
.wd-node-alias.wd-node-end {
    border-style: dashed;
    border-color: rgba(253, 126, 20, 0.72);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.06) 0%, rgba(253, 126, 20, 0.12) 100%);
}

.wd-node-alias.wd-node-end.wd-node-selected {
    border-color: #258cfb;
    box-shadow: 0 0 0 0.2rem rgba(37, 140, 251, 0.28);
}

.wd-node-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(0, 0, 0, 0.35);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wd-node-remove:hover {
    color: var(--color-red-600);
    background: rgba(220, 53, 69, 0.08);
}

.wd-node-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 2;
    opacity: 0;
    border-radius: 0 0 8px 0;
    transition: opacity 120ms ease;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Ccircle cx='10' cy='10' r='1.25' fill='%23868e96'/%3E%3Ccircle cx='6' cy='10' r='1.25' fill='%23868e96'/%3E%3Ccircle cx='10' cy='6' r='1.25' fill='%23868e96'/%3E%3Ccircle cx='6' cy='6' r='1.25' fill='%23868e96'/%3E%3Ccircle cx='10' cy='2' r='1.25' fill='%23868e96'/%3E%3Ccircle cx='6' cy='2' r='1.25' fill='%23868e96'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 3px bottom 3px;
    background-size: 12px 12px;
}

.wd-node-resize-handle::before {
    content: "";
    position: absolute;
    inset: -4px 0 0 -4px;
}

.wd-node-title {
    font-weight: 600;
    word-break: break-word;
    font-size: 0.9rem;
}

.wd-node-port {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.35);
    background: var(--color-white);
    padding: 0;
    margin: 0;
    cursor: crosshair;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease, border-color 120ms ease;
}

.wd-node-port-out {
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
}

.wd-step-actor-tooltip {
    position: absolute;
    z-index: 30;
    max-width: 320px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: var(--color-white);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    font-size: 0.78rem;
    line-height: 1.35;
}

.wd-step-actor-tooltip-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-slate-900);
}

.wd-step-actor-tooltip-trigger + .wd-step-actor-tooltip-trigger {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.wd-step-actor-tooltip-label {
    display: block;
    font-weight: 600;
    margin-bottom: 3px;
    color: rgba(33, 37, 41, 0.85);
}

.wd-step-actor-tooltip-empty {
    color: rgba(33, 37, 41, 0.55);
    font-style: italic;
}

.wd-step-actor-tooltip-users {
    margin: 0;
    padding-left: 1.1rem;
}

.wd-step-actor-tooltip-users li {
    margin: 0;
}

.wd-step-actor-tooltip-more {
    list-style: none;
    margin-left: -1.1rem;
    color: rgba(33, 37, 41, 0.6);
    font-style: italic;
}

.wd-node:hover .wd-node-port,
.wd-node-selected .wd-node-port {
    opacity: 1;
    pointer-events: auto;
    border-color: rgba(37, 140, 251, 0.85);
}

.wd-node:hover .wd-node-resize-handle,
.wd-node-selected .wd-node-resize-handle {
    opacity: 1;
}

.wd-transition {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.wd-transition-selected {
    border-color: #258cfb;
}

.wd-transition-title {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.wd-guards {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wd-guards-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.wd-guard-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: start;
}

.wd-guard-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wd-guard-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.wd-guard-summary {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.2;
    word-break: break-word;
}

.wd-guard-kind-badge {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--color-slate-500);
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(0,0,0,0.03);
    padding: 2px 6px;
    border-radius: 999px;
    white-space: nowrap;
}

.wd-guard-details {
    color: var(--color-slate-500);
    font-size: 0.85rem;
    line-height: 1.2;
    word-break: break-word;
}

.wd-guard-editor {
    overflow: hidden;
}

.wd-guard-compare {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.wd-guard-compare-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.wd-guard-group {
    border-left: 3px solid rgba(0,0,0,0.08);
    padding-left: 10px;
}

.wd-guard-child-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    margin-top: 8px;
}

.wd-guard-child-index {
    font-size: 0.8rem;
    color: var(--color-slate-500);
    text-align: center;
    padding-top: 8px;
}

.wd-guard-child-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wd-guard-child-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    word-break: break-word;
}

.wd-guard-child-editor {
    min-width: 0;
}

.wd-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.wd-all-child {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding-left: 10px;
}

.wd-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1000;
}

.wd-modal {
    position: fixed;
    top: 20vh;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    max-width: calc(100vw - 2rem);
    background: var(--color-white);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    padding: 16px;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.wd-modal-row {
    margin-top: 12px;
}

.wd-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 16px;
}

.tr-quick-add-popup {
    position: fixed;
    z-index: 11000;
    margin: 0;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    line-height: 1.4;
    border-radius: 0.35rem;
    opacity: 0.92;
    pointer-events: auto;
    transform: translate(0, 0);
}

.tr-missing-key {
    cursor: help;
    border-bottom: 1px dotted rgba(0, 0, 0, 0.25);
}

/* Help page layout: article primary; topics as a side column from lg up */
.help-layout {
    display: grid;
    gap: 1.5rem;
    grid-template-areas:
        "article"
        "toc";
}

.help-toc {
    grid-area: toc;
    width: 100%;
    max-width: 18rem;
    padding: 0.75rem;
    border: 1px solid rgb(229 229 229);
    border-radius: 0.5rem;
    background: rgb(250 250 250);
}

.help-main {
    grid-area: article;
    min-width: 0;
}

.help-toc-title {
    margin: 0 0 0.5rem;
    padding: 0 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgb(115 115 115);
}

.help-toc-subtitle {
    margin: 0.75rem 0 0.35rem;
    padding: 0 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgb(163 163 163);
}

.help-toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    max-height: 16rem;
    overflow-y: auto;
}

.help-toc-link {
    display: block;
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.35;
    color: rgb(82 82 82);
    text-decoration: none;
}

.help-toc-link:hover {
    background: rgb(255 255 255);
    color: rgb(23 23 23);
}

.help-toc-link.is-active {
    background: rgb(255 255 255);
    font-weight: 600;
    color: rgb(30 64 175);
    box-shadow: 0 0 0 1px rgb(229 229 229);
}

@media (min-width: 1024px) {
    .help-layout {
        grid-template-columns: 15rem minmax(0, 1fr);
        grid-template-areas: "toc article";
        align-items: start;
        gap: 2rem;
    }

    .help-toc {
        position: sticky;
        top: 5rem;
        max-width: none;
    }

    .help-toc-nav {
        max-height: 70vh;
    }
}

/* In-app help Markdown articles (light content area) */
.help-article h1 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(23 23 23);
}

.help-article h2 {
    margin: 1.75rem 0 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: rgb(23 23 23);
}

.help-article h3 {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: rgb(38 38 38);
}

.help-article p,
.help-article li {
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgb(64 64 64);
}

.help-article ul,
.help-article ol {
    margin: 0.5rem 0 1rem;
    padding-left: 1.25rem;
}

.help-article ul {
    list-style: disc;
}

.help-article ol {
    list-style: decimal;
}

.help-article a {
    color: rgb(29 78 216);
    text-decoration: underline;
}

.help-article code {
    font-size: 0.8em;
    color: rgb(38 38 38);
    background: rgb(245 245 245);
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
}

.help-article pre {
    overflow-x: auto;
    margin: 0.75rem 0 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(212 212 212);
    background: rgb(250 250 250);
    font-size: 0.75rem;
    line-height: 1.5;
}

.help-article pre code {
    background: transparent;
    padding: 0;
}

.help-article table {
    width: 100%;
    margin: 0.75rem 0 1rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.help-article th,
.help-article td {
    padding: 0.5rem;
    border-bottom: 1px solid rgb(229 229 229);
    text-align: left;
    color: rgb(64 64 64);
}

.help-article th {
    color: rgb(82 82 82);
    font-weight: 600;
}

.help-article .help-mermaid,
.help-article .mermaid {
    overflow-x: auto;
    margin: 1rem 0 1.25rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(229 229 229);
    background: rgb(255 255 255);
}

.help-article .help-mermaid svg,
.help-article .mermaid svg {
    max-width: none;
    height: auto;
}

.help-workflow-viewer-host {
    min-height: 28rem;
}

.help-workflow-viewer-host .wd-workflow-root {
    height: min(70vh, 40rem);
}

@media print {
    .no-print,
    .help-toc,
    .bg-sidebar-gradient {
        display: none !important;
    }

    /* Top app bar in MainLayout */
    main > div.h-14 {
        display: none !important;
    }

    .help-layout {
        display: block !important;
    }

    .help-main,
    .help-page,
    .help-article {
        max-width: none !important;
        color: #111 !important;
    }

    .help-page {
        padding: 0 !important;
        margin: 0 !important;
    }

    body,
    main,
    article {
        background: #fff !important;
    }

    a {
        color: #111 !important;
        text-decoration: none !important;
    }

    /* Expand published workflow graph so it is not clipped by the on-screen viewport. */
    .help-workflow-viewer--print-page {
        break-before: page;
        page-break-before: always;
    }

    .help-workflow-viewer-host {
        display: block !important;
        overflow: visible !important;
        min-height: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .help-workflow-viewer-host .wd-workflow-root,
    .help-workflow-viewer-host .wd-layout,
    .help-workflow-viewer-host .wd-canvas-wrap,
    .help-workflow-viewer-host .wd-canvas-scroll,
    .help-workflow-viewer-host .wd-canvas-zoom-surface {
        display: block !important;
        height: auto !important;
        max-height: none !important;
        width: auto !important;
        max-width: none !important;
        min-height: 0 !important;
        min-width: 0 !important;
        overflow: visible !important;
        flex: none !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .help-workflow-viewer-host .wd-canvas-toolbar,
    .help-workflow-viewer-host .wd-properties-panel,
    .help-workflow-viewer-host .wd-properties-reveal-btn,
    .help-workflow-viewer-host .wd-properties-splitter,
    .help-workflow-viewer-host .wd-step-actor-tooltip,
    .help-workflow-viewer-host .wd-topbar-column {
        display: none !important;
    }

    .help-workflow-viewer-host .wd-canvas-zoom-surface,
    .help-workflow-viewer-host .wd-canvas {
        transform: none !important;
    }

    .help-workflow-viewer-host .wd-canvas {
        overflow: visible !important;
        background-image: none !important;
        background: #fff !important;
    }

    .help-workflow-viewer-host .wd-node {
        box-shadow: none !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .help-workflow-viewer-host .wd-edge-line {
        stroke: #333 !important;
        color: #333 !important;
    }
}

