/*CSS for cell : SigmaCoach*/
.sigma-coach-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(5, 9, 20, 0.62);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif;
}

.sigma-coach-shell {
    width: min(96vw, 1680px);
    height: min(94vh, 980px);
    background: #f7f8fb;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 26px;
    box-shadow: 0 32px 90px rgba(0,0,0,0.34);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sigma-coach-header {
    min-height: 96px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #101827 0%, #202a44 52%, #7d3bbb 100%);
    color: white;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.sigma-coach-kicker {
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.76;
    margin-bottom: 6px;
}

.sigma-coach-title {
    font-size: clamp(22px, 2vw, 31px);
    font-weight: 800;
    line-height: 1.1;
}

.sigma-coach-subtitle {
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.86;
    max-width: 960px;
}

.sigma-coach-close {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 30px;
    line-height: 34px;
    cursor: pointer;
    display:flex;
    align-items: center;
    justify-content: center;
    
}

.sigma-coach-main {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(310px, 360px) 1fr;
    gap: 16px;
    padding: 16px;
}

.sigma-coach-side,
.sigma-coach-workbench {
    min-height: 0;
}

.sigma-coach-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sigma-card {
    background: white;
    border: 1px solid rgba(16, 24, 39, 0.08);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 12px 28px rgba(16, 24, 39, 0.07);
}

.sigma-card-title,
.sigma-panel-title {
    font-weight: 800;
    font-size: 14px;
    color: #111827;
    margin-bottom: 9px;
}

.sigma-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #4b5563;
    margin-bottom: 6px;
}

.sigma-label-space {
    margin-top: 12px;
}

.sigma-select,
.sigma-notes {
    width: 100%;
    border: 1px solid rgba(17, 24, 39, 0.15);
    border-radius: 14px;
    background: #fbfcff;
    padding: 10px 12px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.sigma-select:focus,
.sigma-notes:focus {
    border-color: #7d3bbb;
    box-shadow: 0 0 0 3px rgba(125, 59, 187, 0.12);
}

.sigma-node-preview {
    height: 160px;
    overflow: auto;
    white-space: pre-wrap;
    border: 1px solid rgba(17, 24, 39, 0.10);
    background: #f9fafb;
    border-radius: 14px;
    padding: 11px;
    color: #1f2937;
    font-size: 12.5px;
    line-height: 1.45;
}

.sigma-notes {
    height: 96px;
    resize: vertical;
}

.sigma-mini-grid {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 8px 10px;
    font-size: 12px;
}

.sigma-mini-grid span {
    color: #6b7280;
    font-weight: 800;
}

.sigma-mini-grid strong {
    color: #111827;
    font-weight: 650;
}

/* Magian transformation mode cards */
.sigma-mode-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.sigma-mode-card {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(17, 24, 39, 0.10);
    background: #ffffff;
    border-radius: 14px;
    padding: 11px 12px;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.sigma-mode-card strong {
    display: block;
    color: #111827;
    font-size: 13px;
    font-weight: 900;
}

.sigma-mode-card span {
    display: block;
    margin-top: 3px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
}

.sigma-mode-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(16, 24, 39, 0.08);
}

.sigma-mode-card-active {
    border-color: rgba(125, 59, 187, 0.52);
    background: linear-gradient(135deg, #ffffff 0%, #f8f5ff 100%);
    box-shadow: 0 0 0 3px rgba(125, 59, 187, 0.10);
}

.sigma-compiler-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 50%, #f8f5ff 100%);
}

.sigma-compiler-steps {
    display: grid;
    gap: 7px;
}

.sigma-compiler-steps span {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 800;
    color: #374151;
}

.sigma-compiler-steps span::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #7d3bbb;
    box-shadow: 0 0 0 4px rgba(125, 59, 187, 0.10);
}

.sigma-actions {
    display: grid;
    gap: 9px;
}

.sigma-primary,
.sigma-secondary,
.sigma-ghost,
.sigma-coach-toolbar-btn {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.sigma-primary {
    padding: 13px 16px;
    background: #feb300;
    color: #171717;
    box-shadow: 0 12px 24px rgba(254, 179, 0, 0.27);
}

.sigma-secondary {
    padding: 12px 16px;
    background: #7d3bbb;
    color: white;
}

.sigma-ghost {
    padding: 11px 16px;
    background: white;
    color: #111827;
    border: 1px solid rgba(17, 24, 39, 0.12);
}

.sigma-primary:disabled,
.sigma-secondary:disabled,
.sigma-ghost:disabled,
.sigma-reprocess-btn:disabled,
.sigma-reprocess-icon-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.sigma-status {
    min-height: 42px;
    border-radius: 14px;
    background: #eef2ff;
    color: #273469;
    font-size: 12.5px;
    padding: 10px 12px;
    line-height: 1.35;
}

.sigma-status-error {
    background: #fef2f2;
    color: #991b1b;
}

.sigma-coach-workbench {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Magian compiler intelligence panels */
.sigma-intelligence-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr;
    gap: 10px;
}

.sigma-insight-panel,
.sigma-quality-score-panel {
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 12px 28px rgba(16, 24, 39, 0.06);
    min-height: 92px;
}

.sigma-insight-title {
    font-size: 13px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 7px;
}

.sigma-insight-empty,
.sigma-quality-score-placeholder {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.45;
}

.sigma-diagnosis-summary {
    font-size: 12px;
    color: #374151;
    line-height: 1.4;
    margin-bottom: 8px;
}

.sigma-metric-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    font-size: 11px;
}

.sigma-metric-row span {
    color: #6b7280;
    font-weight: 700;
}

.sigma-metric-row strong {
    color: #111827;
    font-weight: 950;
}

.sigma-option-list {
    display: grid;
    gap: 6px;
}

.sigma-option-chip {
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 12px;
    padding: 8px;
    background: #f9fafb;
}

.sigma-option-chip-active {
    background: #f8f5ff;
    border-color: rgba(125, 59, 187, 0.38);
}

.sigma-option-chip strong {
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: #111827;
}

.sigma-option-chip span {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.35;
}

.sigma-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: white;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 16px;
    padding: 10px 12px;
}

.sigma-legend-item {
    font-size: 12px;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.sigma-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}

.sigma-dot-added { background: #16a34a; }
.sigma-dot-changed { background: #f59e0b; }
.sigma-dot-removed { background: #dc2626; }
.sigma-dot-control { background: #2563eb; }

.sigma-bpmn-stack {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}

.sigma-bpmn-panel {
    min-height: 220px;
    background: white;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 12px 28px rgba(16, 24, 39, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sigma-bpmn-canvas {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: 14px;
    background: #fcfcfd;
    overflow: hidden;
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.sigma-empty-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sigma-empty-state {
    color: #6b7280;
    font-weight: 700;
    text-align: center;
    max-width: 420px;
    line-height: 1.5;
}

.sigma-quality-score-panel {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    align-items: center;
}

.sigma-quality-score-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sigma-quality-score-circle {
    width: 88px;
    height: 88px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(#7d3bbb calc(var(--score) * 1%), #eef2ff 0);
}

.sigma-quality-score-inner {
    width: 62px;
    height: 62px;
    border-radius: 999px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 950;
    color: #111827;
}

.sigma-quality-score-detail strong {
    display: block;
    font-size: 13px;
    color: #111827;
}

.sigma-quality-score-detail span {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #6b7280;
}

.sigma-change-table-wrap {
    max-height: 230px;
    min-height: 120px;
    overflow: auto;
    background: white;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 12px 28px rgba(16, 24, 39, 0.06);
}

.sigma-changes-empty {
    color: #6b7280;
    font-size: 13px;
    padding: 10px 0;
}

.sigma-semantic-map-wrap {
    max-height: 230px;
    min-height: 120px;
    overflow: auto;
    background: white;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 12px 28px rgba(16, 24, 39, 0.06);
}

.sigma-semantic-map {
    display: grid;
    gap: 10px;
}

.sigma-semantic-card {
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 14px;
    background: #ffffff;
    padding: 11px 12px;
}

.sigma-semantic-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.sigma-semantic-card-title {
    font-weight: 900;
    color: #111827;
    font-size: 13px;
}

.sigma-semantic-card-treatment {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    background: #eef2ff;
    color: #3b2f78;
    white-space: nowrap;
}

.sigma-semantic-card p {
    margin: 7px 0 0 0;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.45;
}

.sigma-change-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.sigma-change-table th {
    text-align: left;
    color: #374151;
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 1;
}

.sigma-change-table th,
.sigma-change-table td {
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    padding: 8px;
    vertical-align: top;
}

.sigma-change-table small {
    color: #6b7280;
}

.sigma-pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    color: white;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.sigma-pill-added { background: #16a34a; }
.sigma-pill-changed { background: #f59e0b; color: #111827; }
.sigma-pill-removed { background: #dc2626; }
.sigma-pill-control { background: #2563eb; }

.sigma-coach-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 6px 12px;
    background: #111827;
    color: white;
    font-size: 12px;
    box-shadow: 0 7px 18px rgba(17, 24, 39, 0.18);
    user-select: none;
}

.sigma-coach-toolbar-btn:hover {
    transform: translateY(-1px);
}

/* bpmn-js marker overrides */
.sigma-change-added .djs-visual > :first-child,
.sigma-viewer-to-be .djs-element.sigma-change-added .djs-visual > :first-child {
    stroke: #16a34a !important;
    stroke-width: 5px !important;
}

.sigma-change-changed .djs-visual > :first-child,
.sigma-viewer-to-be .djs-element.sigma-change-changed .djs-visual > :first-child,
.sigma-viewer-as-is .djs-element.sigma-change-changed .djs-visual > :first-child {
    stroke: #f59e0b !important;
    stroke-width: 5px !important;
}

.sigma-change-removed .djs-visual > :first-child,
.sigma-viewer-as-is .djs-element.sigma-change-removed .djs-visual > :first-child {
    stroke: #dc2626 !important;
    stroke-width: 5px !important;
    stroke-dasharray: 8 5 !important;
}

.sigma-change-control .djs-visual > :first-child,
.sigma-viewer-to-be .djs-element.sigma-change-control .djs-visual > :first-child {
    stroke: #2563eb !important;
    stroke-width: 5px !important;
}

.sigma-busy::after {
    content: "";
    position: absolute;
}

@media (max-width: 980px) {
    .sigma-coach-main {
        grid-template-columns: 1fr;
        overflow: auto;
    }
    .sigma-coach-shell {
        height: 96vh;
    }
    .sigma-bpmn-stack {
        min-height: 760px;
    }
    .sigma-intelligence-grid {
    grid-template-columns: 1fr;
}

.sigma-quality-score-panel {
    grid-template-columns: 88px 1fr;
}
}

/* SigmaCoach Analyse Documentation upfront action + top-most modal fixes */
.sigma-analysis-top-btn {
    background: linear-gradient(135deg, #111827 0%, #3b2f78 55%, #7d3bbb 100%);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(61, 47, 120, 0.22);
}

.sigma-analysis-top-btn-ready {
    animation: sigmaAnalysePulse 1.4s ease-in-out 1;
}

@keyframes sigmaAnalysePulse {
    0% { transform: scale(1); box-shadow: 0 10px 22px rgba(61, 47, 120, 0.22); }
    50% { transform: scale(1.025); box-shadow: 0 14px 30px rgba(125, 59, 187, 0.34); }
    100% { transform: scale(1); box-shadow: 0 10px 22px rgba(61, 47, 120, 0.22); }
}

.sigma-deep-analysis-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff, #f6f8ff);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.sigma-deep-analysis-title {
    font-weight: 800;
    font-size: 15px;
    color: #172033;
}

.sigma-deep-analysis-subtitle {
    font-size: 12px;
    color: #5b6475;
    margin-top: 3px;
}

.sigma-deep-analysis-btn {
    min-width: 158px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 8px 18px rgba(17,24,39,0.22);
}

.sigma-deep-analysis-btn:hover {
    transform: translateY(-1px);
}

.sigma-deep-analysis-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sigma-ls-overlay {
    z-index: 2147483600 !important;
    isolation: isolate;
}

.sigma-ls-modal {
    position: relative;
    z-index: 2147483601 !important;
}

/* SigmaCoach large expanded BPMN / change-map workspace */
.sigma-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.sigma-panel-head .sigma-panel-title {
    margin-bottom: 0;
    min-width: 0;
}

.sigma-expand-icon-btn {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    font-size: 17px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.10);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.sigma-expand-icon-btn:hover {
    transform: translateY(-1px) scale(1.03);
    background: #f8f5ff;
    box-shadow: 0 12px 24px rgba(125, 59, 187, 0.20);
}

.sigma-expand-icon-btn:active {
    transform: translateY(0) scale(0.98);
}

.sigma-expand-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483500;
    background: rgba(5, 9, 20, 0.72);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    isolation: isolate;
}

.sigma-expand-modal {
    width: min(98vw, 1840px);
    height: min(96vh, 1080px);
    background: #f7f8fb;
    border: 1px solid rgba(255,255,255,0.72);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 34px 100px rgba(0,0,0,0.42);
}

.sigma-expand-header {
    flex: 0 0 auto;
    min-height: 86px;
    padding: 18px 22px;
    color: #ffffff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    background: linear-gradient(135deg, #101827 0%, #202a44 55%, #7d3bbb 100%);
}

.sigma-expand-title-wrap {
    min-width: 0;
}

.sigma-expand-kicker {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.76;
    font-weight: 800;
    margin-bottom: 5px;
}

.sigma-expand-title {
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.12;
    font-weight: 900;
}

.sigma-expand-subtitle {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.35;
    opacity: 0.86;
    max-width: 1080px;
}

.sigma-expand-close {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 30px;
    line-height: 34px;
    cursor: pointer;
}

.sigma-expand-toolbar {
    flex: 0 0 auto;
    min-height: 54px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    background: #ffffff;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.sigma-expand-tool-btn {
    border: none;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    cursor: pointer;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.18);
}

.sigma-expand-tool-btn:hover {
    transform: translateY(-1px);
}

.sigma-expand-map-counts {
    margin-right: auto;
    color: #374151;
    font-size: 13px;
    font-weight: 800;
}

.sigma-expand-body {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    padding: 14px;
    box-sizing: border-box;
}

.sigma-expand-body-bpmn {
    display: flex;
}

.sigma-expand-canvas {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.10);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.65);
}

.sigma-expand-body-change-map {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sigma-expand-change-summary {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
}

.sigma-expand-change-card {
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 10px 24px rgba(16, 24, 39, 0.05);
}

.sigma-expand-change-card span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sigma-expand-change-card strong {
    display: block;
    color: #111827;
    font-size: 26px;
    line-height: 1.1;
    margin-top: 5px;
}

.sigma-expand-change-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(16, 24, 39, 0.06);
}

.sigma-expand-change-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    font-size: 13px;
}

.sigma-expand-change-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f9fafb;
    color: #374151;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sigma-expand-change-table th,
.sigma-expand-change-table td {
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    padding: 12px;
    vertical-align: top;
    line-height: 1.45;
}

.sigma-expand-change-table small {
    color: #6b7280;
}

@media (max-width: 980px) {
    .sigma-expand-overlay {
        padding: 10px;
    }

    .sigma-expand-modal {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        border-radius: 18px;
    }

    .sigma-expand-header {
        min-height: auto;
        padding: 14px;
    }

    .sigma-expand-toolbar {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .sigma-expand-change-summary {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}


/* SigmaCoach process-specific storage + reprocess controls */
.sigma-storage-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.92);
}

.sigma-storage-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: 0 0 0 5px rgba(203,213,225,0.14);
}

.sigma-storage-badge-ready {
    background: rgba(16,185,129,0.18);
    color: #ecfdf5;
}

.sigma-storage-badge-ready::before {
    background: #10b981;
    box-shadow: 0 0 0 5px rgba(16,185,129,0.18);
}

.sigma-storage-badge-empty {
    background: rgba(255,255,255,0.12);
}

.sigma-reprocess-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f5ff 100%);
    color: #3b2f78;
    border: 1px solid rgba(125, 59, 187, 0.20);
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0.01em;
    box-shadow: 0 9px 20px rgba(61, 47, 120, 0.11);
}

.sigma-reprocess-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 13px 26px rgba(125, 59, 187, 0.20);
}

.sigma-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.sigma-reprocess-icon-btn {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(125, 59, 187, 0.22);
    border-radius: 999px;
    background: #ffffff;
    color: #3b2f78;
    font-size: 18px;
    line-height: 1;
    font-weight: 950;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(61, 47, 120, 0.12);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.sigma-reprocess-icon-btn:not(:disabled):hover {
    transform: translateY(-1px) rotate(-18deg) scale(1.04);
    background: #f8f5ff;
    box-shadow: 0 12px 24px rgba(125, 59, 187, 0.22);
}

.sigma-reprocess-ready {
    animation: sigmaReprocessReadyPulse 1.2s ease-in-out 1;
}

@keyframes sigmaReprocessReadyPulse {
    0% { box-shadow: 0 8px 18px rgba(61, 47, 120, 0.12); }
    50% { box-shadow: 0 0 0 5px rgba(125, 59, 187, 0.12), 0 14px 30px rgba(125, 59, 187, 0.22); }
    100% { box-shadow: 0 8px 18px rgba(61, 47, 120, 0.12); }
}

@media (max-width: 980px) {
    .sigma-storage-badge {
        max-width: 100%;
        white-space: normal;
        border-radius: 14px;
    }

    .sigma-panel-actions {
        gap: 5px;
    }

    .sigma-reprocess-icon-btn,
    .sigma-expand-icon-btn {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }
}

/* -------------------------------------------------------------------------
   SigmaCoach tabbed redesign patch
   Purpose: keep action buttons always reachable, prevent BPMN/change/semantic
   panels from shrinking, and make AS-IS / TO-BE / Revisions / Coverage easy.
------------------------------------------------------------------------- */
.sigma-coach-shell-tabs {
    width: min(98vw, 1760px);
    height: min(96vh, 1040px);
}

.sigma-coach-header-compact {
    min-height: 82px;
    padding: 16px 24px;
}

.sigma-coach-main-tabs {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
}

.sigma-coach-side-tabs {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sigma-side-scroll {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.sigma-side-scroll::-webkit-scrollbar,
.sigma-tab-panel::-webkit-scrollbar,
.sigma-change-table-wrap::-webkit-scrollbar,
.sigma-semantic-map-wrap::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.sigma-side-scroll::-webkit-scrollbar-thumb,
.sigma-tab-panel::-webkit-scrollbar-thumb,
.sigma-change-table-wrap::-webkit-scrollbar-thumb,
.sigma-semantic-map-wrap::-webkit-scrollbar-thumb {
    background: rgba(125, 59, 187, 0.32);
    border-radius: 999px;
}

.sigma-actions-sticky {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding-top: 10px;
    background: linear-gradient(180deg, rgba(247,248,251,0.68), #f7f8fb 28%);
    border-top: 1px solid rgba(17, 24, 39, 0.06);
}

.sigma-actions-sticky .sigma-status {
    margin-top: 2px;
}

.sigma-node-preview {
    height: 128px;
}

.sigma-notes {
    height: 74px;
    min-height: 70px;
}

.sigma-mode-card {
    padding: 9px 11px;
}

.sigma-compiler-steps {
    gap: 5px;
}

.sigma-coach-workbench-tabs {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.sigma-workbench-shell {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sigma-tabbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 10px 24px rgba(16, 24, 39, 0.05);
    overflow-x: auto;
}

.sigma-tab-btn {
    border: 1px solid rgba(17, 24, 39, 0.10);
    background: #f9fafb;
    color: #374151;
    border-radius: 999px;
    padding: 9px 13px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.sigma-tab-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.08);
}

.sigma-tab-btn-active {
    background: linear-gradient(135deg, #111827 0%, #3b2f78 55%, #7d3bbb 100%);
    color: #ffffff;
    border-color: rgba(125, 59, 187, 0.38);
    box-shadow: 0 10px 24px rgba(61, 47, 120, 0.20);
}

.sigma-tab-content {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.sigma-tab-panel {
    display: none;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.sigma-tab-panel-active {
    display: flex;
    flex-direction: column;
}

.sigma-tab-panel-overview.sigma-tab-panel-active {
    overflow-y: auto;
    gap: 10px;
}

.sigma-tab-panel-overview .sigma-legend {
    flex: 0 0 auto;
}

.sigma-tab-panel-overview .sigma-intelligence-grid {
    flex: 1;
    min-height: 0;
}

.sigma-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
}

.sigma-panel-subtitle {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
    margin-top: -4px;
    margin-bottom: 6px;
}

.sigma-single-bpmn-panel {
    flex: 1;
    min-height: 0;
    height: 100%;
}

.sigma-single-bpmn-panel .sigma-bpmn-canvas {
    flex: 1;
    min-height: 0;
    height: auto;
}

.sigma-tab-fill-panel {
    flex: 1;
    min-height: 0;
    max-height: none !important;
    height: 100%;
    overflow: auto;
}

.sigma-tab-fill-panel .sigma-panel-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 8px;
    background: #ffffff;
}

.sigma-change-table-wrap.sigma-tab-fill-panel,
.sigma-semantic-map-wrap.sigma-tab-fill-panel {
    max-height: none !important;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sigma-change-table,
.sigma-semantic-map {
    min-height: 0;
}

.sigma-change-table table {
    min-width: 900px;
}

.sigma-semantic-map {
    overflow: visible;
    padding-bottom: 8px;
}

.sigma-semantic-card {
    margin-bottom: 8px;
}

.sigma-semantic-card-expanded {
    margin-bottom: 0;
}

.sigma-expanded-semantic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 12px;
    padding: 12px;
}

.sigma-expanded-empty {
    padding: 24px;
    color: #6b7280;
    font-weight: 800;
}

.sigma-expand-body-semantic-map {
    overflow: auto;
    background: #f7f8fb;
}

.sigma-expand-body-change-map,
.sigma-expand-body-semantic-map {
    min-height: 0;
}

.sigma-expand-icon-btn,
.sigma-reprocess-icon-btn {
    position: relative;
    z-index: 3;
}

@media (max-width: 1180px) {
    .sigma-coach-main-tabs {
        grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
    }

    .sigma-intelligence-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .sigma-coach-shell-tabs {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .sigma-coach-main-tabs {
        grid-template-columns: 1fr;
        overflow: hidden;
    }

    .sigma-coach-side-tabs {
        max-height: 44vh;
    }

    .sigma-actions-sticky {
        position: relative;
    }

    .sigma-tabbar {
        border-radius: 14px;
    }

    .sigma-tab-btn {
        padding: 8px 11px;
    }
}

/* -------------------------------------------------------------------------
   Magian BPMN readability upgrade
   -------------------------------------------------------------------------
   These styles support the clearer TO-BE auto-layout in SigmaCoach.js.
   They give the BPMN canvases more real estate, make the canvas easier to
   inspect, and prevent tab/panel constraints from squeezing the rendered model.
*/
.sigma-single-bpmn-panel {
    min-height: 620px;
}

.sigma-single-bpmn-panel .sigma-bpmn-canvas {
    min-height: 540px;
    background:
        linear-gradient(rgba(17, 24, 39, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px),
        #ffffff;
    background-size: 28px 28px;
}

.sigma-viewer-to-be .sigma-bpmn-canvas {
    border-color: rgba(125, 59, 187, 0.18);
    box-shadow: inset 0 0 0 1px rgba(125, 59, 187, 0.05);
}

.sigma-expand-canvas {
    min-height: 680px;
    background:
        linear-gradient(rgba(17, 24, 39, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px),
        #ffffff;
    background-size: 32px 32px;
}

/* Give bpmn-js labels and edges room to breathe. */
.sigma-bpmn-canvas .djs-label,
.sigma-expand-canvas .djs-label {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif !important;
}

.sigma-bpmn-canvas .djs-connection .djs-visual path,
.sigma-expand-canvas .djs-connection .djs-visual path {
    stroke-width: 2px !important;
}

.sigma-bpmn-canvas .djs-element .djs-visual > :first-child,
.sigma-expand-canvas .djs-element .djs-visual > :first-child {
    vector-effect: non-scaling-stroke;
}

@media (max-width: 1180px) {
    .sigma-single-bpmn-panel {
        min-height: 560px;
    }

    .sigma-single-bpmn-panel .sigma-bpmn-canvas {
        min-height: 490px;
    }
}

/* SigmaCoach TO-BE Gap Analysis Questionnaire
   Readability fix: this section deliberately resets the questionnaire controls
   because broad app-level label/span rules can otherwise squeeze the option text
   and make cards overlap. */
.sigma-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.sigma-label-no-margin {
    margin-bottom: 0;
}

.sigma-gap-analysis-icon {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(125, 59, 187, 0.28);
    background: linear-gradient(135deg, #ffffff 0%, #f8f5ff 100%);
    color: #47236c;
    border-radius: 999px;
    padding: 5px 9px 5px 6px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 8px 18px rgba(125, 59, 187, 0.10);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    box-sizing: border-box;
}

.sigma-gap-analysis-icon:hover,
.sigma-gap-analysis-icon:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(125, 59, 187, 0.52);
    box-shadow: 0 12px 24px rgba(125, 59, 187, 0.16);
}

.sigma-gap-analysis-icon-mark {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #7d3bbb;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 950;
    line-height: 1;
    flex: 0 0 20px;
}

.sigma-gap-analysis-icon-text {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.sigma-gap-overlay,
.sigma-gap-overlay * {
    box-sizing: border-box;
}

.sigma-gap-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483590;
    background: rgba(5, 9, 20, 0.66);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif;
    color: #111827;
    line-height: 1.35;
}

.sigma-gap-modal {
    width: min(96vw, 1480px);
    height: min(94vh, 940px);
    background: #f8f8fc;
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,0.78);
    box-shadow: 0 38px 100px rgba(0,0,0,0.38);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.sigma-gap-head {
    flex: 0 0 auto;
    padding: 20px 22px;
    background: radial-gradient(circle at top left, rgba(254,179,0,0.28), transparent 34%), linear-gradient(135deg, #101827 0%, #241940 54%, #7d3bbb 100%);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.sigma-gap-title-wrap {
    min-width: 0;
}

.sigma-gap-kicker {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.78;
    margin-bottom: 6px;
    font-weight: 850;
}

.sigma-gap-title {
    font-size: clamp(24px, 2.15vw, 34px);
    line-height: 1.08;
    font-weight: 950;
}

.sigma-gap-subtitle {
    margin-top: 8px;
    max-width: 980px;
    font-size: 13px;
    line-height: 1.45;
    opacity: 0.88;
}

.sigma-gap-close {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.38);
    background: rgba(255,255,255,0.14);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
}

.sigma-gap-toolbar {
    flex: 0 0 auto;
    padding: 12px 18px;
    background: #ffffff;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sigma-gap-status {
    min-height: 38px;
    border-radius: 14px;
    background: #eef2ff;
    color: #273469;
    padding: 10px 12px;
    font-size: 12.5px;
    font-weight: 750;
    line-height: 1.35;
    flex: 1 1 auto;
    min-width: 220px;
}

.sigma-gap-status-error {
    background: #fef2f2;
    color: #991b1b;
}

.sigma-gap-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sigma-gap-primary,
.sigma-gap-secondary {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 900;
    font-size: 12px;
    padding: 11px 16px;
    white-space: nowrap;
    min-height: 40px;
}

.sigma-gap-primary {
    background: #feb300;
    color: #171717;
    box-shadow: 0 12px 24px rgba(254, 179, 0, 0.25);
}

.sigma-gap-secondary {
    background: #7d3bbb;
    color: #ffffff;
}

.sigma-gap-primary:disabled,
.sigma-gap-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.sigma-gap-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 22px 24px;
    scroll-behavior: smooth;
}

.sigma-gap-empty,
.sigma-gap-loading {
    height: 100%;
    min-height: 360px;
    border-radius: 24px;
    border: 1px dashed rgba(125, 59, 187, 0.28);
    background: linear-gradient(135deg, #ffffff 0%, #f8f5ff 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 26px;
    color: #374151;
}

.sigma-gap-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: #7d3bbb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 950;
    box-shadow: 0 18px 36px rgba(125, 59, 187, 0.22);
    margin-bottom: 16px;
}

.sigma-gap-empty-title {
    font-size: 20px;
    font-weight: 950;
    color: #111827;
}

.sigma-gap-empty-copy {
    margin-top: 8px;
    max-width: 580px;
    color: #6b7280;
    line-height: 1.55;
    font-size: 13px;
}

.sigma-gap-loading {
    flex-direction: row;
    gap: 18px;
    text-align: left;
    min-height: 280px;
}

.sigma-gap-loading strong {
    display: block;
    color: #111827;
    font-size: 16px;
    font-weight: 950;
}

.sigma-gap-loading span {
    display: block;
    color: #6b7280;
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.45;
}

.sigma-gap-spinner {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 999px;
    border: 4px solid rgba(125, 59, 187, 0.18);
    border-top-color: #7d3bbb;
    animation: sigmaGapSpin 0.85s linear infinite;
}

@keyframes sigmaGapSpin {
    to { transform: rotate(360deg); }
}

.sigma-gap-summary-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(16, 24, 39, 0.07);
    padding: 15px;
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.sigma-gap-summary-title {
    color: #111827;
    font-size: 13px;
    font-weight: 950;
    margin-bottom: 5px;
}

.sigma-gap-summary-card p {
    margin: 0;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.5;
}

.sigma-gap-methods {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.sigma-gap-methods span {
    border-radius: 999px;
    padding: 6px 9px;
    background: #f8f5ff;
    color: #47236c;
    font-size: 11px;
    font-weight: 900;
    border: 1px solid rgba(125, 59, 187, 0.16);
}

.sigma-gap-missing {
    border-radius: 16px;
    background: #fff8e6;
    border: 1px solid rgba(254, 179, 0, 0.22);
    padding: 11px 12px;
    color: #514011;
    font-size: 12px;
}

.sigma-gap-missing strong {
    display: block;
    margin-bottom: 6px;
}

.sigma-gap-missing ul {
    margin: 0;
    padding-left: 18px;
}

.sigma-gap-question-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.sigma-gap-question-card {
    width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 0;
    position: relative;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 14px 34px rgba(16, 24, 39, 0.06);
    overflow: visible;
    clear: both;
}

.sigma-gap-question-head {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.sigma-gap-question-head > span {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 12px;
    background: #7d3bbb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
    box-shadow: 0 8px 18px rgba(125, 59, 187, 0.18);
}

.sigma-gap-question-head strong {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 8px;
    background: #eef2ff;
    color: #273469;
    font-size: 11px;
    font-weight: 950;
    margin-bottom: 6px;
    max-width: 100%;
}

.sigma-gap-question-head p {
    margin: 0;
    color: #111827;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.sigma-gap-option-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 10px;
    align-items: stretch;
    margin: 0 0 12px 0;
}

.sigma-gap-option-card {
    width: 100%;
    min-width: 0;
    min-height: 82px;
    height: auto !important;
    border: 1px solid rgba(17, 24, 39, 0.10);
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    background: #f9fafb;
    display: grid !important;
   grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
    overflow: visible !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word;
    line-height: 1.32;
    text-align: left;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.sigma-gap-option-card:hover,
.sigma-gap-option-card:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(125, 59, 187, 0.34);
    box-shadow: 0 10px 22px rgba(16, 24, 39, 0.08);
}

.sigma-gap-option-card-selected,
.sigma-gap-option-card:has(.sigma-gap-option-input:checked) {
    background: #f8f5ff;
    border-color: rgba(125, 59, 187, 0.56);
    box-shadow: 0 0 0 3px rgba(125, 59, 187, 0.10);
}

.sigma-gap-option-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    margin: 0;
}

.sigma-gap-option-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(17, 24, 39, 0.48);
    background: #ffffff;
    display: block;
    margin-top: 2px;
    flex: 0 0 18px;
}

.sigma-gap-option-card-selected .sigma-gap-option-dot,
.sigma-gap-option-card:has(.sigma-gap-option-input:checked) .sigma-gap-option-dot {
    border-color: #2bb7aa;
    background: radial-gradient(circle at center, #2bb7aa 0 45%, #ffffff 48% 100%);
}

.sigma-gap-option-text {
    min-width: 0;
    width: 100%;
    display: block;
}

.sigma-gap-option-label {
    color: #111827;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.32;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.sigma-gap-option-impact {
    display: block;
    margin-top: 5px;
    color: #6b7280;
    font-size: 11.5px;
    line-height: 1.4;
    font-style: normal;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.sigma-gap-range-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 14px;
    align-items: center;
    margin: 10px 0 8px;
}

.sigma-gap-range-wrap input[type="range"] {
    width: 100%;
    min-width: 0;
    accent-color: #7d3bbb;
}

.sigma-gap-range-value {
    width: 48px;
    height: 42px;
    border-radius: 14px;
    background: #7d3bbb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 950;
}

.sigma-gap-range-labels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.sigma-gap-range-labels span {
    min-width: 0;
    border-radius: 12px;
    background: #f9fafb;
    padding: 8px 9px;
    color: #6b7280;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: break-word;
}

.sigma-gap-question-note {
    margin-top: 7px;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: break-word;
}

.sigma-gap-question-note strong {
    color: #111827;
    font-weight: 950;
}

@media (max-width: 1080px) {
    .sigma-gap-modal {
        width: 96vw;
        height: 94vh;
    }

    .sigma-gap-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .sigma-gap-toolbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .sigma-gap-overlay {
        padding: 10px;
    }

    .sigma-gap-modal {
        width: 98vw;
        height: 96vh;
        border-radius: 20px;
    }

    .sigma-gap-head,
    .sigma-gap-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sigma-gap-body {
        padding: 12px;
    }

    .sigma-gap-toolbar-actions {
        justify-content: stretch;
    }

    .sigma-gap-primary,
    .sigma-gap-secondary {
        width: 100%;
    }

    .sigma-gap-question-card {
        padding: 13px;
        border-radius: 18px;
    }

    .sigma-gap-question-head {
        grid-template-columns: 30px minmax(0, 1fr);
    }

    .sigma-gap-question-head > span {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }

    .sigma-gap-option-grid,
    .sigma-gap-range-labels {
        grid-template-columns: 1fr;
    }

    .sigma-gap-range-wrap {
        grid-template-columns: minmax(0, 1fr) 48px;
    }

    .sigma-gap-analysis-icon-text {
        display: none;
    }
}
