:root {
    --bpm-blue: #0f63ff;
    --bpm-dark: #071633;
    --bpm-text: #101a35;
    --bpm-muted: #687795;
    --bpm-border: #dbe4f1;
    --bpm-bg: #f6f9fd;
    --bpm-card: #fff;
    --bpm-shadow: 0 18px 45px rgba(15,42,85,.10);
    --workspace-label-color: #0078d4;
    --workspace-label-weight: 500;
}

/* For Workspace Main Page*/
.workspace-shell {
    --workspace-font-weight-strong: 790;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: linear-gradient(180deg, #fafdff, #f1f6fc);
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    color: var(--bpm-text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


/* Blazor validation */

.validation-errors {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 700;
}

.validation-message,
.form-grid .validation-message,
.profile-editor-card .validation-message {
    display: block;
    margin-top: 0.15rem;
    color: #dc2626 !important;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
}

.form-grid input.invalid,
.form-grid select.invalid,
.form-grid textarea.invalid {
    border-color: #dc2626;
    background: #fff7f7;
}

button, input, select, textarea {
    font: inherit
}

.workspace-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: -0.15em;
    color: currentColor;
}

button > .workspace-icon,
a > .workspace-icon {
    margin-right: 0.35rem;
}

.header-actions button > .workspace-icon {
    margin-right: 0;
}

.nav-item .workspace-icon,
.workspace-logo .workspace-icon,
.project-icon .workspace-icon,
.module-icon .workspace-icon,
.setting-row > span:first-child .workspace-icon,
.setting-card-icon .workspace-icon,
.setting-index-button > span:first-child .workspace-icon,
.setting-detail-icon .workspace-icon,
.step-icon .workspace-icon,
.flow-arrow .workspace-icon,
.form-document-icon .workspace-icon {
    margin-right: 0;
}

.bpm-shell {
    padding: 18px
}

.hero-header {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    column-gap: 18px;
    row-gap: 14px;
    max-width: 1720px;
    margin: 0 auto 14px
}

.logo-cube {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background:
        radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 26%),
        linear-gradient(145deg, #35c2ff 0%, #296dff 42%, #5b3df5 100%);
    color: transparent;
    display: grid;
    place-items: center;
    font-size: 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 12px 28px rgba(41, 109, 255, 0.24),
        0 4px 10px rgba(91, 61, 245, 0.16)
}

.logo-cube::before {
    content: "";
    width: 11px;
    height: 11px;
    border: 2px solid rgba(255, 255, 255, 0.98);
    border-radius: 4px;
    transform: rotate(45deg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.logo-cube::after {
    content: "";
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fef08a, #f59e0b);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.hero-header h1,
.hero-header h2 {
    margin: 0;
    font-size: 32px;
    line-height: 1.1;
    color: #061535;
    letter-spacing: -1px
}

.hero-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.hero-header > span {
    margin-right: 0;
    font-size: 0.78rem;
    line-height: 1.2;
}

.hero-header strong {
    color: var(--bpm-blue)
}

.hero-actions {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    flex-wrap: wrap
}

.feature-pills {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center
}

    .feature-pills > button,
    .feature-pills > span {
        border: 1px solid var(--bpm-border);
        background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
        border-radius: 0.62rem;
        padding: 0.7rem 1rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-weight: 500;
        font-size: 0.95rem;
        color: #17305d;
        white-space: nowrap;
        box-shadow: 0 2px 0 #c5d4e8, 0 8px 18px rgba(15, 23, 42, 0.08);
        transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease
    }

    .feature-pills > button:hover:not(:disabled) {
        border-color: #8eb6ef;
        background: linear-gradient(180deg, #ffffff 0%, #ecf4ff 100%);
        box-shadow: 0 2px 0 #b8cce6, 0 10px 20px rgba(37, 99, 235, 0.16);
        transform: translateY(-1px);
    }

    .feature-pills > button:active:not(:disabled) {
        transform: translateY(2px);
        box-shadow: 0 1px 0 #c5d4e8, 0 3px 8px rgba(15, 23, 42, 0.1);
        background: linear-gradient(180deg, #ecf4ff 0%, #dfeeff 100%);
    }

    .feature-pills > button:focus-visible {
        outline: 3px solid rgba(37, 99, 235, 0.28);
        outline-offset: 2px;
    }

    .feature-pills > button:disabled {
        opacity: 0.55;
        transform: none;
        box-shadow: 0 1px 0 #d7e2f0;
        cursor: not-allowed;
    }

.feature-pills-primary {
    justify-content: flex-start;
    flex: 0 1 auto;
    min-width: 0;
}

.feature-pills-secondary {
    display: grid;
    grid-template-columns: max-content 52px 52px;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex: 0 0 auto;
}

.feature-pills-secondary .toolbar-import-panel {
    grid-column: 1 / -1;
}

@media (min-width: 641px) {
    .feature-pills-primary,
    .feature-pills-secondary {
        display: contents;
    }

    .hero-actions {
        gap: 8px;
        justify-content: flex-start;
    }

    .hero-actions > .toolbar-import-panel,
    .feature-pills-secondary .toolbar-import-panel {
        flex: 0 0 100%;
        width: 100%;
    }
}

.workspace-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.workspace-shortcut span {
    border: 0;
    background: transparent;
    padding: 0;
    min-height: 0;
    display: inline;
    box-shadow: none;
    color: inherit;
    font: inherit;
    white-space: nowrap;
}

@media (max-width: 980px) and (min-width: 641px) {
    .hero-actions {
        justify-content: flex-start;
        gap: 8px 10px;
    }

    .feature-pills {
        gap: 6px;
    }

    .feature-pills > button,
    .feature-pills > span {
        padding: 0.52rem 0.72rem;
        min-height: 38px;
        font-size: 11px;
    }

    .feature-pills-secondary {
        grid-template-columns: max-content 46px 46px;
        gap: 6px;
    }
}

.builder-window {
    max-width: 1720px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--bpm-border);
    border-radius: 12px;
    box-shadow: var(--bpm-shadow);
    overflow: visible;
    position: relative
}

.toolbar {
    height: 74px;
    position: sticky;
    top: 12px;
    z-index: 40;
    margin: 10px 12px 0;
    display: grid;
    grid-template-columns: 230px 1fr auto;
    align-items: center;
    gap: 16px;
    border: 1px solid #c7d8ee;
    border-radius: 18px;
    padding: 0 18px;
    background:
        radial-gradient(circle at top center, rgba(96, 165, 250, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,.99) 0%, rgba(246,250,255,.97) 100%);
    backdrop-filter: blur(12px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.96),
        0 18px 36px rgba(15,23,42,.14),
        0 6px 16px rgba(37,99,235,.10);
    overflow: visible
}

.toolbar::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(191,219,254,.75));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.hamburger, .icon-button {
    border: 1px solid var(--bpm-border);
    background: #fff;
    border-radius: 8px;
    padding: 9px 13px
}

.toolbar-actions, .device-tabs {
    display: flex;
    gap: 10px;
    align-items: center
}

.toolbar button {
    border: 1px solid var(--bpm-border);
    background: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 500;
    color: #17305d
}

    .toolbar button.primary {
        background: var(--bpm-blue);
        color: #fff;
        border-color: var(--bpm-blue)
    }

.device-tabs {
    border: 1px solid var(--bpm-border);
    border-radius: 9px;
    overflow: hidden;
    gap: 0
}

    .device-tabs button {
        border: 0;
        border-right: 1px solid var(--bpm-border);
        border-radius: 0
    }

        .device-tabs button.active {
            background: #eff5ff;
            color: var(--bpm-blue);
            outline: 1px solid var(--bpm-blue)
        }

.builder-grid {
    display: grid;
    grid-template-columns: 320px minmax(650px,1fr) 360px;
    min-height: 760px
}

.panel {
    background: #fff;
    padding: 22px;
    border-right: 1px solid var(--bpm-border)
}

.properties {
    border-right: 0;
    border-left: 1px solid var(--bpm-border)
}

h3 {
    margin: 0 0 18px;
    font-size: 18px
}

.search {
    height: 44px;
    border: 1px solid var(--bpm-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    margin-bottom: 18px
}

    .search input {
        border: 0;
        outline: 0;
        width: 100%
    }

.component-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.component-group {
    display: grid;
    gap: 8px
}

.component-group + .component-group {
    margin-top: 14px
}

.component-group-title {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer
}

.component-group-title:hover,
.component-group-title.expanded {
    color: var(--bpm-blue)
}

.component-group-title strong {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef6ff;
    color: #2563eb;
    font-size: 10px;
    line-height: 1.5;
    text-align: center
}

.component-group-title i {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--bpm-border);
    border-radius: 6px;
    background: #fff;
    color: #17305d;
    font-style: normal;
    font-size: 13px;
    line-height: 1
}

.component-group-items {
    display: grid;
    gap: 10px
}

.component-item {
    min-height: 52px;
    border: 1px solid var(--bpm-border);
    border-radius: 8px;
    background: #fff;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) 24px;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    cursor: grab;
    box-shadow: 0 4px 10px rgba(20,40,70,.03)
}

    .component-item:hover {
        border-color: #8eb6ff;
        background: #f8fbff
    }

.component-icon {
    font-weight: 900;
    color: var(--bpm-blue);
    font-size: 12px;
    text-align: center
}

.component-copy {
    display: grid;
    min-width: 0;
    gap: 2px
}

.component-copy strong,
.component-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.component-copy small {
    color: #64748b;
    font-size: 11px;
    font-weight: 650
}

.grip {
    color: #8b9ab0
}

.canvas-panel {
    padding: 22px;
    background: #fff
}

.canvas-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.preview-title-row {
    margin-bottom: 1.25rem;
}

    .canvas-title-row h3 {
        margin: 0;
    }

.preview-mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0.7rem 1.2rem;
    border: 1px solid #a16207;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #b8860b 0%, #d4a017 28%, #f2c94c 62%, #fff1b8 100%);
    color: #5b3a00;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 248, 220, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 248, 220, 0.7), inset 0 -1px 0 rgba(146, 105, 22, 0.18), 0 16px 34px rgba(146, 105, 22, 0.24), 0 5px 12px rgba(91, 58, 0, 0.16);
}

    .preview-mode-badge::after {
        content: "";
        position: absolute;
        top: 1px;
        left: 8%;
        width: 84%;
        height: 44%;
        border-radius: 999px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.08) 100%);
        pointer-events: none;
    }

.design-canvas {
    min-height: 680px;
    border: 1px dashed #7faeff;
    border-radius: 11px;
    background-image: radial-gradient(#dbe8f7 1px, transparent 1px);
    background-size: 14px 14px;
    padding: 16px
}

    .design-canvas.tablet {
        max-width: 768px;
        margin: auto
    }

    .design-canvas.mobile {
        max-width: 390px;
        margin: auto
    }

.empty-canvas {
    height: 620px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #071633
}

.drop-icon {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: #eaf2ff;
    display: grid;
    place-items: center;
    font-size: 42px;
    color: var(--bpm-blue);
    margin-bottom: 16px
}

.empty-canvas h2 {
    margin: 0 0 8px
}

.empty-canvas p {
    margin: 0;
    color: var(--bpm-muted)
}

.form-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 4px 0 16px
}

    .form-header h2 {
        font-size: 22px;
        margin: 0
    }

    .form-header p {
        margin: 4px 0 0;
        color: var(--bpm-muted)
    }

.form-small-icon {
    color: #365787
}

.draft-badge {
    display: inline-block;
    background: #dbf7e5;
    color: #277b45;
    border-radius: 7px;
    padding: 3px 9px;
    font-size: 12px;
    margin-left: 8px
}

.section-card {
    border: 1px solid var(--bpm-border);
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
    overflow: hidden
}

.section-header {
    height: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-bottom: 1px solid var(--bpm-border);
    cursor: pointer
}

.section-chevron {
    margin-left: auto
}

.accent-blue .section-header {
    background: #eaf4ff
}

.accent-green .section-header {
    background: #e8f8ed
}

.accent-purple .section-header {
    background: #f1ecff
}

.accent-yellow .section-header {
    background: #fff5d8
}

.bpm-component-layout.bpm-layout-equal { grid-template-columns: repeat(var(--bpm-layout-columns,5),minmax(0,1fr)) !important; gap:var(--bpm-layout-gap,12px) !important; }
.bpm-component-layout.bpm-layout-split { grid-template-columns:minmax(0,var(--bpm-layout-first,3.1fr)) minmax(0,var(--bpm-layout-second,1fr)) !important; gap:var(--bpm-layout-gap,12px) !important; }
.bpm-component-layout > * { grid-column:auto !important; min-width:0; }
@media(max-width:1100px) { .bpm-component-layout.bpm-layout-equal,.bpm-component-layout.bpm-layout-split { grid-template-columns:repeat(var(--bpm-layout-medium,2),minmax(0,1fr)) !important; } }
@media(max-width:650px) { .bpm-component-layout.bpm-layout-equal,.bpm-component-layout.bpm-layout-split { grid-template-columns:repeat(var(--bpm-layout-small,1),minmax(0,1fr)) !important; } }

.bpm-grid {
    display: grid;
    grid-template-columns: repeat(12,1fr);
    gap: 12px;
    padding: 14px
}

.field-shell, .runtime-field {
    min-width: 0
}

.field-shell {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 6px
}

    .field-shell.selected {
        border-color: var(--bpm-blue);
        box-shadow: 0 0 0 2px rgba(15,99,255,.12)
    }

label {
    display: block;
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 7px;
    color: #22345c
}

.required {
    color: #e02b3c
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--bpm-border);
    border-radius: 6px;
    padding: 10px 12px;
    background: #fff;
    color: #243656
}

textarea {
    min-height: 48px
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: 100%;
}

.checkbox-field input[type=checkbox] {
    width: auto;
    min-width: 0;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

.span-1 {
    grid-column: span 1
}

.span-2 {
    grid-column: span 2
}

.span-3 {
    grid-column: span 3
}

.span-4 {
    grid-column: span 4
}

.span-5 {
    grid-column: span 5
}

.span-6 {
    grid-column: span 6
}

.span-7 {
    grid-column: span 7
}

.span-8 {
    grid-column: span 8
}

.span-9 {
    grid-column: span 9
}

.span-10 {
    grid-column: span 10
}

.span-11 {
    grid-column: span 11
}

.span-12 {
    grid-column: span 12
}

.designer-grid {
    width: 100%;
    border-collapse: collapse;
    background: #fff
}

    .designer-grid th, .designer-grid td {
        border: 1px solid var(--bpm-border);
        padding: 9px;
        text-align: left;
        font-size: 12px
    }

.designer-grid th {
    background: #f8fbff
}

.designer-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bpm-grid-header-bg, #f8fbff);
    color: var(--bpm-grid-header-color, #0f172a);
    border-color: var(--bpm-grid-header-border, #cbd5e1);
}

.bpm-grid-shell {
    width: 100%;
    max-width: 100%;
    --bpm-grid-alt-row-bg: #f8fafc;
}

    .bpm-grid-shell.grid-scroll-enabled .bpm-grid-table-shell {
        overflow-x: auto;
    }

    .bpm-grid-shell.grid-scroll-enabled .designer-grid {
        width: max-content;
        min-width: 100%;
    }

    .bpm-grid-shell.grid-scroll-enabled .designer-grid .grid-frozen-column {
        position: sticky;
        background: #ffffff;
        z-index: 3;
    }

    .bpm-grid-shell.grid-scroll-enabled .designer-grid .grid-frozen-header-cell {
        z-index: 4;
        background: var(--bpm-grid-header-bg, #f8fbff);
    }

    .bpm-grid-shell.grid-scroll-enabled .designer-grid .grid-frozen-column-last {
        box-shadow: 2px 0 0 rgba(148, 163, 184, 0.35);
    }

    .bpm-grid-shell.grid-striped .designer-grid tbody tr:nth-child(even),
    .bpm-grid-shell.grid-striped .designer-grid tbody tr:nth-child(even) td {
        background: var(--bpm-grid-alt-row-bg);
    }

        .bpm-grid-shell.grid-striped .designer-grid tbody tr:nth-child(even) .grid-frozen-column {
            background: var(--bpm-grid-alt-row-bg);
        }

        .bpm-grid-shell.grid-striped .designer-grid tbody tr:nth-child(even) input {
            background: transparent;
        }

    .bpm-grid-shell.grid-borderless .designer-grid th,
    .bpm-grid-shell.grid-borderless .designer-grid td {
        border-left: 0;
        border-right: 0;
    }

    .bpm-grid-shell.grid-borderless .designer-grid td {
        border-top: 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .bpm-grid-shell.grid-borderless .designer-grid th {
        border-top: 0;
        border-bottom: 1px solid #cbd5e1;
    }

    .bpm-grid-shell.grid-borderless .designer-grid input {
        border-color: transparent;
        background: transparent;
        box-shadow: none;
    }

    .bpm-grid-shell.grid-borderless .designer-grid input:focus {
        border-color: #93c5fd;
        background: #ffffff;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.10);
    }

    .bpm-grid-shell.grid-row-height-narrow .designer-grid th,
    .bpm-grid-shell.grid-row-height-narrow .designer-grid td {
        padding: 4px 8px;
        font-size: 11px;
    }

    .bpm-grid-shell.grid-row-height-narrow .designer-grid input {
        min-height: 1.85rem;
        padding: 0.32rem 0.45rem;
        font-size: 0.72rem;
    }

    .bpm-grid-shell.grid-row-height-comfortable .designer-grid th,
    .bpm-grid-shell.grid-row-height-comfortable .designer-grid td {
        padding: 11px 12px;
    }

    .bpm-grid-shell.grid-row-height-comfortable .designer-grid input {
        min-height: 2.5rem;
        padding: 0.62rem 0.75rem;
    }

.bpm-grid-actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-bottom: 0.1rem;
}

.bpm-grid-actions-bar.grid-actions-align-left {
    justify-content: flex-start;
}

.bpm-grid-actions-bar.grid-actions-align-right {
    justify-content: flex-end;
}

.bpm-grid-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.bpm-grid-toolbar-action {
    display: flex;
    flex: 0 0 auto;
    min-width: 0;
    margin-bottom: 0;
}

.bpm-grid-toolbar .bpm-grid-export-button {
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
}

.grid-add-row-button,
.grid-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #2563eb;
    cursor: pointer;
}

.grid-add-row-button {
    gap: 0.35rem;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    border-color: var(--bpm-grid-add-border, #cbd5e1);
    border-radius: var(--bpm-grid-add-radius, 6px);
    background: var(--bpm-grid-add-bg, #ffffff);
    color: var(--bpm-grid-add-color, #2563eb);
    font-size: var(--bpm-grid-add-font-size, 0.78rem);
    font-weight: 750;
}

.grid-add-row-button-standard {
    box-shadow: none;
}

.grid-add-row-button-embossed {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -1px 0 rgba(15, 23, 42, 0.18);
}

.grid-add-row-button-light-shadow {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16);
}

.grid-add-row-button-dark-shadow {
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
}

.bpm-grid-export-button {
    min-width: 9rem;
}

.designer-grid .grid-total-row td {
    border-top: 2px solid #94a3b8;
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 800;
}

    .grid-add-row-button span {
        line-height: 1;
    }

.grid-row-action {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
}

    .grid-add-row-button:hover {
        border-color: var(--bpm-grid-add-color, #2563eb);
        background: #eff6ff;
    }

    .grid-row-action:hover {
        border-color: #2563eb;
        background: #eff6ff;
    }

    .grid-row-action.delete {
        color: #dc2626;
        border-color: #fecaca;
        background: #fff7f7;
    }

        .grid-row-action.delete:hover {
            border-color: #dc2626;
            background: #fee2e2;
        }

.grid-action-icon {
    width: 0.95rem;
    height: 0.95rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.grid-actions-column,
.grid-actions-cell {
    width: 88px;
    min-width: 88px;
    text-align: center;
}

.designer-grid tbody tr {
    cursor: pointer;
}

.designer-grid tbody tr.grid-row-selected,
.designer-grid tbody tr.grid-row-selected td {
    background: var(--bpm-grid-selected-row-bg) !important;
}

    .designer-grid tbody tr.grid-row-selected .grid-frozen-column {
        background: var(--bpm-grid-selected-row-bg) !important;
    }

    .designer-grid tbody tr.grid-row-selected input {
        background: transparent;
    }

    .designer-grid tbody tr.grid-row-selected .grid-cell-text {
        color: #0f172a;
    }

.grid-actions-cell {
    text-align: center;
    white-space: nowrap;
}

    .grid-actions-cell .grid-row-action + .grid-row-action {
        margin-left: 0.35rem;
    }

.designer-grid th,
.designer-grid td {
    vertical-align: middle;
}

.designer-grid th.grid-header-cell {
    padding: 0;
}

.grid-header-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 100%;
    padding: 9px;
    border: 1px solid var(--bpm-grid-header-border, #cbd5e1);
    background: var(--bpm-grid-header-bg, #f8fbff);
    color: var(--bpm-grid-header-color, #0f172a);
    font: inherit;
    font-size: var(--bpm-grid-header-font-size, 0.78rem);
    font-weight: var(--bpm-grid-header-font-weight, 700);
    text-align: inherit;
    cursor: pointer;
}

.grid-header-button:hover {
    background: color-mix(in srgb, var(--bpm-grid-header-bg, #f8fbff) 82%, #dbeafe);
}

/* A borderless grid uses one continuous header surface, with visible keyboard focus. */
.bpm-grid-shell.grid-borderless .grid-header-button {
    border: 0 !important;
    padding: 12px;
}

.grid-header-button:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: -2px;
}

.grid-header-button-label {
    min-width: 0;
    flex: 1 1 auto;
}

.grid-header-sort-indicator {
    position: relative;
    flex: 0 0 auto;
    width: 0.72rem;
    height: 1.25rem;
}

.grid-header-sort-indicator::before,
.grid-header-sort-indicator::after {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    line-height: 1;
    color: #93c5fd;
    content: "";
}

.grid-header-sort-indicator::before {
    top: 0.02rem;
    content: "▲";
}

.grid-header-sort-indicator::after {
    bottom: 0.02rem;
    content: "▼";
}

.grid-header-sort-indicator.is-asc::before {
    color: #60a5fa;
}

.grid-header-sort-indicator.is-asc::after {
    color: #93c5fd;
}

.grid-header-sort-indicator.is-desc::before {
    color: #93c5fd;
}

.grid-header-sort-indicator.is-desc::after {
    color: #60a5fa;
}

.grid-header-cell.is-sorted .grid-header-sort-indicator {
    opacity: 1;
}

.designer-grid td input {
    text-align: inherit;
}

.designer-grid .grid-readonly-cell {
    color: #334155;
}

.designer-grid .grid-readonly-cell input {
    color: #64748b;
}

.designer-grid .grid-cell-text {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.bpm-grid-shell {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: var(--bpm-grid-height, 500px);
}

.bpm-grid-shell .designer-grid tbody td,
.bpm-grid-shell .designer-grid tbody .grid-cell-text,
.bpm-grid-shell .designer-grid tbody input,
.bpm-grid-shell .designer-grid tbody select,
.bpm-grid-shell .designer-grid tbody textarea {
    font-size: var(--bpm-grid-font-size, 0.85rem);
}

.bpm-grid-shell .bpm-grid-status {
    font-size: 0.78rem;
}

.bpm-grid-table-shell {
    flex: 1 1 auto;
    min-height: 0;
    max-height: var(--bpm-grid-height, 500px);
    overflow: auto;
}

.bpm-grid-table-shell .designer-grid thead th {
    box-shadow: none;
}

.bpm-grid-shell.grid-header-style-standard .grid-header-button {
    box-shadow: inset 0 0 0 1px var(--bpm-grid-header-border, #cbd5e1);
}

.bpm-grid-shell.grid-borderless.grid-header-style-standard .grid-header-button {
    box-shadow: none;
}

.bpm-grid-shell.grid-header-style-embossed .grid-header-button {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), inset 0 -2px 0 rgba(15, 23, 42, 0.16), inset 0 0 0 1px var(--bpm-grid-header-border, #cbd5e1);
}

.bpm-grid-shell.grid-header-style-light-shadow .grid-header-button {
    box-shadow: inset 0 0 0 1px var(--bpm-grid-header-border, #cbd5e1), 0 2px 6px rgba(15, 23, 42, 0.08);
}

.bpm-grid-shell.grid-header-style-dark-shadow .grid-header-button {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12), 0 6px 14px rgba(15, 23, 42, 0.16);
}

.bpm-grid-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.15rem 0;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 750;
}

.bpm-grid-status-selected {
    color: #1d4ed8;
}

.bpm-grid-status-pager {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

.bpm-grid-page-button {
    min-width: 1.9rem;
    height: 1.9rem;
    padding: 0 0.45rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}

.bpm-grid-page-button.is-active {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.file-zone {
    border: 1px dashed #bdcbe0;
    border-radius: 8px;
    background: #fafcff;
    padding: 18px;
    text-align: center;
    color: #5a6d8b
}

.status-badge {
    background: #e7f8ed;
    color: #248242;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 800
}

.approval-note {
    background: #f8fbff;
    border: 1px solid var(--bpm-border);
    border-radius: 8px;
    padding: 12px;
    color: #4f6280
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--bpm-border);
    margin-bottom: 18px
}

.property-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px
}

    .property-row.inline input {
        width: 22px
    }

    .property-row textarea {
        min-height: 70px
    }

.module-bar {
    max-width: 1560px;
    margin: 14px auto 0;
    background: #073477;
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 16px 26px;
    box-shadow: var(--bpm-shadow)
}

    .module-bar strong {
        margin-left: auto;
        background: #fff;
        color: #0c2452;
        border-radius: 14px;
        padding: 12px 24px
    }

.runtime-form {
    padding: 16px
}

@media(max-width:1100px) {
    .builder-grid {
        grid-template-columns: 1fr
    }

    .toolbar {
        grid-template-columns: 1fr
    }

    .panel, .properties {
        border: 0;
        border-bottom: 1px solid var(--bpm-border)
    }

    .module-bar {
        display: none
    }

    .span-6, .span-4, .span-3 {
        grid-column: span 12
    }
}

.hero-actions .feature-pills > button,
.feature-pills > button,
.module-bar button {
    border: 1px solid #cfdced;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
    border-radius: .62rem;
    padding: .7rem 1rem;
    min-height: 44px;
    font-weight: 500;
    font-size: 13px;
    color: #16345f;
    box-shadow: 0 2px 0 #c5d4e8, 0 8px 18px rgba(15, 23, 42, .08);
    cursor: pointer
}

.hero-actions .feature-pills > button:hover:not(:disabled) {
    border-color: #8eb6ef;
    background: linear-gradient(180deg, #ffffff 0%, #ecf4ff 100%);
    box-shadow: 0 2px 0 #b8cce6, 0 10px 20px rgba(37, 99, 235, 0.16);
    transform: translateY(-1px);
}

.hero-actions .feature-pills > button:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #c5d4e8, 0 3px 8px rgba(15, 23, 42, 0.1);
    background: linear-gradient(180deg, #ecf4ff 0%, #dfeeff 100%);
}

.hero-actions .feature-pills > button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 2px;
}

.hero-actions .feature-pills > button:disabled {
    opacity: .55;
    transform: none;
    box-shadow: 0 1px 0 #d7e2f0;
    cursor: not-allowed;
}

.module-bar button {
    background: transparent;
    color: #fff;
    border: 0;
    font-weight: 800
}

.toolbar button:disabled {
    opacity: .45;
    cursor: not-allowed
}

.status-strip {
    padding: 10px 18px;
    background: #f7fbff;
    border-bottom: 1px solid var(--bpm-border);
    color: #37537f;
    font-weight: 700;
    font-size: 13px
}

.hide-palette {
    grid-template-columns: minmax(650px,1fr) 360px
}

.hide-properties {
    grid-template-columns: 320px minmax(650px,1fr)
}

.hide-palette.hide-properties {
    grid-template-columns: 1fr
}

.empty-canvas {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer
}

.section-card.selected-section {
    outline: 2px solid rgba(15,99,255,.22)
}

.section-drag {
    border: 0;
    background: transparent;
    color: #607497;
    cursor: pointer
}

.section-actions {
    margin-left: auto;
    display: flex;
    gap: 4px
}

    .section-actions button {
        border: 1px solid var(--bpm-border);
        background: #fff;
        border-radius: 6px;
        padding: 2px 7px;
        cursor: pointer
    }

.section-collapse-button {
    width: 28px;
    height: 28px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--bpm-border) 72%, #64748b);
    border-radius: 6px;
    background: transparent;
    color: #17305d;
    cursor: pointer;
    font-weight: 800;
    line-height: 1
}

    .section-actions .section-collapse-button {
        margin-left: 0;
        background: transparent;
        padding: 0
    }

    .section-collapse-button:hover {
        border-color: currentColor;
        background: transparent
    }

    .section-collapse-button:focus-visible {
        outline: 3px solid rgba(37, 99, 235, .22);
        outline-offset: 2px
    }

.runtime-section-collapsed > .section-header {
    border-bottom: 0
}

.section-empty {
    padding: 18px;
    border: 1px dashed var(--bpm-border);
    border-radius: 8px;
    text-align: center;
    color: var(--bpm-muted);
    background: #fbfdff
}

.field-toolbar {
    display: flex;
    align-items: center;
    gap: 8px
}

    .field-toolbar label {
        margin-right: auto
    }

.field-type {
    font-size: 11px;
    color: #58719a;
    background: #f1f6ff;
    border-radius: 12px;
    padding: 3px 8px
}

.form-action-button {
    background: var(--button-bg, var(--bpm-blue));
    color: var(--button-color, #fff);
    border: 1px solid var(--button-border, transparent);
    border-radius: var(--button-radius, 8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 10px 16px;
    font-size: var(--button-font-size, 0.9rem);
    font-weight: var(--button-font-weight, 800);
    cursor: pointer;
    white-space: nowrap;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, background 160ms ease
}

    .form-action-button:hover {
        filter: brightness(0.98)
    }

.button-icon {
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button-text {
    min-width: 0;
}

.picker-preview-icon {
    width: 1rem;
    height: 1rem;
}

.icon-picker-item-icon {
    width: 1.65rem;
    height: 1.65rem;
}

.tabs-preview {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--bpm-border)
}

    .tabs-preview span {
        padding: 9px 14px;
        border: 1px solid var(--bpm-border);
        border-bottom: 0;
        border-radius: 8px 8px 0 0;
        background: #fff
    }

.property-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px
}

    .property-actions button {
        border: 1px solid var(--bpm-border);
        border-radius: 8px;
        background: #fff;
        padding: 10px;
        cursor: pointer;
        font-weight: 700
    }

    .property-actions .danger {
        color: #b91c1c;
        border-color: #fecaca;
        background: #fff7f7
    }

.property-row.full {
    grid-template-columns: 1fr
}

.muted-text {
    color: var(--bpm-muted);
    line-height: 1.5
}

.json-panel {
    border-top: 1px solid var(--bpm-border);
    background: #071633;
    color: #dce9ff;
    padding: 16px
}

    .json-panel > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px
    }

    .json-panel button {
        background: #fff;
        border: 0;
        border-radius: 8px;
        padding: 8px 12px;
        font-weight: 700
    }

    .json-panel pre {
        max-height: 280px;
        overflow: auto;
        margin: 0;
        white-space: pre-wrap;
        font-size: 12px
    }

.runtime-field small {
    display: block;
    color: var(--bpm-muted);
    margin-top: 6px
}

.date-picker-preview {
    display: grid;
    gap: 6px
}

.date-picker-preview-input-shell {
    position: relative
}

.date-picker-preview-input-shell>input[type=text] {
    padding-right: 2.5rem
}

.date-picker-native-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer
}

.date-picker-native-input:disabled {
    cursor: default
}

.date-picker-preview-icon {
    position: absolute;
    top: 50%;
    right: .85rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    pointer-events: none
}

.date-timezone-hint {
    width: fit-content;
    max-width: 100%;
    padding: 3px 8px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8 !important;
    font-size: 11px !important;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere
}

.palette button.component-item {
    text-align: left
}

.toolbar-icons button {
    border: 0;
    background: transparent;
    cursor: pointer
}

.toolbar-icons .avatar {
    border-radius: 50%;
    border: 0;
    color: #fff
}

.editable-form-title,
.editable-form-subtitle {
    cursor: text;
}

.form-title-editor,
.form-subtitle-editor {
    width: 100%;
    border: 1px solid #d0d7e2;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    background: #fff;
}

.form-title-editor {
    font-size: 1.5rem;
    font-weight: 500;
}

.form-subtitle-editor {
    font-size: 0.95rem;
    color: #4b5563;
}

.form-header-content {
    width: 100%;
}

.preview-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #1e293b;
    cursor: pointer;
    font-weight: 600;
}

@media (max-width: 768px) {
    .canvas-title-row {
        gap: 0.75rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .preview-mode-badge {
        width: 100%;
        justify-content: flex-start;
    }
}

    .preview-back-button:hover {
        background: #f8fafc;
        border-color: #94a3b8;
        color: #1d4ed8;
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.14);
    }

    .preview-back-button:active {
        transform: translateY(0);
        box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
    }

    .preview-back-button:focus-visible {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
    }

.property-group > summary {
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 0.75rem;
    user-select: none;
}

.property-group[open] > summary {
    margin-bottom: 1rem;
}

.field-label {
    color: var(--field-label-color, #22345c);
    font-size: var(--field-label-size, 12px);
    font-weight: var(--field-label-weight, 700);
}

.runtime-field-required input,
.runtime-field-required select,
.runtime-field-required textarea,
.runtime-field-required .date-picker-preview-input-shell > input[type=text] {
    border-color: #dc2626;
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.08);
}

.runtime-field-required .field-label {
    color: #991b1b;
}

.field-help {
    display: block;
    color: var(--field-help-color, var(--bpm-muted));
    margin-top: 6px;

}.builder-grid.device-layout-tablet,
.builder-grid.device-layout-mobile {
    grid-template-columns: 1fr;
}

.builder-grid.hide-palette {
    grid-template-columns: minmax(0, 1fr) 360px;
}

.builder-grid.hide-properties {
    grid-template-columns: 320px minmax(0, 1fr);
}

.builder-grid.hide-palette.hide-properties,
.builder-grid.device-layout-tablet.hide-palette.hide-properties,
.builder-grid.device-layout-mobile.hide-palette.hide-properties {
    grid-template-columns: minmax(0, 1fr);
}



/* Responsive header and toolbar overrides */
.hero-header {
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
}

    .hero-header h1,
    .hero-header h2 {
        font-size: clamp(24px, 4vw, 26px);
        line-height: 1.1;
    }

    .hero-header > span {
        margin-right: 0;
    }

.feature-pills {
    flex: 1 1 100%;
    justify-content: flex-start;
}

    .hero-actions {
        justify-content: flex-start;
    }

    .feature-pills button {
        white-space: nowrap;
    }

.toolbar {
    height: auto;
    min-height: 74px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    margin: 10px 12px 0;
    padding: 12px 18px;
}

.brand {
    min-width: 0;
    gap: 10px;
}

    .brand strong {
        display: none;
    }

.toolbar-actions,
.device-tabs {
    min-width: 0;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

    .toolbar-actions > button {
        order: 999;
    }

    .toolbar-actions > button:nth-of-type(1) {
        order: 10;
    }

    .toolbar-actions > button:nth-of-type(6) {
        order: 20;
    }

    .toolbar-actions > button:nth-of-type(2) {
        order: 30;
    }

    .toolbar-actions > button:nth-of-type(8) {
        order: 40;
    }

    .toolbar-actions > button:nth-of-type(7) {
        order: 50;
    }

    .toolbar-actions > button:nth-of-type(3) {
        order: 60;
    }

    .toolbar-actions > button:nth-of-type(4) {
        order: 70;
    }

    .toolbar-actions > button:nth-of-type(5) {
        order: 80;
    }

    .toolbar-actions > button:nth-of-type(10) {
        order: 90;
    }

    .toolbar-actions > button:nth-of-type(11) {
        order: 100;
    }

    .toolbar-actions button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 0.7rem 1rem;
        border: 1px solid #cfdced;
        border-radius: 0.62rem;
        background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
        color: #16345f;
        font-weight: 600;
        letter-spacing: 0.01em;
        white-space: nowrap;
        box-shadow: 0 2px 0 #c5d4e8, 0 8px 18px rgba(15, 23, 42, 0.08);
        transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
    }

    .toolbar-actions button:hover:not(:disabled) {
        border-color: #8eb6ef;
        background: linear-gradient(180deg, #ffffff 0%, #ecf4ff 100%);
        box-shadow: 0 2px 0 #b8cce6, 0 10px 20px rgba(37, 99, 235, 0.16);
        transform: translateY(-1px);
    }

    .toolbar-actions button:active:not(:disabled) {
        transform: translateY(2px);
        box-shadow: 0 1px 0 #c5d4e8, 0 3px 8px rgba(15, 23, 42, 0.1);
        background: linear-gradient(180deg, #ecf4ff 0%, #dfeeff 100%);
    }

    .toolbar-actions button:focus-visible {
        outline: 3px solid rgba(37, 99, 235, 0.28);
        outline-offset: 2px;
    }

    .toolbar-actions button.primary {
        border-color: #1e61db;
        background: linear-gradient(180deg, #2f83ff 0%, #1463df 100%);
        color: #ffffff;
        box-shadow: 0 2px 0 #0f4db0, 0 12px 20px rgba(20, 99, 223, 0.3);
    }

    .toolbar-actions button.primary:hover:not(:disabled) {
        border-color: #1858c7;
        background: linear-gradient(180deg, #4690ff 0%, #1a6ae8 100%);
        box-shadow: 0 2px 0 #0e4aa6, 0 14px 22px rgba(20, 99, 223, 0.35);
    }

    .toolbar-actions button.primary:active:not(:disabled) {
        box-shadow: 0 1px 0 #0f4db0, 0 4px 10px rgba(20, 99, 223, 0.28);
    }

    .toolbar-actions button.danger {
        border-color: #fca5a5;
        background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
        color: #b91c1c;
        box-shadow: 0 2px 0 #f5b8c1, 0 10px 18px rgba(239, 68, 68, 0.14);
    }

    .toolbar-actions button.danger:hover:not(:disabled) {
        border-color: #f87171;
        background: linear-gradient(180deg, #fff5f5 0%, #ffe2e2 100%);
        box-shadow: 0 2px 0 #f0a4af, 0 12px 20px rgba(239, 68, 68, 0.2);
    }

    .toolbar-actions button.danger:active:not(:disabled) {
        box-shadow: 0 1px 0 #f0a4af, 0 4px 10px rgba(239, 68, 68, 0.16);
    }

    .toolbar-actions button:disabled {
        opacity: 0.55;
        transform: none;
        box-shadow: 0 1px 0 #d7e2f0;
        cursor: not-allowed;
    }

    .toolbar-actions > button:nth-of-type(9),
    .toolbar-actions > button:nth-of-type(12) {
        display: none;
    }

.device-tabs {
    flex-wrap: nowrap;
}

    .device-tabs button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 44px;
        white-space: nowrap;
    }

.status-strip {
    position: relative;
    z-index: 1;
}

/* Tablet and smaller */
@media (max-width: 1100px) {
    .hero-header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 14px;
    }

        .hero-header > span,
        .feature-pills {
            grid-column: 1 / -1;
        }

    .feature-pills {
        display: flex;
    }

    .toolbar {
        top: 10px;
        margin: 10px 10px 0;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .toolbar-actions,
    .device-tabs {
        width: 100%;
    }

    .toolbar-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    }

        .toolbar-actions button {
            width: 100%;
        }

    .device-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

        .device-tabs button {
            border-right: 1px solid var(--bpm-border);
        }

            .device-tabs button:last-child {
                border-right: 0;
            }

}

/* Tool bar for BPM Workspace */
.toolbar button.workspace-return {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #9db9f4;
    background: linear-gradient(135deg, #eef5ff, #dbeafe);
    color: #0d5bd7;
    box-shadow: 0 8px 18px rgba(13, 91, 215, .14);
}

    .toolbar button.workspace-return:hover {
        background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        border-color: #6ea2f2;
        color: #0847a6;
        transform: translateY(-1px);
    }

    .toolbar button.workspace-return:focus-visible {
        outline: 3px solid rgba(13, 91, 215, .25);
        outline-offset: 2px;
    }

    .toolbar button.workspace-return svg {
        display: block;
    }

/* Phone layout */
@media (max-width: 640px) {
    .bpm-shell {
        padding: 12px;
    }

    .hero-header {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .logo-cube {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 28px;
    }

    .hero-header h1 {
        font-size: clamp(28px, 8vw, 36px);
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .feature-pills {
        display: grid;
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: 10px;
        width: 100%;
    }

    .feature-pills-primary,
    .feature-pills-secondary {
        display: grid;
    }

        .feature-pills > button {
            width: 100%;
            min-width: 0;
            padding: 10px 12px;
            white-space: normal;
        }

    .feature-pills-primary,
    .feature-pills-secondary {
        justify-content: stretch;
    }

    .feature-pills-secondary {
        grid-template-columns: minmax(0, 1fr) 52px 52px;
    }

    .workspace-shortcut {
        justify-content: center;
    }

    .builder-window {
        border-radius: 10px;
    }

    .toolbar {
        top: 8px;
        margin: 8px 8px 0;
        padding: 10px;
    }

    .brand {
        width: 100%;
    }

    .hamburger {
        flex: 0 0 auto;
    }

    .toolbar-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .toolbar button {
        padding: 10px 12px;
        font-size: 14px;
    }

    .device-tabs button {
        padding: 10px 8px;
        font-size: 13px;
    }

    .toolbar-icons {
        justify-content: space-between;
    }
}

/* Very narrow phones */
@media (max-width: 420px) {
    .hero-header {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .feature-pills,
    .toolbar-actions {
        grid-template-columns: 1fr;
    }

    .device-tabs {
        grid-template-columns: 1fr;
        overflow: hidden;
    }

        .device-tabs button {
            border-right: 0;
            border-bottom: 1px solid var(--bpm-border);
        }

            .device-tabs button:last-child {
                border-bottom: 0;
            }
}

/* Theme and Layout Panel */
.themeable-pill {
    border-color: rgba(37, 99, 235, .28) !important;
}

    .themeable-pill.active {
        background: var(--bpm-primary) !important;
        color: #fff !important;
        border-color: var(--bpm-primary) !important;
    }

.theme-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .28);
    z-index: 30;
}

.theme-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 31;
    width: min(460px, 100vw);
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    border-left: 1px solid var(--bpm-border);
    box-shadow: -24px 0 60px rgba(15, 23, 42, .18);
    padding: 22px;
}

.theme-drawer-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--bpm-border);
    padding-bottom: 18px;
    margin-bottom: 18px;
}

    .theme-drawer-header h3 {
        margin: 0 0 6px;
    }

    .theme-drawer-header p {
        margin: 0;
        color: var(--bpm-muted);
        line-height: 1.5;
    }

.theme-eyebrow {
    margin: 0 0 4px !important;
    color: var(--bpm-primary) !important;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.theme-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--bpm-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.theme-panel-section {
    margin-bottom: 20px;
}

.theme-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}


.bpm-select {
    width: 100%;
    border: 1px solid var(--bpm-border);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fff;
    color: #1e293b;
    font-weight: 500;
}

    .bpm-select:focus {
        outline: 0;
        border-color: var(--bpm-focus);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--bpm-focus) 20%, transparent);
    }

.theme-swatches {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.theme-swatch {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 2px solid #fff;
    background: var(--swatch-color);
    box-shadow: 0 0 0 1px var(--bpm-border);
    cursor: pointer;
}

    .theme-swatch.active {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--swatch-color) 30%, transparent);
    }

.layout-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.layout-option {
    border: 1px solid var(--bpm-border);
    border-radius: 12px;
    background: #fff;
    padding: 12px 10px;
    cursor: pointer;
    text-align: center;
}

    .layout-option.active {
        border-color: var(--bpm-primary);
        background: color-mix(in srgb, var(--bpm-primary) 9%, #fff);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--bpm-primary) 14%, transparent);
    }

.layout-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    height: 34px;
    margin-bottom: 8px;
}

    .layout-preview i {
        display: block;
        border-radius: 5px;
        background: color-mix(in srgb, var(--bpm-primary) 18%, #e2e8f0);
    }

    .layout-preview.compact {
        gap: 2px;
    }

    .layout-preview.spacious {
        gap: 7px;
    }

.theme-device-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.theme-device {
    border: 1px solid var(--bpm-border);
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
}

    .theme-device.active {
        color: var(--bpm-primary);
        border-color: var(--bpm-primary);
        background: color-mix(in srgb, var(--bpm-primary) 8%, #fff);
    }

.theme-workflow {
    background: var(--bpm-bg);
    border: 1px solid var(--bpm-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 20px;
}

    .theme-workflow ol {
        margin: 10px 0 0;
        padding-left: 20px;
        color: #475569;
        line-height: 1.6;
    }

.theme-panel-actions {
    position: sticky;
    bottom: -22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: #fff;
    border-top: 1px solid var(--bpm-border);
    padding: 14px 0 0;
}

.theme-primary,
.theme-secondary {
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 800;
}

.theme-primary {
    border: 1px solid var(--bpm-primary);
    background: var(--bpm-primary);
    color: #fff;
}

.theme-secondary {
    border: 1px solid var(--bpm-border);
    background: #fff;
    color: #1e293b;
}

/* Theme runtime variables */
.bpm-shell {
    background: var(--bpm-bg);
}

/* Layout density */
.bpm-density-compact .bpm-grid {
    gap: 8px;
    padding: 10px;
}

.bpm-density-compact input,
.bpm-density-compact select,
.bpm-density-compact textarea {
    padding: 7px 9px;
}

.bpm-density-spacious .bpm-grid {
    gap: 18px;
    padding: 20px;
}

.bpm-density-spacious input,
.bpm-density-spacious select,
.bpm-density-spacious textarea {
    padding: 13px 15px;
}

/* Section styles */
.bpm-section-style-plain .section-card {
    border-color: transparent;
    box-shadow: none;
}

.bpm-section-style-coloredheader .section-header {
    background: color-mix(in srgb, var(--bpm-primary) 14%, #fff) !important;
    color: #0f172a;
}

.bpm-section-style-card .section-card {
    background: var(--bpm-card-bg);
    border-color: var(--bpm-border);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.bpm-section-style-bordered .section-card {
    border: 2px solid var(--bpm-primary);
}

/* Button styles */
.button-row {
    grid-column: span 12;
    display: flex;
    flex-wrap: wrap;
    gap: var(--button-row-gap, 6px);
    align-items: center;
    min-width: 0;
}

.button-row-left {
    justify-content: flex-start;
}

.button-row-center {
    justify-content: center;
}

.button-row-right {
    justify-content: flex-end;
}

.button-field-shell {
    flex: 0 0 auto;
    min-width: 0;
}

.button-row .button-field-shell {
    padding: 0.25rem !important;
}

.button-align {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.button-align-left {
    justify-content: flex-start;
}

.button-align-center {
    justify-content: center;
}

.button-align-right {
    justify-content: flex-end;
}

.button-align-stretch .form-action-button {
    width: 100%;
}

.button-size-small {
    min-height: 34px;
    padding: 8px 13px;
    font-size: var(--button-font-size, 0.82rem);
}

.button-size-medium {
    min-height: 40px;
    padding: 10px 16px;
    font-size: var(--button-font-size, 0.9rem);
}

.button-size-large {
    min-height: 46px;
    padding: 12px 20px;
    font-size: var(--button-font-size, 0.98rem);
}

.button-visual-standard {
    background: var(--button-bg, var(--bpm-primary));
    color: var(--button-color, #fff);
    border-color: var(--button-border, transparent);
    box-shadow: none;
}

.button-visual-embossed {
    background: linear-gradient(180deg, color-mix(in srgb, var(--button-bg, var(--bpm-primary)) 78%, #ffffff), var(--button-bg, var(--bpm-primary)));
    color: var(--button-color, #fff);
    border-color: color-mix(in srgb, var(--button-border, var(--button-bg, var(--bpm-primary))) 84%, #0f172a);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(15, 23, 42, 0.16), 0 8px 16px rgba(15, 23, 42, 0.12);
}

.button-visual-light-shadow {
    background: var(--button-bg, var(--bpm-primary));
    color: var(--button-color, #fff);
    border-color: var(--button-border, transparent);
    box-shadow: 0 10px 22px color-mix(in srgb, var(--button-bg, var(--bpm-primary)) 28%, transparent), 0 2px 6px rgba(15, 23, 42, 0.08);
}

.button-visual-dark-shadow {
    background: var(--button-bg, var(--bpm-primary));
    color: var(--button-color, #fff);
    border-color: var(--button-border, transparent);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.28), 0 7px 14px color-mix(in srgb, var(--button-bg, var(--bpm-primary)) 32%, transparent);
}

.button-visual-embossed:hover,
.button-visual-light-shadow:hover,
.button-visual-dark-shadow:hover {
    transform: translateY(-1px);
}

.bpm-button-style-solid .form-action-button {
    background: var(--button-bg, var(--bpm-primary));
    color: var(--button-color, #fff);
    border-color: var(--button-border, transparent);
}

.bpm-button-style-outline .form-action-button {
    background: var(--button-bg, #fff);
    color: var(--button-color, var(--bpm-primary));
    border: 1px solid var(--button-border, var(--bpm-primary));
}

.bpm-button-style-soft .form-action-button {
    background: var(--button-bg, color-mix(in srgb, var(--bpm-primary) 14%, #fff));
    color: var(--button-color, var(--bpm-primary));
    border-color: var(--button-border, color-mix(in srgb, var(--bpm-primary) 24%, #fff));
}

/* Field styles */
.bpm-field-style-filled input,
.bpm-field-style-filled select,
.bpm-field-style-filled textarea {
    background: color-mix(in srgb, var(--bpm-primary) 5%, #fff);
    border-color: transparent;
}

.bpm-field-style-underline input,
.bpm-field-style-underline select,
.bpm-field-style-underline textarea {
    border-width: 0 0 2px;
    border-radius: 0;
    background: transparent;
}

    .bpm-field-style-outlined input:focus,
    .bpm-field-style-outlined select:focus,
    .bpm-field-style-outlined textarea:focus,
    .bpm-field-style-filled input:focus,
    .bpm-field-style-filled select:focus,
    .bpm-field-style-filled textarea:focus,
    .bpm-field-style-underline input:focus,
    .bpm-field-style-underline select:focus,
    .bpm-field-style-underline textarea:focus {
        outline: 0;
        border-color: var(--bpm-focus);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--bpm-focus) 16%, transparent);
    }

/* Grid styles */
.bpm-grid-style-compact .designer-grid th,
.bpm-grid-style-compact .designer-grid td {
    padding: 6px;
}

.bpm-grid-style-striped .designer-grid tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--bpm-primary) 5%, #fff);
}

.bpm-grid-style-bordered .designer-grid th,
.bpm-grid-style-bordered .designer-grid td {
    border-color: var(--bpm-border);
}

@media (max-width: 640px) {
    .theme-drawer {
        width: 100vw;
    }

    .theme-panel-grid,
    .layout-options,
    .theme-device-buttons,
    .theme-panel-actions {
        grid-template-columns: 1fr;
    }
}



/* Form-only theme scope.
   This affects only the designed form and preview form, not the BPM Workspace Builder shell. */

.bpm-form-theme {
    background: var(--bpm-bg);
    border-color: var(--bpm-border);
}

    .bpm-form-theme .form-small-icon,
    .bpm-form-theme .field-type {
        color: var(--bpm-primary);
    }

    .bpm-form-theme .section-card {
        border-color: var(--bpm-border);
        background: var(--bpm-card-bg);
    }

    .bpm-form-theme .section-header {
        border-bottom-color: var(--bpm-border);
    }

    .bpm-form-theme.bpm-theme-corporateblue .section-header {
        background: #dbeafe !important;
    }

    .bpm-form-theme.bpm-theme-green .section-header {
        background: #dcfce7 !important;
    }

    .bpm-form-theme.bpm-theme-purple .section-header {
        background: #ede9fe !important;
    }

    .bpm-form-theme.bpm-theme-orange .section-header {
        background: #ffedd5 !important;
    }

    .bpm-form-theme.bpm-theme-grey .section-header {
        background: #f1f5f9 !important;
    }

    .bpm-form-theme .field-shell.selected {
        border-color: var(--bpm-primary);
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--bpm-primary) 20%, transparent);
    }

    .bpm-form-theme input:focus,
    .bpm-form-theme select:focus,
    .bpm-form-theme textarea:focus {
        outline: 0;
        border-color: var(--bpm-primary);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--bpm-primary) 18%, transparent);
    }

    .bpm-form-theme .designer-grid th {
        background: color-mix(in srgb, var(--bpm-primary) 10%, #fff);
        color: #1e293b;
    }

    .bpm-form-theme .status-badge {
        background: color-mix(in srgb, var(--bpm-primary) 14%, #fff);
        color: var(--bpm-primary);
    }

    .bpm-form-theme .form-action-button {
        background: var(--button-bg, var(--bpm-primary));
        border-color: var(--button-border, var(--bpm-primary));
        color: var(--button-color, #fff);
    }

    /* Compact layout only inside the form */
    .bpm-form-theme.bpm-density-compact .section-header {
        height: 30px;
        font-size: 12px;
    }

    .bpm-form-theme.bpm-density-compact .bpm-grid {
        gap: 6px;
        padding: 8px;
    }

    .bpm-form-theme.bpm-density-compact .field-shell,
    .bpm-form-theme.bpm-density-compact .runtime-field {
        padding: 3px;
    }

    .bpm-form-theme.bpm-density-compact label {
        margin-bottom: 4px;
        font-size: 11px;
    }

    .bpm-form-theme.bpm-density-compact input,
    .bpm-form-theme.bpm-density-compact select,
    .bpm-form-theme.bpm-density-compact textarea {
        padding: 6px 8px;
        min-height: 32px;
        font-size: 12px;
    }

    /* Spacious layout only inside the form */
    .bpm-form-theme.bpm-density-spacious .section-header {
        height: 46px;
        font-size: 15px;
    }

    .bpm-form-theme.bpm-density-spacious .bpm-grid {
        gap: 20px;
        padding: 22px;
    }

    .bpm-form-theme.bpm-density-spacious .field-shell,
    .bpm-form-theme.bpm-density-spacious .runtime-field {
        padding: 10px;
    }

    .bpm-form-theme.bpm-density-spacious input,
    .bpm-form-theme.bpm-density-spacious select,
    .bpm-form-theme.bpm-density-spacious textarea {
        padding: 14px 16px;
        min-height: 48px;
    }

    /* Section style options only inside the form */
    .bpm-form-theme.bpm-section-style-card .section-card {
        border-radius: var(--bpm-form-radius, var(--bpm-project-radius, 14px));
        box-shadow: var(--bpm-form-shadow, var(--bpm-project-shadow, 0 4px 16px rgba(15, 23, 42, .08)));
    }

    .bpm-form-theme.bpm-section-style-bordered .section-card {
        border: 2px solid var(--bpm-primary);
        border-radius: var(--bpm-form-radius, var(--bpm-project-radius, 14px));
    }

    .bpm-form-theme.bpm-section-style-plain .section-card {
        border-color: transparent;
        box-shadow: none;
    }

    .bpm-form-theme.bpm-section-style-coloredheader .section-header {
        background: color-mix(in srgb, var(--bpm-primary) 18%, #fff) !important;
    }

    /* Button style only inside the form */
    .bpm-form-theme.bpm-button-style-solid .form-action-button {
        background: var(--button-bg, var(--bpm-primary));
        color: var(--button-color, #fff);
        border: 1px solid var(--button-border, var(--bpm-primary));
    }

    .bpm-form-theme.bpm-button-style-outline .form-action-button {
        background: var(--button-bg, #fff);
        color: var(--button-color, var(--bpm-primary));
        border: 1px solid var(--button-border, var(--bpm-primary));
    }

    .bpm-form-theme.bpm-button-style-soft .form-action-button {
        background: var(--button-bg, color-mix(in srgb, var(--bpm-primary) 14%, #fff));
        color: var(--button-color, var(--bpm-primary));
        border: 1px solid var(--button-border, color-mix(in srgb, var(--bpm-primary) 24%, #fff));
    }

    /* Field style only inside the form */
    .bpm-form-theme.bpm-field-style-filled input,
    .bpm-form-theme.bpm-field-style-filled select,
    .bpm-form-theme.bpm-field-style-filled textarea {
        background: color-mix(in srgb, var(--bpm-primary) 5%, #fff);
        border-color: transparent;
    }

    .bpm-form-theme.bpm-field-style-underline input,
    .bpm-form-theme.bpm-field-style-underline select,
    .bpm-form-theme.bpm-field-style-underline textarea {
        border-width: 0 0 2px;
        border-radius: 0;
        background: transparent;
    }

    /* Grid style only inside the form */
    .bpm-form-theme.bpm-grid-style-compact .designer-grid th,
    .bpm-form-theme.bpm-grid-style-compact .designer-grid td {
        padding: 6px;
    }

    .bpm-form-theme.bpm-grid-style-striped .designer-grid tbody tr:nth-child(even) {
        background: color-mix(in srgb, var(--bpm-primary) 6%, #fff);
    }

    .bpm-form-theme.bpm-grid-style-bordered .designer-grid th,
    .bpm-form-theme.bpm-grid-style-bordered .designer-grid td {
        border-color: var(--bpm-border);
    }

/* Section accent override.
   This allows the section Accent property to override the selected form theme. */

.bpm-form-theme .section-card.accent-blue > .section-header,
.section-card.accent-blue > .section-header {
    background: #eaf4ff !important;
    border-left: 4px solid #2563eb;
}

.bpm-form-theme .section-card.accent-green > .section-header,
.section-card.accent-green > .section-header {
    background: #e8f8ed !important;
    border-left: 4px solid #16a34a;
}

.bpm-form-theme .section-card.accent-purple > .section-header,
.section-card.accent-purple > .section-header {
    background: #f1ecff !important;
    border-left: 4px solid #7c3aed;
}

.bpm-form-theme .section-card.accent-yellow > .section-header,
.section-card.accent-yellow > .section-header {
    background: #fff5d8 !important;
    border-left: 4px solid #f59e0b;
}

.bpm-form-theme .section-card.accent-orange > .section-header,
.section-card.accent-orange > .section-header {
    background: #ffedd5 !important;
    border-left: 4px solid #f97316;
}

.bpm-form-theme .section-card.accent-grey > .section-header,
.section-card.accent-grey > .section-header {
    background: #f1f5f9 !important;
    border-left: 4px solid #64748b;
}

.bpm-form-theme .section-card.accent-green .section-drag,
.bpm-form-theme .section-card.accent-green .section-actions button,
.bpm-form-theme .section-card.accent-green .section-collapse-button {
    color: #166534;
}

.bpm-form-theme .section-card.accent-purple .section-drag,
.bpm-form-theme .section-card.accent-purple .section-actions button,
.bpm-form-theme .section-card.accent-purple .section-collapse-button {
    color: #5b21b6;
}

.bpm-form-theme .section-card.accent-orange .section-drag,
.bpm-form-theme .section-card.accent-orange .section-actions button,
.bpm-form-theme .section-card.accent-orange .section-collapse-button {
    color: #c2410c;
}

.bpm-form-theme .section-card.accent-blue .section-drag,
.bpm-form-theme .section-card.accent-blue .section-actions button,
.bpm-form-theme .section-card.accent-blue .section-collapse-button {
    color: #1d4ed8;
}

.bpm-form-theme .section-card.accent-yellow .section-drag,
.bpm-form-theme .section-card.accent-yellow .section-actions button,
.bpm-form-theme .section-card.accent-yellow .section-collapse-button {
    color: #92400e;
}

.bpm-form-theme .section-card.accent-grey .section-drag,
.bpm-form-theme .section-card.accent-grey .section-actions button,
.bpm-form-theme .section-card.accent-grey .section-collapse-button {
    color: #475569;
}

/* Preview and Publish centering the canvas*/

.canvas-device-stage {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    padding: var(--runtime-form-stage-padding, 1rem);
}

.runtime-form {
    width: 100%;
    transition: max-width 180ms ease, min-height 180ms ease, border-radius 180ms ease, box-shadow 180ms ease;
}

    .runtime-form.device-desktop {
        width: 100%;
        max-width: var(--runtime-form-desktop-max-width, 1180px);
    }

    .runtime-form.device-tablet {
        width: 768px;
        max-width: 768px;
        min-width: 768px;
        min-height: 1024px;
        border-radius: 22px;
        box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    }

    .runtime-form.device-mobile {
        width: 390px;
        max-width: 390px;
        min-width: 390px;
        min-height: 844px;
        padding: 0.75rem;
        border-radius: 18px;
        box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
    }

    .runtime-form.device-tablet .span-6,
    .runtime-form.device-tablet .span-4,
    .runtime-form.device-tablet .span-3 {
        grid-column: span 6;
    }

    .runtime-form.device-mobile .runtime-field {
        grid-column: span 12;
        width: 100%;
        min-width: 0;
    }

    .runtime-form.device-mobile .section-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: .45rem;
        height: auto;
        min-height: 34px;
        padding: .45rem .65rem
    }

        .runtime-form.device-mobile .section-header strong {
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap
        }

    .runtime-form.device-mobile .section-collapse-button {
        width: 24px;
        height: 24px;
        margin-left: 0
    }

    .runtime-form.device-mobile .bpm-grid {
        gap: .75rem;
        padding: .75rem
    }

    .design-canvas.device-mobile .button-row,
    .runtime-form.device-mobile .button-row {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: .75rem;
    }

    .design-canvas.device-mobile .button-field-shell,
    .runtime-form.device-mobile .button-field-shell {
        width: auto;
        flex: 0 0 auto !important;
        max-width: 100%;
    }

    .design-canvas.device-mobile .button-field-shell .button-align,
    .runtime-form.device-mobile .button-field-shell .button-align {
        width: auto;
    }

    .runtime-form.device-mobile input,
    .runtime-form.device-mobile select,
    .runtime-form.device-mobile textarea {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

/* Project Settings typography for the Form Builder shell.
   Keep the builder's visual hierarchy clear without the heavy 700–900 weights
   used by the original builder chrome. */
.bpm-shell {
    --bpm-ui-heading-color: #17365d;
    --bpm-ui-label-color: var(--workspace-label-color);
    --bpm-ui-weight: var(--workspace-label-weight);
    --bpm-ui-regular-weight: 400;
}

.bpm-shell .hero-header h2 {
    color: var(--bpm-ui-heading-color);
    font-size: 1.55rem;
    font-weight: var(--bpm-ui-weight) !important;
    letter-spacing: -0.015em;
}

.bpm-shell .hero-header > span {
    color: #64748b;
    font-size: 0.84rem;
    font-weight: var(--bpm-ui-regular-weight);
}

.bpm-shell .hero-header strong,
.bpm-shell .builder-context-copy span,
.bpm-shell .builder-context-forms-header span,
.bpm-shell .component-group-title,
.bpm-shell .theme-eyebrow {
    color: var(--bpm-ui-label-color) !important;
    font-weight: var(--bpm-ui-weight) !important;
}

.bpm-shell h3,
.bpm-shell h4,
.bpm-shell strong,
.bpm-shell b,
.bpm-shell label,
.bpm-shell .feature-pills > button,
.bpm-shell .feature-pills > span,
.bpm-shell .toolbar button,
.bpm-shell .toolbar-actions button,
.bpm-shell .device-tabs button,
.bpm-shell .builder-context-copy strong,
.bpm-shell .builder-context-forms-header strong,
.bpm-shell .builder-context-collapsed-summary strong,
.bpm-shell .form-option-body strong,
.bpm-shell .component-group-title strong,
.bpm-shell .component-copy strong,
.bpm-shell .draft-badge,
.bpm-shell .form-numbering-preview,
.bpm-shell .section-actions button,
.bpm-shell .section-drag,
.bpm-shell .grid-column-title,
.bpm-shell .project-module-dock-summary strong,
.bpm-shell .project-module-copy strong,
.bpm-shell .project-module-dock-status {
    font-weight: var(--bpm-ui-weight) !important;
}

.bpm-shell .panel > h3,
.bpm-shell .canvas-title-row h3 {
    font-size: 1rem !important;
    font-weight: var(--bpm-ui-weight) !important;
}

.bpm-shell .component-group-title {
    font-size: 0.64rem !important;
}

.bpm-shell .component-copy strong {
    font-size: 0.86rem !important;
}

.bpm-shell .component-copy small {
    font-size: 0.68rem !important;
}

.bpm-shell .builder-context-copy small,
.bpm-shell .form-option-body small,
.bpm-shell .form-option-meta small,
.bpm-shell .component-copy small,
.bpm-shell .project-module-dock-summary small,
.bpm-shell .project-module-copy small,
.bpm-shell .canvas-title-row small,
.bpm-shell .form-header p,
.bpm-shell .field-type,
.bpm-shell .muted-text {
    font-weight: var(--bpm-ui-regular-weight) !important;
}

.bpm-shell .builder-context-copy span,
.bpm-shell .builder-context-forms-header span,
.bpm-shell .properties .property-row label,
.bpm-shell .properties .property-group h4,
.bpm-shell .field-label,
.bpm-shell .field-toolbar label,
.bpm-shell .runtime-field label {
    color: var(--bpm-ui-label-color) !important;
}

.bpm-shell .editable-form-title,
.bpm-shell .section-header > strong,
.bpm-shell .field-label,
.bpm-shell .field-toolbar label,
.bpm-shell .runtime-field label,
.bpm-shell .required,
.bpm-shell .grid-column-title {
    font-weight: var(--bpm-ui-weight) !important;
}

.bpm-shell .field-label,
.bpm-shell .field-toolbar label,
.bpm-shell .runtime-field label {
    font-size: 0.82rem !important;
}

.bpm-shell .section-header > strong,
.bpm-shell .grid-column-title {
    font-size: 0.88rem !important;
}

.bpm-shell .properties .panel-title h3 {
    color: var(--bpm-ui-heading-color);
    font-size: 1rem;
    font-weight: var(--bpm-ui-weight) !important;
}

.bpm-shell .properties .property-group h4 {
    color: var(--bpm-ui-heading-color) !important;
    font-size: 0.78rem;
}

.bpm-shell .properties .property-subtitle {
    font-weight: var(--bpm-ui-weight) !important;
    text-shadow: none;
}

.bpm-shell .properties .property-row label {
    font-size: 0.72rem;
    font-weight: var(--bpm-ui-weight) !important;
}

.bpm-shell .properties .property-row input,
.bpm-shell .properties .property-row select,
.bpm-shell .properties .property-row textarea,
.bpm-shell .properties .property-actions button,
.bpm-shell .properties button,
.bpm-shell .properties summary {
    font-weight: var(--bpm-ui-regular-weight) !important;
}

/* Builder chrome typography must not override form and field typography. */
.bpm-shell .bpm-form-theme .field-label,
.bpm-shell .bpm-form-theme .runtime-field > label {
    color: var(--field-label-color, var(--bpm-text)) !important;
    font-size: var(--field-label-size, var(--bpm-form-font-size, var(--bpm-project-font-size))) !important;
    font-weight: var(--field-label-weight, var(--bpm-form-font-weight, var(--bpm-project-font-weight))) !important;
}
.bpm-shell .bpm-form-theme .section-header > strong {
    font-weight: var(--bpm-form-font-weight, var(--bpm-project-font-weight)) !important;
}

.bpm-shell .properties .property-actions button,
.bpm-shell .properties summary strong {
    font-weight: var(--bpm-ui-weight) !important;
}

.bpm-shell .project-module-dock-summary span {
    font-weight: var(--bpm-ui-weight) !important;
}

.bpm-shell .project-module-dock-summary small,
.bpm-shell .project-module-copy small {
    font-weight: var(--bpm-ui-regular-weight) !important;
}

/* Reusable Mobile & Devices actions aligned with Project Settings Azure UI. */
.mobile-action-button {
    --mobile-action-bg: linear-gradient(180deg, #2f8fff 0%, #1367e8 100%);
    --mobile-action-border: #0f5bd7;
    --mobile-action-color: #ffffff;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 2.4rem;
    box-sizing: border-box;
    border: 1px solid var(--mobile-action-border);
    border-radius: 0.7rem;
    padding: 0.6rem 0.9rem;
    background: var(--mobile-action-bg);
    color: var(--mobile-action-color);
    box-shadow: 0 0.7rem 1.5rem rgba(19, 103, 232, 0.28);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.mobile-action-button:hover:not(:disabled) {
    transform: translateY(-1px);
    --mobile-action-bg: linear-gradient(180deg, #4299ff 0%, #0f5bd7 100%);
    --mobile-action-border: #0b54cf;
    box-shadow: 0 0.95rem 1.7rem rgba(19, 103, 232, 0.34);
}

.mobile-action-button:active:not(:disabled) {
    transform: translateY(1px) scale(0.988);
    box-shadow: 0 0.35rem 0.9rem rgba(15, 23, 42, 0.18);
}

.mobile-action-button:focus-visible {
    outline: 2px solid #bfdbfe;
    outline-offset: 2px;
}

.mobile-action-button:disabled,
.mobile-action-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.58;
    box-shadow: none;
}

.mobile-action-button--secondary {
    --mobile-action-bg: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    --mobile-action-border: #cfe0f5;
    --mobile-action-color: #17365d;
    box-shadow: 0 0.45rem 1rem rgba(37, 99, 235, 0.08);
}

.mobile-action-button--secondary:hover:not(:disabled) {
    --mobile-action-bg: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
    --mobile-action-border: #9ec5f8;
    box-shadow: 0 0.75rem 1.35rem rgba(37, 99, 235, 0.12);
}

.mobile-action-button--text {
    --mobile-action-bg: transparent;
    --mobile-action-border: transparent;
    --mobile-action-color: var(--mobile-azure-label, #0078d4);
    min-height: 2.15rem;
    padding: 0.35rem 0.2rem;
    box-shadow: none;
}

.mobile-action-button--text:hover:not(:disabled) {
    background: #eff6ff;
    box-shadow: none;
}

.mobile-action-button--compact {
    min-height: 2.15rem;
    padding: 0.35rem 0.65rem;
}

.mobile-action-button--danger {
    --mobile-action-color: #b42318;
}

.mobile-button-style-outline .mobile-action-button--primary {
    --mobile-action-bg: #ffffff;
    --mobile-action-border: var(--mobile-azure-primary, #2563eb);
    --mobile-action-color: var(--mobile-azure-primary, #2563eb);
}

.mobile-button-style-outline .mobile-action-button--secondary {
    --mobile-action-bg: #f6faff;
}

.mobile-button-style-soft .mobile-action-button--primary {
    --mobile-action-bg: #eff6ff;
    --mobile-action-border: #bfdbfe;
    --mobile-action-color: var(--mobile-azure-primary, #2563eb);
}

.mobile-button-style-soft .mobile-action-button--secondary {
    --mobile-action-bg: #f6faff;
}

.date-picker-time-inputs { display:flex; align-items:center; gap:4px; }
.date-picker-time-inputs select { flex:1; min-width:0; width:auto; padding:6px 3px; }
.date-picker-clock-options { display:flex; flex-wrap:wrap; gap:12px; }
.date-picker-clock-options label { display:inline-flex; align-items:center; gap:6px; }
.date-picker-clock-options input[type=radio] { width:auto; margin:0; }
.date-picker-preview-input-shell:focus-within { outline:2px solid #2563eb; outline-offset:2px; border-radius:6px; }
