/* ═══════════════════════════════════════════════
   GLOBAL RESETS & SCROLLBAR
   ═══════════════════════════════════════════════ */
* {
    box-sizing: border-box
}

/* ═══════════════════════════════════════════════
   GLOBAL FONT SIZE SCALE-UP
   ═══════════════════════════════════════════════ */
html {
    font-size: 112.5%;
    /* 9px → ~10px base, scales everything proportionally */
}

/* Explicit overrides for all fixed font-size values */
.proc-card-row1 .proc-title-text {
    font-size: 15px;
}

/* was 13px */
.proc-badge-row .pbadge {
    font-size: 12px;
}

/* was 10px */
.proc-freq-inline {
    font-size: 11px;
}

/* was 9px  */
.pane-label {
    font-size: 12px;
}

/* was 10px */
.obj-badge-type,
.obj-badge-attr {
    font-size: 11px;
}

/* was 9px  */
.proc-revise-btn .revise-text {
    font-size: 12px;
}

/* was 10px */
.proc-arrow-icon {
    font-size: 12px;
}

/* was 10px */
.proc-rm-btn {
    font-size: 13px;
}

/* was 11px */
.proc-revise-btn {
    font-size: 13px;
}

/* was 11px */
.sai-result-role {
    font-size: 15px;
}

/* was 13px */
.sai-result-desc {
    font-size: 13px;
}

/* was 11px */
.sai-op-detail {
    font-size: 14px;
}

/* was 12px */
.sai-op-desc {
    font-size: 13px;
}

/* was 11px */
.sai-op-shared {
    font-size: 13px;
}

/* was 11px */
.sai-radio-wrap {
    font-size: 13px;
}

/* was 11px */
.sai-summary {
    font-size: 14px;
}

/* was 12px */
.sai-others-title {
    font-size: 15px;
}

/* was 13px */
.sai-others-list li {
    font-size: 14px;
}

/* was 12px */
.sai-others-hint {
    font-size: 13px;
}

/* was 11px */
.sai-others-list li i {
    font-size: 12px;
}

/* was 10px */
.sai-meta-tag {
    font-size: 12px;
}

/* was 10px */
.sai-badge {
    font-size: 11px;
}

/* was 9px  */
.sai-result-count,
.sai-select-all {
    font-size: 13px;
}

/* was 11px */
.sai-btn-cancel,
.sai-btn-go,
.sai-btn-apply {
    font-size: 14px;
}

/* was 12px */
.dept-expand-btn {
    font-size: 16px;
}

/* was 14px */

::-webkit-scrollbar {
    width: 4px;
    height: 4px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: #9de4c4;
    border-radius: 4px
}

html,
body {
    height: 100%;
    overflow: hidden;
    margin: 0
}

textarea {
    resize: vertical
}

/* ═══════════════════════════════════════════════
   BRAND UTILITIES
   ═══════════════════════════════════════════════ */
.grad-text {
    background: linear-gradient(135deg, #18a562, #21bf75);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-g {
    background: linear-gradient(135deg, #18a562, #21bf75);
    box-shadow: 0 4px 14px rgba(33, 191, 117, .3);
    transition: all .2s;
}

.btn-g:hover {
    background: linear-gradient(135deg, #128050, #18a562);
    box-shadow: 0 6px 20px rgba(33, 191, 117, .45);
    transform: translateY(-1px);
}

.btn-g:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.grid-bg {
    background-image:
        linear-gradient(rgba(33, 191, 117, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(33, 191, 117, .035) 1px, transparent 1px);
    background-size: 44px 44px;
}

/* ═══════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════ */
#sidebar {
    transition: width .28s, min-width .28s
}

#sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden
}

.sb-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: white;
    border: 1px solid #d1fae5;
    color: #18a562;
    cursor: pointer;
    font-weight: bold;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 40;
    transition: opacity 0.28s;
}

.sidebar-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════
   DEPARTMENT SPLIT LAYOUT
   ═══════════════════════════════════════════════ */
.dept-split-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    height: 100%;
    transition: grid-template-columns .25s ease;
}

.dept-left-panel {
    border-right: 1px solid #d1fae5;
    background: #f0fdf4;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    transition: opacity .2s, visibility .2s;
}

.dept-right-panel {
    overflow-y: auto;
    height: 100%;
    background: white;
}

.dept-split-grid.dept-collapsed {
    grid-template-columns: 0px 1fr
}

.dept-split-grid.dept-collapsed .dept-left-panel {
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    border-right: none;
    pointer-events: none;
    width: 0;
    min-width: 0;
    padding: 0;
}

.dept-expand-btn {
    display: none;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 15;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1.5px solid #d1fae5;
    background: #f0fdf4;
    color: #21bf75;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.dept-expand-btn:hover {
    background: #dcfce7;
    border-color: #21bf75;
    box-shadow: 0 4px 12px rgba(33, 191, 117, .15);
}

.dept-split-grid.dept-collapsed .dept-expand-btn {
    display: flex
}

/* Department Items */
.di {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all .15s;
    margin: 2px 4px;
    border-radius: 8px;
}

.di:hover {
    background: #ecfdf5;
    border-left-color: #21bf75;
}

.di.act {
    background: #d1fae5;
    border-left-color: #21bf75;
}

/* ── Dept icon: neutral by default, colored on hover/active ── */
.di-icon-idle {
    background: #f1f5f9;
    color: #94a3b8;
}

.di:hover .dept-icon-wrap.di-icon-idle[data-core="1"] {
    background: linear-gradient(135deg, #18a562, #21bf75);
    box-shadow: 0 4px 14px rgba(33, 191, 117, .3);
    color: white;
    transition: all .15s;
}

/* Drag droppable targets — strip only on hover/over, not permanently */
.di.pd-droppable {
    border-left-color: transparent;
}

.di.pd-droppable:hover,
.di.pd-droppable.act {
    border-left-color: #21bf75;
}

.di:hover .dept-icon-wrap.di-icon-idle[data-core="0"] {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    box-shadow: 0 4px 14px rgba(249, 115, 22, .25);
    color: white;
    transition: all .15s;
}

.dept-icon-wrap {
    transition: background .15s, box-shadow .15s, color .15s;
}

/* Tabs */
.tab-active {
    background: rgba(33, 191, 117, .15);
    color: #18a562;
    box-shadow: inset 0 0 0 1px rgba(33, 191, 117, .3);
}

/* ═══════════════════════════════════════════════
   PROCESS CARDS — 3-col grid, vertical scroll
   ═══════════════════════════════════════════════ */
.proc-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 520px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(33, 191, 117, 0.15) transparent;
}

.proc-cards-grid::-webkit-scrollbar {
    width: 4px
}

.proc-cards-grid::-webkit-scrollbar-track {
    background: transparent
}

.proc-cards-grid::-webkit-scrollbar-thumb {
    background: rgba(33, 191, 117, 0.18);
    border-radius: 4px
}

@media (max-width: 1200px) {
    .proc-cards-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media (max-width: 768px) {
    .proc-cards-grid {
        grid-template-columns: 1fr
    }
}

/* Process card base */
.proc-card-unified {
    border: 1.5px solid #d1fae5;
    border-radius: 14px;
    background: #f8fffe;
    cursor: pointer;
    transition: all .15s;
    overflow: hidden;
}

.proc-card-unified:hover {
    border-color: #6ee7b7;
    box-shadow: 0 4px 12px rgba(33, 191, 117, .08);
    transform: translateY(-1px);
}

.proc-card-unified.is-open {
    border-color: #21bf75;
    background: #f0fdf4;
    border-radius: 14px 14px 0 0 !important;
    border-bottom: none !important;
    transform: none;
    box-shadow: none;
    grid-column: 1 / -1;
}

.proc-card-unified.is-open .proc-card-top {
    border-bottom: 1px solid #d1fae5;
}

/* Border state classes */
.proc-card-neutral-border {
    border-color: #d1fae5
}

.proc-card-active-border {
    border-color: #21bf75 !important;
    background: #e8fbf2 !important
}

/* ═══════════════════════════════════════════════
   PROCESS CARD TOP — 2-row: icon+title, badges
   ═══════════════════════════════════════════════ */
.proc-card-top {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    gap: 6px;
    cursor: pointer;
    min-height: 0;
}

/* Row 1: icon + title + actions right */
.proc-card-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.proc-card-row1 .proc-title-text {
    font-weight: 700;
    font-size: 13px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    text-align: left;
}

/* Row 2: badges + frequency left, dropdown arrow pinned right */
.proc-card-row2 {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    justify-content: space-between;
}

/* Frequency badge sits inline right after its parent badge */
.proc-badge-row .pbadge+.proc-freq-inline {
    margin-left: 2px;
}

.proc-card-row2 .proc-arrow-icon {
    margin-left: auto;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    color: #21bf75;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.15s, border-color 0.15s, color 0.15s;
}

.proc-card-unified:hover .proc-card-row2 .proc-arrow-icon {
    background: #dcfce7;
    border-color: #6ee7b7;
}

.proc-card-unified.is-open .proc-card-row2 .proc-arrow-icon {
    transform: rotate(180deg);
    background: #f0fdf4;
    border-color: #d1fae5;
    color: #21bf75;
}

.proc-badge-row {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.proc-badge-row .pbadge {
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.proc-freq-inline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #e8faf2;
    color: #128050;
    border: 1px solid #d1fae5;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

/* Arrow icon inside the frequency badge (reuses proc-arrow-icon style) */
.proc-freq-inline .freq-arrow-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    color: #21bf75;
    font-size: 8px;
    flex-shrink: 0;
}

/* Actions pinned right */
/* Actions pinned right — cancel only (arrow moved to row2) */
.proc-card-actions-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.proc-card-actions-right .proc-arrow-icon {
    display: flex;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    color: #21bf75;
    font-size: 11px;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.15s, border-color 0.15s, color 0.15s;
    cursor: pointer;
}

.proc-card-row2 .proc-freq-arrow {
    margin-left: auto;
    flex-shrink: 0;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.proc-card-row2 .proc-freq-arrow:hover {
    background: transparent !important;
    border-color: transparent !important;
}

.proc-card-actions-right .proc-arrow-icon:hover {
    background: #dcfce7;
    border-color: #6ee7b7;
}

/* Kill old conflicting rule */
.proc-card-top .proc-title-area {
    display: none !important
}

/* Open wrapper spans full width */
.proc-wrapper-open,
.proc-wrapper-fullwidth {
    grid-column: 1 / -1
}

/* ═══════════════════════════════════════════════
   PROCESS CARD BODY & DETAIL
   ═══════════════════════════════════════════════ */
.proc-card-body {
    background: linear-gradient(to bottom, #f0fdf4, #f8fffe);
    border: 1.5px solid #bbf7d0;
    border-top: none;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    animation: procOpen 0.18s ease both;
}

@keyframes procOpen {
    from {
        opacity: 0;
        max-height: 0
    }

    to {
        opacity: 1;
        max-height: 3000px
    }
}

.proc-body-inner {
    padding: 20px
}

/* Revise button — icon, expand on hover */
.proc-revise-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    color: #18a562;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    flex-shrink: 0;
    padding: 0;
}

.proc-revise-btn:hover {
    width: 82px;
    gap: 5px;
    padding: 0 10px;
    background: #d1fae5
}

.proc-revise-btn .revise-text {
    display: inline-block;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    transition: max-width 0.2s ease, opacity 0.15s ease;
}

.proc-revise-btn:hover .revise-text {
    max-width: 50px;
    opacity: 1
}

/* Remove button */
.proc-rm-btn {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.proc-rm-btn:hover {
    color: #fff;
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, .25);
    transform: scale(1.1);
}

/* Arrow icon — base */
.proc-arrow-icon {
    font-size: 11px;
    color: #21bf75;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.15s;
}

.proc-card-unified.is-open .proc-arrow-icon {
    transform: rotate(180deg);
}

/* Source badges on cards */
.sa {
    border-left: 3px solid #21bf75
}

.sm {
    border-left: 3px solid #10b981
}

/* ═══════════════════════════════════════════════
   PANE CARDS — Actions | Tasks | Stakeholders
   ═══════════════════════════════════════════════ */
.proc-combined-tab {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    align-items: stretch;
}

@media (max-width: 1024px) {
    .proc-combined-tab {
        grid-template-columns: 1fr
    }
}

.pane-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.pane-card .scroll-area {
    flex: 1;
    min-height: 0;
    max-height: 200px;
    overflow-y: auto
}

.pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.pane-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════
   OBJECTS — 4-per-row grid
   ═══════════════════════════════════════════════ */
.obj-row-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

@media (max-width: 1024px) {
    .obj-row-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

.obj-attr-fullrow {
    grid-column: 1 / -1;
    background: white;
    border: 1.5px solid #d1fae5 !important;
    border-radius: 12px;
    animation: fu .15s ease both;
    max-height: 580px;
    overflow: hidden;
}

.obj-attr-inner-wrap {
    padding: 16px 20px;
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(33, 191, 117, 0.15) transparent;
}

.obj-attr-inner-wrap::-webkit-scrollbar {
    width: 4px
}

.obj-attr-inner-wrap::-webkit-scrollbar-track {
    background: transparent
}

.obj-attr-inner-wrap::-webkit-scrollbar-thumb {
    background: rgba(33, 191, 117, 0.18);
    border-radius: 4px
}

.obj-attr-inner-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(33, 191, 117, 0.3)
}

.obj-attr-scroll-area {
    max-height: 420px !important;
    overflow-y: auto;
    padding-right: 2px;
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(33, 191, 117, 0.12) transparent;
}

.obj-attr-scroll-area::-webkit-scrollbar {
    width: 3px
}

.obj-attr-scroll-area::-webkit-scrollbar-track {
    background: transparent
}

.obj-attr-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(33, 191, 117, 0.15);
    border-radius: 4px
}

.obj-mini-card {
    background: #f8fffe;
    border: 1.5px solid #d1fae5;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.13s;
    user-select: none;
}

.obj-mini-card:hover {
    background: #ecfdf5;
    border-color: #6ee7b7
}

.obj-mini-card.obj-mini-open {
    border-color: #21bf75;
    background: #dcfce7;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.obj-badge-type {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    background: #e8faf2;
    color: #128050;
    border: 1px solid #d1fae5;
    text-transform: uppercase;
}

.obj-badge-attr {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.obj-revise-btn {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
    opacity: .5;
}

.obj-revise-btn:hover {
    opacity: 1;
    background: #ecfdf5
}

/* ═══════════════════════════════════════════════
   OBJECTS TAB (global view)
   ═══════════════════════════════════════════════ */
.og {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 2px;
}

@media (max-width: 1400px) {
    .og {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .og {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .og {
        grid-template-columns: 1fr;
    }
}

.oc {
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.oc:hover {
    border-color: #21bf75;
    box-shadow: 0 10px 25px -5px rgba(33, 191, 117, 0.1), 0 8px 10px -6px rgba(33, 191, 117, 0.1);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════
   DEPENDENT SECTIONS
   ═══════════════════════════════════════════════ */
.dep-section-card {
    border: 1.5px solid #e2e8f0 !important;
    border-left: 3px solid #94a3b8 !important;
    border-radius: 10px !important;
    background: #fafffe !important;
    padding: 10px 14px !important;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    box-shadow: none !important;
}

.dep-section-card:hover {
    border-color: #9de4c4 !important;
    background: #f0fdf4 !important
}

.dep-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid #f1f5f9 !important;
    flex-wrap: wrap;
}

.dep-section-header i {
    color: #64748b !important
}

.dep-section-header span.font-extrabold {
    color: #475569 !important
}

.dep-section-card table {
    margin: 0;
    width: 100%;
    border-collapse: collapse
}

.dep-section-card table td {
    padding: 6px 8px 6px 0;
    font-size: 12px;
    vertical-align: middle
}

.dep-section-card .dep-section-body {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.06) transparent;
}

.dep-section-card .dep-section-body::-webkit-scrollbar {
    width: 3px
}

.dep-section-card .dep-section-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px
}

.dep-section-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

/* ═══════════════════════════════════════════════
   CONFIRM BAR
   ═══════════════════════════════════════════════ */
.cb {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: linear-gradient(to top, rgba(255, 255, 255, 1), rgba(255, 255, 255, .95));
    border-top: 1px solid #d1fae5;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ═══════════════════════════════════════════════
   MODAL OVERLAY
   ═══════════════════════════════════════════════ */
.mo {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.mo.show {
    display: flex
}

/* ═══════════════════════════════════════════════
   DEPENDENCY GRAPH — TOPBAR BUTTONS
   ═══════════════════════════════════════════════ */
.dep-graph-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 10px;
    border: 1.5px solid;
    background: white;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
    font-family: inherit;
}

.dep-graph-btn-obj {
    border-color: #e9d5ff;
    color: #7c3aed;
}

.dep-graph-btn-obj:hover {
    background: #faf5ff;
    border-color: #c4b5fd;
    box-shadow: 0 2px 8px rgba(124, 58, 237, .12);
    transform: translateY(-1px);
}

.dep-graph-btn-proc {
    border-color: #d1fae5;
    color: #16a34a;
}

.dep-graph-btn-proc:hover {
    background: #f0fdf4;
    border-color: #86efac;
    box-shadow: 0 2px 8px rgba(33, 191, 117, .12);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════
   DEPENDENCY GRAPH MODAL
   ═══════════════════════════════════════════════ */
.dgv-modal-box {
    background: white;
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0, 0, 0, .04);
    width: 92vw;
    max-width: 1180px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fu .22s ease both;
}

.dgv-modal-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #fafffe 0%, #f0fdf4 100%);
    flex-shrink: 0;
}

.dgv-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dgv-title-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.dgv-title-icon-obj {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #7c3aed;
    box-shadow: 0 2px 8px rgba(124, 58, 237, .18);
}

.dgv-title-icon-proc {
    background: linear-gradient(135deg, #e8faf2, #c5f0dd);
    color: #16a34a;
    box-shadow: 0 2px 8px rgba(33, 191, 117, .18);
}

.dgv-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all .15s;
    flex-shrink: 0;
}

.dgv-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, .3);
    transform: rotate(90deg);
}

.dgv-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Stats bar */
.dgv-stats-bar {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 10px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.dgv-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.dgv-sv {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.dgv-sl {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* Toolbar */
.dgv-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.dgv-view-tabs {
    display: flex;
    gap: 3px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 10px;
}

.dgv-tab {
    padding: 5px 12px;
    border-radius: 7px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}

.dgv-tab-active {
    background: white;
    color: #21bf75;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.dgv-tab:hover:not(.dgv-tab-active) {
    background: rgba(255, 255, 255, .6);
    color: #1e293b;
}

.dgv-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px 10px;
}

.dgv-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 12px;
    width: 150px;
    font-family: inherit;
    color: #1e293b;
}

.dgv-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}

.dgv-leg-item {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1.5px solid var(--lc, #e2e8f0);
    background: white;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.dgv-leg-item::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 2.5px;
    border-radius: 2px;
    background: var(--lc, #94a3b8);
}

/* Content area */
.dgv-content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* Graph view */
.dgv-graph-scroll {
    width: 100%;
    min-height: 300px;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.dgv-mm-box {
    min-width: 100%;
    display: flex;
    justify-content: center;
}

.dgv-mm-box svg {
    max-width: 100%;
    height: auto;
}

.dgv-mm-loading {
    color: #94a3b8;
    font-size: 13px;
    padding: 60px 20px;
    text-align: center;
}

.dgv-render-error {
    padding: 20px;
    background: #fef2f2;
    border-radius: 12px;
    border: 1px solid #fecaca;
    margin: 16px;
}

.dgv-code-pre {
    font-size: 10px;
    color: #7f1d1d;
    white-space: pre-wrap;
    word-break: break-all;
    background: #fff5f5;
    padding: 8px;
    border-radius: 6px;
    margin-top: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.dgv-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.8;
}

/* List view */
.dgv-list-head {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: 8px;
    padding: 7px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    position: sticky;
    top: 0;
    z-index: 2;
}

.dgv-list-rows {
    padding: 6px 8px;
}

.dgv-list-row {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: 8px;
    align-items: start;
    padding: 9px 8px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all .15s;
    margin-bottom: 3px;
}

.dgv-list-row:hover {
    background: #f0fdf4;
    border-color: #d1fae5;
}

.dgv-ln-primary {
    font-weight: 700;
    font-size: 12px;
    color: #1e293b;
    word-break: break-word;
}

.dgv-ln-sub {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 1px;
}

.dgv-list-fwd,
.dgv-list-bwd {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-start;
    padding-top: 1px;
}

.dgv-chip {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 99px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.dgv-chip-fk,
.dgv-chip-obj_fk {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.dgv-chip-soft_link,
.dgv-chip-obj_soft_link {
    border-color: #fdba74;
    background: #fff7ed;
    color: #c2410c;
}

.dgv-chip-linked,
.dgv-chip-obj_linked {
    border-color: #d8b4fe;
    background: #faf5ff;
    color: #7e22ce;
}

.dgv-chip-containment,
.dgv-chip-obj_containment {
    border-color: #99f6e4;
    background: #f0fdfa;
    color: #0f766e;
}

.dgv-chip-manual,
.dgv-chip-obj_manual {
    border-color: #f9a8d4;
    background: #fdf2f8;
    color: #9d174d;
}

.dgv-chip-back {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.dgv-chip-none {
    font-size: 10px;
    color: #cbd5e1;
    font-style: italic;
}

/* Chains view */
.dgv-chains-wrap {
    padding: 16px 20px;
}

.dgv-sec-title {
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dgv-ch-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: #f8fffe;
    border: 1px solid #d1fae5;
    border-radius: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.dgv-ch-cycle {
    background: #fef2f2;
    border-color: #fecaca;
}

.dgv-ch-idx {
    flex-shrink: 0;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dgv-ch-idx-cycle {
    background: #fecaca;
    color: #dc2626;
}

.dgv-ch-steps {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}

.dgv-ch-node {
    padding: 3px 10px;
    background: white;
    border: 1.5px solid #d1fae5;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

.dgv-ch-node-cycle {
    border-color: #fca5a5;
    background: #fff5f5;
}

.dgv-ch-arrow {
    font-size: 12px;
    color: #21bf75;
    font-weight: 700;
    flex-shrink: 0;
}

.dgv-ch-len {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    flex-shrink: 0;
    padding: 2px 7px;
    background: #f1f5f9;
    border-radius: 99px;
}

/* Responsive */
@media (max-width: 768px) {
    .dgv-modal-box {
        width: 98vw;
        max-height: 96vh;
        border-radius: 16px;
    }

    .dgv-list-head,
    .dgv-list-row {
        grid-template-columns: 140px 1fr;
    }

    .dgv-list-bwd {
        display: none;
    }

    .dgv-legend {
        display: none;
    }

    .dep-graph-btn span {
        display: none;
    }

    .dep-graph-btn {
        padding: 5px 7px;
    }

    .dgv-stats-bar {
        gap: 16px;
        overflow-x: auto;
    }
}

/* ═══════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════ */
@keyframes fu {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.au {
    animation: fu .3s ease both
}

/* ═══════════════════════════════════════════════
   COMMON UI ELEMENTS
   ═══════════════════════════════════════════════ */
.rm-btn {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.rm-btn:hover {
    color: #fff;
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, .25);
    transform: scale(1.1);
}

.add-row {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap
}

.ab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 14px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.01em;
    box-sizing: border-box;
}

.ab-g {
    border-color: #6ee7b7;
    background: #f0fdf4;
    color: #15803d;
    box-shadow: 0 1px 3px rgba(33, 191, 117, 0.1);
}

.ab-g:hover {
    background: #dcfce7;
    border-color: #21bf75;
    box-shadow: 0 2px 8px rgba(33, 191, 117, 0.18);
    transform: translateY(-1px);
}

.ab-g:active {
    transform: translateY(0);
}

.ab-b {
    border-color: #6ee7b7;
    background: linear-gradient(135deg, #f0fdf4, #e8faf2);
    color: #128050;
    box-shadow: 0 1px 3px rgba(33, 191, 117, 0.1);
}

.ab-b:hover {
    background: linear-gradient(135deg, #dcfce7, #d1fae5);
    border-color: #21bf75;
    box-shadow: 0 2px 8px rgba(33, 191, 117, 0.2);
    transform: translateY(-1px);
}

.ab-b:active {
    transform: translateY(0);
}

.ab-o {
    border-color: #fcd34d;
    background: #fffbeb;
    color: #92400e;
    box-shadow: 0 1px 3px rgba(251, 191, 36, 0.1);
}

.ab-o:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.18);
    transform: translateY(-1px);
}

.ab-o:active {
    transform: translateY(0);
}

.scroll-area {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px
}

/* Collapse Sections */
.collapse-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #128050;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    gap: 2px;
}

.collapse-btn:hover {
    background: #d1fae5
}

.collapse-btn.open {
    border-radius: 10px 10px 0 0;
    border-bottom: none
}

.collapse-body {
    border: 1px solid #d1fae5;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 12px;
    background: #fafffe;
}

.collapse-body.hidden {
    display: none
}

/* ═══════════════════════════════════════════════
   COMPACT STAT CARDS — 5 green cards row
   ═══════════════════════════════════════════════ */
.cards-row-layout {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    align-items: stretch;
    margin-bottom: 16px;
    padding-bottom: 12px;
}

@media (max-width: 1100px) {
    .cards-row-layout {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media (max-width: 768px) {
    .cards-row-layout {
        grid-template-columns: repeat(2, 1fr)
    }
}

.stat-card-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all .18s;
    background: linear-gradient(135deg, #d1fae5, #d1fae5);
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(33, 191, 117, .2);
}

.stat-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(182, 189, 186, 0.856)
}

.stat-card-compact .stat-card-icon {
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #0d633f;
    background: rgba(255, 255, 255, .18);
}

.stat-card-compact .stat-card-info {
    min-width: 0
}

.stat-card-compact .stat-card-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    color: #0d633f
}

.stat-card-compact .stat-card-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #0d633f;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card-compact.active-card {
    background: linear-gradient(135deg, #8aebc1, #8aebc1) !important;
    box-shadow: 0 0 0 3px rgba(33, 191, 117, .3), 0 4px 14px rgba(33, 191, 117, .3);
}

/* Department Stakeholder Button & Panel */
.dept-stk-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #d1fae5;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.dept-stk-btn:hover {
    background: #dcfce7;
    border-color: #21bf75;
    box-shadow: 0 1px 4px rgba(33, 191, 117, 0.15);
}

.dept-stk-btn .dept-stk-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: #21bf75;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.dept-stk-panel {
    background: #f8fdf9;
    border: 1px solid #d1fae5;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 6px 0 10px 0;
    animation: fadeSlideDown 0.2s ease;
}

.dept-stk-panel.hidden {
    display: none;
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-panel-body {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px
}

/* Stat Panel */
.stat-panel {
    display: none;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    margin-top: 4px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
}

.stat-panel.show {
    display: block
}

.sg {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px
}

.sc {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    transition: all .15s;
    cursor: default;
    background: #fafffe;
}

.sc:hover {
    border-color: #9de4c4;
    background: #f0fdf4;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .03)
}

/* ═══════════════════════════════════════════════
   HERO SECTION & DRAG HANDLE
   ═══════════════════════════════════════════════ */
#hero-section {
    overflow: hidden;
    transition: height .3s cubic-bezier(.4, 0, .2, 1);
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

#hero-section.hero-collapsed {
    height: 0px !important;
    min-height: 0 !important;
    border: none
}

#hero-drag-handle {
    height: 32px;
    background: linear-gradient(180deg, #f0fdf4 0%, #f8fffe 100%);
    cursor: ns-resize;
    border-top: 1.5px solid #d1fae5;
    border-bottom: 1.5px solid #d1fae5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.22s, height 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s;
    position: relative;
    z-index: 30;
    overflow: visible;
    margin: 0;
    gap: 10px;
}

#hero-drag-handle::after {
    display: none;
}

#hero-drag-handle:hover {
    background: linear-gradient(180deg, #dcfce7 0%, #f0fdf4 100%);
    box-shadow: 0 2px 8px rgba(33, 191, 117, 0.08);
}

/* ── Collapsed state ── */
#hero-drag-handle.collapsed-state {
    height: 40px;
    background: linear-gradient(135deg, #f0fdf4, #e8faf2);
    cursor: pointer;
    border-top: 2px solid #bbf7d0;
    border-bottom: 2px solid #bbf7d0;
    animation: handle-pulse 2.2s ease-in-out infinite;
}

@keyframes handle-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(33, 191, 117, 0);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(33, 191, 117, 0.12);
    }
}

#hero-drag-handle.collapsed-state:hover {
    background: linear-gradient(135deg, #dcfce7, #d1fae5);
    animation: none;
    box-shadow: 0 2px 12px rgba(33, 191, 117, 0.18);
}

/* ── Center pill — always visible in expanded state ── */
.handle-center {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
    gap: 8px;
    pointer-events: none;
    background: white;
    border: 1.5px solid #d1fae5;
    border-radius: 99px;
    padding: 3px 14px 3px 10px;
    box-shadow: 0 1px 4px rgba(33, 191, 117, 0.1);
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
}

#hero-drag-handle:hover .handle-center {
    border-color: #6ee7b7;
    box-shadow: 0 2px 8px rgba(33, 191, 117, 0.18);
}

/* Collapse arrow inside the pill (expanded state) */
.handle-center::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2321bf75' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}

/* Collapsed state: hide the pill, show brand label instead */
#hero-drag-handle.collapsed-state .handle-center {
    border-color: #86efac;
    background: white;
    box-shadow: 0 2px 8px rgba(33, 191, 117, 0.15);
}

#hero-drag-handle.collapsed-state .handle-center::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2321bf75' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.handle-brand {
    font-size: 12px;
    font-weight: 800;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: linear-gradient(135deg, #18a562, #21bf75);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.01em;
    line-height: 1;
    white-space: nowrap;
}

.handle-hint {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.01em;
    white-space: nowrap;
    display: inline;
}

/* In collapsed state, hint changes text via JS — no extra hiding needed */

/* ── Toggle icon button — always visible on right ── */
.handle-icon-btn {
    display: flex;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1.5px solid #d1fae5;
    background: white;
    color: #21bf75;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s;
    padding: 0;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(33, 191, 117, 0.1);
}

.handle-icon-btn:hover {
    background: #dcfce7;
    border-color: #21bf75;
    box-shadow: 0 2px 8px rgba(33, 191, 117, 0.25);
    transform: translateY(-50%) scale(1.08);
}

/* Drag dots on left side */
.handle-drag-dots {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 3px;
    opacity: 0.35;
    transition: opacity 0.18s;
    pointer-events: none;
}

#hero-drag-handle:hover .handle-drag-dots {
    opacity: 0.7;
}

.handle-drag-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #21bf75;
}

/* Revise Icon Button (global) */
.revise-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #18a562, #21bf75);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.revise-icon-btn:hover {
    width: 90px;
    border-radius: 8px
}

.revise-icon-btn .ri-icon {
    font-size: 13px;
    flex-shrink: 0
}

.revise-icon-btn .ri-text {
    font-size: 10px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    transition: max-width .2s;
}

.revise-icon-btn:hover .ri-text {
    max-width: 60px;
    margin-left: 4px
}

/* ═══════════════════════════════════════════════
   USAGE PANEL & FAB
   ═══════════════════════════════════════════════ */
.usage-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: all 0.2s ease;
}

.usage-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: #21bf75
}

.usage-fab.active {
    background: #f0fdf4;
    border-color: #21bf75;
    color: white
}

.usage-panel {
    position: fixed;
    bottom: 74px;
    left: 20px;
    width: 320px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    animation: slideUpFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.usage-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.usage-panel-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.usage-panel-footer {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    text-align: center
}

.usage-metric-card {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease
}

.usage-metric-card.primary {
    background: #ecfdf5;
    border-color: #dcfce7
}

.usage-metric-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px
}

.usage-metric-card.primary .usage-metric-label {
    color: #059669
}

.usage-metric-value {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b
}

.usage-metric-card.primary .usage-metric-value {
    color: #064e3b
}

.usage-metric-val-sm {
    font-size: 15px;
    font-weight: 700;
    color: #334155
}

.usage-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.usage-close-btn:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, .3);
    transform: rotate(90deg);
}

.usage-panel.closing {
    animation: fadeOutDown 0.2s ease-in forwards
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0)
    }

    to {
        opacity: 0;
        transform: translateY(10px)
    }
}

/* Usage Badge */
.usage-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 9px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    color: #64748b;
    margin-top: 6px;
    user-select: none;
    transition: all 0.2s;
}

.usage-badge:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569
}

.usage-badge::before {
    content: '💰';
    font-size: 10px
}

/* ═══════════════════════════════════════════════
   DROPDOWN
   ═══════════════════════════════════════════════ */
.mdd {
    position: relative
}

.mdd-m {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 4px;
    background: white;
    border: 1px solid #d1fae5;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    z-index: 50;
    min-width: 150px;
    overflow: hidden;
}

.mdd-m.show {
    display: block
}

.mdd-i {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s
}

.mdd-i:hover {
    background: #f0fdf4
}

.mdd-i.am {
    background: #d1fae5;
    color: #128050
}

/* ═══════════════════════════════════════════════
   ACTION FLOW DIAGRAM (inline)
   ═══════════════════════════════════════════════ */
.flow-container {
    width: 100%;
    min-height: 320px;
    max-height: 550px;
    overflow-y: auto;
    overflow-x: auto;
    background: linear-gradient(135deg, #f8fffe 0%, #f0fdf4 100%);
    border: 1.5px solid #d1fae5;
    border-radius: 16px;
    padding: 24px;
    position: relative;
    animation: fu .25s ease both;
}

.flow-container::-webkit-scrollbar {
    width: 5px;
    height: 5px
}

.flow-container::-webkit-scrollbar-thumb {
    background: #86efac;
    border-radius: 4px
}

.flow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.flow-title {
    font-size: 13px;
    font-weight: 800;
    color: #18a562;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flow-close-btn {
    padding: 6px 16px;
    border-radius: 10px;
    border: 1.5px solid #fecaca;
    background: #fef2f2;
    color: #ef4444;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.flow-close-btn:hover {
    border-color: #ef4444;
    color: #fff;
    background: #ef4444;
    box-shadow: 0 2px 10px rgba(239, 68, 68, .25);
}

.flow-canvas {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 10px 0 20px;
    min-width: min-content;
    position: relative;
}

/* Flow Nodes */
.flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    z-index: 2
}

.flow-node-card {
    width: 200px;
    background: white;
    border: 2px solid #d1fae5;
    border-radius: 14px;
    padding: 14px 16px;
    text-align: center;
    transition: all .2s;
    cursor: default;
    position: relative;
    box-shadow: 0 2px 8px rgba(33, 191, 117, .06);
}

.flow-node-card:hover {
    border-color: #21bf75;
    box-shadow: 0 6px 20px rgba(33, 191, 117, .12);
    transform: translateY(-2px)
}

.flow-node-start .flow-node-card {
    background: linear-gradient(135deg, #18a562, #21bf75);
    border-color: #128050;
    color: white;
    box-shadow: 0 4px 16px rgba(33, 191, 117, .3);
}

.flow-node-start .flow-node-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(33, 191, 117, .4)
}

.flow-node-start .flow-step-num {
    background: rgba(255, 255, 255, .25);
    color: white;
    border-color: rgba(255, 255, 255, .3)
}

.flow-node-start .flow-step-label {
    color: rgba(255, 255, 255, .85)
}

.flow-node-start .flow-step-text {
    color: white
}

.flow-node-end .flow-node-card {
    background: linear-gradient(135deg, #0c5c39, #128050);
    border-color: #073a24;
    color: white;
    box-shadow: 0 4px 16px rgba(12, 92, 57, .3);
}

.flow-node-end .flow-node-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(12, 92, 57, .4)
}

.flow-node-end .flow-step-num {
    background: rgba(255, 255, 255, .2);
    color: white;
    border-color: rgba(255, 255, 255, .3)
}

.flow-node-end .flow-step-label {
    color: rgba(255, 255, 255, .8)
}

.flow-node-end .flow-step-text {
    color: white
}

/* Decision diamond */
.flow-node-decision {
    align-items: center
}

.flow-diamond-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px
}

.flow-diamond {
    width: 140px;
    height: 140px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: 2.5px solid #d97706;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(245, 158, 11, .25);
    transition: all .2s;
}

.flow-diamond:hover {
    box-shadow: 0 8px 24px rgba(245, 158, 11, .35);
    transform: rotate(45deg) translateY(-2px)
}

.flow-diamond-inner {
    transform: rotate(-45deg);
    text-align: center;
    width: 100px
}

.flow-diamond-inner .flow-step-num {
    background: rgba(255, 255, 255, .35);
    color: white;
    border-color: rgba(255, 255, 255, .5)
}

.flow-diamond-inner .flow-step-text {
    color: white;
    font-size: 10px
}

.flow-diamond-branches {
    display: flex;
    gap: 20px;
    margin-top: 4px
}

.flow-branch-yes {
    font-size: 9px;
    font-weight: 800;
    color: #16a34a;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 6px
}

.flow-branch-no {
    font-size: 9px;
    font-weight: 800;
    color: #dc2626;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 6px
}

/* Flow meta */
.flow-step-meta {
    margin-top: 8px;
    text-align: center;
    max-width: 200px
}

.flow-pre,
.flow-post {
    font-size: 9px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.4
}

.flow-pre span,
.flow-post span {
    font-weight: 800;
    color: #64748b
}

.flow-manual-badge {
    margin-top: 6px;
    font-size: 9px;
    font-weight: 800;
    color: #7c3aed;
    background: #f3e8ff;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block
}

.flow-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8faf2;
    border: 2px solid #21bf75;
    color: #18a562;
    font-size: 12px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.flow-step-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 4px;
}

.flow-step-text {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    line-height: 1.4;
    word-break: break-word
}

/* Connector Arrow */
.flow-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 56px;
    position: relative;
    z-index: 1;
    align-self: center
}

.flow-arrow-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #86efac, #21bf75);
    position: relative;
    border-radius: 1px
}

.flow-arrow-line::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid #21bf75;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent
}

.flow-arrow-line::before {
    content: "";
    position: absolute;
    left: 0;
    top: -2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #21bf75;
    animation: flowPulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(33, 191, 117, .4)
}

@keyframes flowPulse {
    0% {
        left: 0;
        opacity: 0
    }

    10% {
        opacity: 1
    }

    90% {
        opacity: 1
    }

    100% {
        left: calc(100% - 6px);
        opacity: 0
    }
}

/* Flow Stats Bar */
.flow-stats-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #d1fae5
}

.flow-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b
}

.flow-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0
}

.flow-stat-dot.green {
    background: #21bf75
}

.flow-stat-dot.blue {
    background: #3b82f6
}

.flow-stat-dot.amber {
    background: #f59e0b
}

/* Flow Toggle Button */
.flow-toggle-btn {
    padding: 3px 10px;
    border-radius: 8px;
    border: 1.5px solid #21bf75;
    background: linear-gradient(135deg, #e8faf2, #d1fae5);
    color: #128050;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.flow-toggle-btn:hover {
    background: linear-gradient(135deg, #21bf75, #18a562);
    color: white;
    box-shadow: 0 2px 8px rgba(33, 191, 117, .25);
    transform: translateY(-1px)
}

.flow-toggle-btn.active {
    background: linear-gradient(135deg, #18a562, #21bf75);
    color: white;
    box-shadow: 0 3px 10px rgba(33, 191, 117, .3)
}

/* Flow Empty */
.flow-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #94a3b8
}

.flow-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: .5
}

.flow-empty-text {
    font-size: 13px;
    font-weight: 600
}

@media (max-width: 900px) {
    .flow-canvas {
        flex-wrap: wrap;
        gap: 8px
    }

    .flow-connector {
        width: 40px
    }

    .flow-node-card {
        width: 160px
    }
}

/* Mermaid */
.flow-mermaid-wrap {
    padding: 16px 0;
    overflow-x: auto;
    overflow-y: auto;
    min-height: 200px;
    max-height: 400px
}

.mermaid-flow-chart {
    display: flex;
    justify-content: center;
    min-height: 180px
}

.mermaid-flow-chart svg {
    max-width: 100%;
    height: auto
}

.flow-mermaid-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    min-height: 200px
}

/* ═══════════════════════════════════════════════
   FULL-PAGE GENERATION LOADER
   ═══════════════════════════════════════════════ */
.gen-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    animation: loaderFadeIn .25s ease both;
}

.gen-loader-overlay.hiding {
    animation: loaderFadeOut .3s ease both
}

@keyframes loaderFadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes loaderFadeOut {
    from {
        opacity: 1
    }

    to {
        opacity: 0
    }
}

.gen-loader-bars {
    width: 85px;
    height: 50px;
    --g1: conic-gradient(from 90deg at left 3px top 3px, #0000 90deg, #21bf75 0);
    --g2: conic-gradient(from -90deg at bottom 3px right 3px, #0000 90deg, #21bf75 0);
    background: var(--g1), var(--g1), var(--g1), var(--g2), var(--g2), var(--g2);
    background-position: left, center, right;
    background-repeat: no-repeat;
    animation: genBars 1s infinite;
}

@keyframes genBars {
    0% {
        background-size: 25px 50%, 25px 50%, 25px 50%
    }

    25% {
        background-size: 25px 100%, 25px 50%, 25px 50%
    }

    50% {
        background-size: 25px 50%, 25px 100%, 25px 50%
    }

    75% {
        background-size: 25px 50%, 25px 50%, 25px 100%
    }

    100% {
        background-size: 25px 50%, 25px 50%, 25px 50%
    }
}

.gen-loader-text {
    font-size: 14px;
    font-weight: 700;
    color: #18a562;
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.02em
}

.gen-loader-sub {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 2px;
    text-align: center
}

.gen-loader-phases {
    display: flex;
    gap: 10px;
    margin-top: 4px
}

.gen-phase-pill {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #94a3b8;
    transition: all .25s;
}

.gen-phase-pill.done {
    border-color: #21bf75;
    background: #e8faf2;
    color: #128050
}

.gen-phase-pill.active {
    border-color: #21bf75;
    background: linear-gradient(135deg, #18a562, #21bf75);
    color: white;
    box-shadow: 0 2px 10px rgba(33, 191, 117, .3);
    animation: phasePulse 1.2s ease-in-out infinite;
}

@keyframes phasePulse {

    0%,
    100% {
        box-shadow: 0 2px 10px rgba(33, 191, 117, .3)
    }

    50% {
        box-shadow: 0 4px 20px rgba(33, 191, 117, .5)
    }
}

/* ═══════════════════════════════════════════════
   AI CHAT PANEL — Floating Popup
   ═══════════════════════════════════════════════ */
.ai-chat-pill {
    background: linear-gradient(135deg, #f0fdf4, #d1fae5);
    color: #128050;
    border: 1.5px solid #86efac;
    font-size: 12px;
}

.ai-chat-pill:hover {
    background: linear-gradient(135deg, #21bf75, #18a562);
    color: white;
    border-color: #18a562;
    box-shadow: 0 4px 14px rgba(33, 191, 117, .2);
    transform: translateY(-1px);
}

.ai-chat-pill.ai-pill-active {
    background: linear-gradient(135deg, #18a562, #21bf75);
    color: white;
    border-color: #128050;
    box-shadow: 0 4px 14px rgba(33, 191, 117, .3);
}

.ai-chat-panel {
    position: fixed;
    right: 24px;
    bottom: 80px;
    width: 380px;
    max-width: 90vw;
    z-index: 1000;
    animation: aiPopIn .35s cubic-bezier(0.175, 0.885, 0.32, 1.15) both;
}

.ai-chat-panel.hidden {
    display: none !important
}

.ai-chat-panel.ai-panel-closing {
    animation: aiPopOut .2s ease both
}


@keyframes aiPopIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

@keyframes aiPopOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1)
    }

    to {
        opacity: 0;
        transform: translateY(20px) scale(0.9)
    }
}

.ai-panel-inner {
    background: white;
    border: 1px solid #d1fae5;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(33, 191, 117, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 520px;
    height: auto;
}

.ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e8faf2;
    background: linear-gradient(135deg, #18a562, #21bf75);
    flex-shrink: 0;
    color: white;
}

.ai-panel-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.ai-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg)
}

.ai-panel-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 200px;
    max-height: 320px;
    background: #f8fffe
}

.ai-panel-msgs::-webkit-scrollbar {
    width: 4px
}

.ai-panel-msgs::-webkit-scrollbar-thumb {
    background: #d1fae5;
    border-radius: 4px
}

.ai-panel-input-area {
    padding: 16px;
    border-top: 1px solid #e8faf2;
    background: white;
    flex-shrink: 0
}

.ai-panel-input-row {
    display: flex;
    align-items: center;
    gap: 8px
}

.ai-panel-input-field {
    flex: 1;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1.5px solid #d1fae5;
    background: #f0fdf4;
    font-size: 13px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    outline: none;
    transition: all .2s;
    color: #1e293b;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ai-panel-input-field::placeholder {
    color: #94a3b8
}

.ai-panel-input-field:focus {
    border-color: #21bf75;
    background: white;
    box-shadow: 0 0 0 4px rgba(33, 191, 117, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.02)
}

.ai-panel-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #18a562, #21bf75);
    color: white;
    font-size: 0;
    border: none;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(33, 191, 117, 0.25);
    flex-shrink: 0;
}

.ai-panel-send-btn::after {
    content: "↑";
    font-size: 18px;
    font-weight: 800
}

.ai-panel-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 191, 117, 0.35)
}

.ai-panel-send-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important
}

/* ═══════════════════════════════════════════════
   PROCESS NAV BAR (inside card body)
   ═══════════════════════════════════════════════ */
.proc-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f0fdf4;
    border-top: 1px dashed #bbf7d0;
}

.proc-nav-center {
    display: flex;
    align-items: center;
    gap: 10px
}

.proc-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1.5px solid #d1fae5;
    background: white;
    color: #128050;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    flex-shrink: 0;
}

.proc-nav-btn:hover:not([disabled]) {
    background: linear-gradient(135deg, #18a562, #21bf75);
    color: white;
    border-color: #18a562;
    box-shadow: 0 3px 10px rgba(33, 191, 117, .2);
}

.proc-nav-btn[disabled] {
    opacity: 0.25;
    cursor: not-allowed;
    color: #94a3b8;
    border-color: #e2e8f0;
    background: #fafafa
}

.proc-nav-btn .nav-tip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 7px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 100;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proc-nav-btn .nav-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}

.proc-nav-btn:hover:not([disabled]) .nav-tip {
    opacity: 1
}

.proc-nav-context {
    text-align: center;
    min-width: 100px
}

.proc-nav-context .nav-dept {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: 'JetBrains Mono', monospace
}

.proc-nav-context .nav-counter {
    font-size: 13px;
    font-weight: 800;
    color: #18a562;
    font-family: 'JetBrains Mono', monospace
}

/* Slide animations */
.proc-slide-wrapper {
    overflow: hidden
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(60px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(-60px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

.proc-slide-wrapper.slide-in-right {
    animation: slideRight 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94) both
}

.proc-slide-wrapper.slide-in-left {
    animation: slideLeft 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94) both
}

/* ═══════════════════════════════════════════════
   FULLSCREEN FLOWCHART OVERLAY
   ═══════════════════════════════════════════════ */
.flow-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flow-fullscreen-overlay.flow-fs-visible {
    opacity: 1;
    visibility: visible
}

.flow-fs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(30, 41, 59, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.flow-fs-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.flow-fs-breadcrumb-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fs-dept {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
}

.fs-sep {
    color: #475569;
    font-size: 10px;
}

.fs-proc {
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 800;
}

.flow-fs-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.flow-fs-stats-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600
}

.flow-fs-stats-inline span {
    display: flex;
    align-items: center;
    gap: 4px
}

.flow-fs-stats-inline .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block
}

.flow-fs-stats-inline .dot.g {
    background: #21bf75
}

.flow-fs-stats-inline .dot.b {
    background: #3b82f6
}

.flow-fs-stats-inline .dot.a {
    background: #f59e0b
}

.flow-fs-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.flow-fs-btn-sm:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.flow-fs-btn-sm.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.flow-fs-esc {
    margin-left: 4px;
}

.flow-fs-esc kbd {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    font-family: ui-monospace, monospace;
}

/* Chart area takes full remaining space */
.flow-fs-chart-area {
    flex: 1;
    position: relative;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px;
}

/* Mermaid wrapper fills space, scales from top-left */
.flow-fs-mermaid-wrap {
    transform-origin: top center;
    transition: transform 0.2s ease;
    min-width: 900px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-fs-mermaid-wrap .mermaid-flow-chart {
    width: 100%;
}

/* SVG inside fullscreen — force readable size */
.flow-fs-mermaid-wrap svg {
    min-width: 800px !important;
    min-height: 300px !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
}

.flow-fs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    color: #94a3b8;
}

.flow-fs-spinner {
    font-size: 32px;
    margin-bottom: 16px;
}

.flow-fs-loading-text {
    font-size: 13px;
    font-weight: 600;
}

/* Zoom controls */
.flow-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.flow-zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.flow-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.flow-zoom-level {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    padding: 2px 0;
}

.flow-fs-footer {
    display: none !important;
}

/* ═══════════════════════════════════════════════
   INLINE ADD OVERLAY
   ═══════════════════════════════════════════════ */
#inline-add-box {
    background: #ffffff !important;
    border-radius: 18px;
    padding: 24px 28px;
    width: 380px;
    max-width: 92vw;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(33, 191, 117, 0.2);
    border: 1.5px solid #d1fae5;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fu .2s ease both;
    position: relative;
    z-index: 10000;
}

#inline-add-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#inline-add-overlay.hidden {
    display: none !important
}

#inline-add-overlay:not(.hidden) {
    display: flex !important
}

.hidden {
    display: none !important;
}

/* Tech Settings Specific Styles */
.ts-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 6px;
    font-family: monospace;
}

.ts-input {
    width: 100%;
    padding: 10px 14px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.ts-input:focus {
    border-color: #21bf75;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(33, 191, 117, 0.1);
}

#pill-tech-settings.active {
    background: white;
    color: #21bf75;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ═══════════════════════════════════════════
   UI/UX Settings — Experience Studio
═══════════════════════════════════════════ */

.uiux-studio-wrap {
    background: #fff;
    border: 1px solid #d1fae5;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

/* Header */
.uiux-studio-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border-bottom: 1px solid #f0fdf4;
    background: #fff;
}

.uiux-back-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
}

.uiux-back-btn:hover {
    background: #f0fdf4;
    border-color: #21bf75;
    color: #21bf75;
}

.uiux-studio-title {
    flex: 1;
    font-size: 17px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.3px;
}

.uiux-studio-badge {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.uiux-save-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #21bf75;
    border: none;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 8px rgba(33, 191, 117, 0.25);
}

.uiux-save-btn:hover {
    background: #18a562;
    transform: scale(1.05);
}

/* Tabs Bar */
.uiux-tabs-bar {
    display: flex;
    border-bottom: 1px solid #e9f7f0;
    background: #fafafa;
}

.uiux-tab-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.uiux-tab-btn:hover {
    color: #1e293b;
    background: #f0fdf4;
}

.uiux-tab-active {
    color: #1e293b !important;
    border-bottom-color: #3b4de4 !important;
    background: #fff !important;
    font-weight: 700 !important;
}

/* Tab Content */
.uiux-tab-content {
    flex: 1;
    padding: 28px 28px 40px;
    background: #f8fafc;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Section Card */
.uiux-section {
    background: #fff;
    border: 1px solid #e9f0f5;
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.uiux-section-title {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* Form Grid */
.uiux-form-grid {
    display: grid;
    gap: 20px 32px;
}

.uiux-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.uiux-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Field */
.uiux-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.uiux-label {
    font-size: 11px;
    font-weight: 700;
    color: #21bf75;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.uiux-required {
    color: #ef4444;
}

.uiux-select-wrap {
    position: relative;
}

.uiux-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    color: #475569;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.uiux-select:focus {
    border-color: #21bf75;
    box-shadow: 0 0 0 3px rgba(33, 191, 117, 0.1);
}

.uiux-select-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 11px;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════
   PAGE LOADER overlay
   ═══════════════════════════════════════════════ */
.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.page-loader.hidden {
    display: none !important;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #21bf75;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════
   CONSTRAINT BADGES — uniform green/slate theme
   ═══════════════════════════════════════════════ */

.attr-c-badge {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    font-family: ui-monospace, monospace;
    margin-right: 3px;
    line-height: 16px;
    white-space: nowrap;
    background: #f0fdf4;
    color: #128050;
    border: 1px solid #d1fae5;
}

.attr-c-pk {
    background: #e8faf2;
    color: #0d633f;
    border-color: #86efac;
}

.attr-c-fk {
    background: #e8faf2;
    color: #0d633f;
    border-color: #86efac;
}

.attr-c-softfk {
    background: #f0fdf4;
    color: #128050;
    border: 1px dashed #86efac;
}

.softfk-indicator {
    font-size: 7px;
    font-weight: 700;
    color: #18a562;
    margin-left: 1px;
    vertical-align: super;
    line-height: 1;
}

.attr-c-uniq {
    background: #f0fdf4;
    color: #128050;
    border-color: #d1fae5;
}

.attr-c-nn {
    background: #f0fdf4;
    color: #128050;
    border-color: #d1fae5;
}

/* ATTRIBUTE TYPE BADGE */
.attr-type-badge {
    display: inline-block;
    background: #f0fdf4;
    color: #128050;
    font-size: 10px;
    font-family: ui-monospace, monospace;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #d1fae5;
    text-transform: uppercase;
}

/* REFERENCE PILL */
.attr-ref-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    font-size: 10px;
    font-weight: 600;
    color: #128050;
    font-family: ui-monospace, monospace;
}

/* SECTION GROUPING HEADER */
.section-header-row td {
    padding-top: 12px !important;
    padding-bottom: 4px !important;
}

.section-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f0fdf4;
    border: 1px solid #d1fae5;
    border-radius: 8px;
    margin-bottom: 2px;
}

.section-group-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #dcfce7;
    color: #128050;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: ui-monospace, monospace;
    flex-shrink: 0;
}

.section-group-indicator i {
    font-size: 9px;
}

.section-group-name {
    font-size: 11px;
    font-weight: 800;
    color: #0d633f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: ui-monospace, monospace;
}

/* DEP SECTION INDICATOR */
.dep-section-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: ui-monospace, monospace;
    flex-shrink: 0;
    margin-right: 4px;
}

.dep-section-indicator i {
    font-size: 9px;
}

.dep-sec-type-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
}

.dep-sec-type-badge.collection {
    background: #ecfdf5;
    color: #128050;
    border: 1px solid #d1fae5;
}

.dep-sec-type-badge.nested {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* DEP SECTION CARD (override) */
.dep-section-card {
    background: #fafbfc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 4px 0;
    border-left: 3px solid #c4b5fd;
}

.dep-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

/* INLINE FLOW CONTAINER */
.flow-inline-container {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.flow-inline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.flow-inline-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
    font-family: ui-monospace, monospace;
}

.flow-inline-actions {
    display: flex;
    gap: 4px;
}

.flow-inline-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.15s;
}

.flow-inline-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.flow-inline-btn.flow-inline-close:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}

/* Inline diagram — scroll horizontally, minimum width */
.flow-inline-diagram {
    padding: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-inline-diagram .mermaid-flow-chart {
    min-width: 700px;
}

.flow-inline-diagram svg {
    min-width: 600px !important;
    height: auto !important;
    min-height: 180px !important;
    max-width: none !important;
}

.flow-inline-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 10px;
}

/* DROPDOWN SOURCE */
.dd-source-static,
.dd-source-linked,
.dd-source-empty {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    line-height: 1.4;
}

.dd-source-static {
    background: #f0fdf4;
    border: 1px solid #d1fae5;
}

.dd-source-linked {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}

.dd-source-empty {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.dd-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: ui-monospace, monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.dd-source-badge.static {
    background: #dcfce7;
    color: #0d633f;
    border: 1px solid #bbf7d0;
}

.dd-source-badge.linked {
    background: #d1fae5;
    color: #0d633f;
    border: 1px solid #86efac;
}

.dd-source-badge.empty {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.dd-source-badge i {
    font-size: 8px;
}

.dd-enum-values {
    color: #128050;
    font-weight: 600;
    font-size: 10px;
    word-break: break-word;
    line-height: 1.4;
}

.dd-source-detail {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dd-entity-name {
    font-weight: 800;
    color: #0d633f;
    font-size: 10px;
    font-family: ui-monospace, monospace;
}

.dd-field-map {
    font-size: 9px;
    color: #18a562;
    font-family: ui-monospace, monospace;
    font-weight: 600;
}

.dd-dep-hint {
    font-size: 8px;
    color: #64748b;
    font-style: italic;
}

#am-dd-config input[type="radio"] {
    accent-color: #21bf75;
}


/* ═══════════════════════════════════════════════════════════════
   ██████  RESPONSIVE BREAKPOINTS  ██████
   All responsive rules — nothing collapses, everything scales
   ═══════════════════════════════════════════════════════════════ */

/* ─── TABLET LANDSCAPE & SMALL DESKTOP (≤1200px) ─── */
@media (max-width: 1200px) {
    .og {
        grid-template-columns: repeat(2, 1fr);
    }

    .uiux-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .flow-fs-mermaid-wrap {
        min-width: 700px;
    }

    .flow-fs-mermaid-wrap svg {
        min-width: 600px !important;
    }

    .flow-fs-chart-area {
        padding: 24px;
    }

    .flow-fs-stats-inline {
        gap: 8px;
        font-size: 10px;
    }
}

/* ─── TABLET PORTRAIT (≤1024px) ─── */
@media (max-width: 1024px) {

    /* Sidebar auto-collapse on tablets */
    #sidebar {
        position: fixed;
        z-index: 50;
        height: 100vh;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    /* Department split — narrower left panel */
    .dept-split-grid {
        grid-template-columns: 180px 1fr;
    }

    /* Preview zone padding */
    #preview-zone {
        padding: 16px 20px;
    }

    /* Objects grid 2-col */
    .obj-row-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* UIUX grids */
    .uiux-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .uiux-tab-content {
        padding: 20px 20px 32px;
    }

    .uiux-section {
        padding: 18px 20px;
    }

    /* Flow nodes smaller */
    .flow-node-card {
        width: 170px;
        padding: 12px 14px;
    }

    .flow-connector {
        width: 44px;
    }

    .flow-diamond {
        width: 120px;
        height: 120px;
    }

    .flow-diamond-inner {
        width: 85px;
    }

    /* Usage panel */
    .usage-panel {
        width: 290px;
    }

    /* AI Chat panel */
    .ai-chat-panel {
        width: 340px;
        bottom: 70px;
        right: 16px;
    }

    /* Confirm bar */
    .cb {
        padding: 10px 20px;
    }

    /* Stat grid */
    .sg {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* ─── TABLET SMALL / LARGE PHONE LANDSCAPE (≤768px) ─── */
@media (max-width: 768px) {

    /* Body flex direction stays row — sidebar overlays */
    body {
        font-size: 14px;
    }

    /* Sidebar overlay mode */
    #sidebar {
        position: fixed;
        z-index: 50;
        height: 100vh;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
        left: 0;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s;
    }

    #sidebar.collapsed {
        transform: translateX(-100%);
        width: 224px !important;
        /* Keep width so it slides out */
    }

    .sb-close-btn {
        display: flex;
    }

    /* Topbar compact */
    #main>.bg-white.border-b {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Department split — stack but keep both visible */
    .dept-split-grid {
        grid-template-columns: 160px 1fr;
    }

    .dept-left-panel {
        min-width: 160px;
    }

    /* Preview zone */
    #preview-zone {
        padding: 12px 14px;
    }

    /* Cards row — 2 col */
    .cards-row-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* Stat card compact */
    .stat-card-compact {
        padding: 8px 10px;
        gap: 8px;
    }

    .stat-card-compact .stat-card-value {
        font-size: 16px;
    }

    .stat-card-compact .stat-card-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    /* Process cards 1-col */
    .proc-cards-grid {
        grid-template-columns: 1fr;
        max-height: none;
    }

    /* Pane cards stack */
    .proc-combined-tab {
        grid-template-columns: 1fr;
    }

    /* Objects 2-col */
    .obj-row-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .og {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* UIUX grids */
    .uiux-grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .uiux-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .uiux-studio-header {
        padding: 12px 16px;
        gap: 8px;
    }

    .uiux-studio-title {
        font-size: 15px;
    }

    /* Tabs scrollable */
    .uiux-tabs-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .uiux-tabs-bar::-webkit-scrollbar {
        display: none;
    }

    .uiux-tab-btn {
        padding: 12px 16px;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Flow canvas scroll */
    .flow-container {
        padding: 16px;
        min-height: 260px;
    }

    .flow-canvas {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .flow-node-card {
        width: 160px;
        padding: 10px 12px;
    }

    .flow-step-text {
        font-size: 11px;
    }

    .flow-connector {
        width: 36px;
    }

    .flow-diamond {
        width: 110px;
        height: 110px;
    }

    .flow-diamond-inner {
        width: 78px;
    }

    .flow-stats-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Modals */
    .mo>div {
        margin: 12px;
    }

    #new-modal .bg-white,
    #ai-modal .bg-white,
    #revise-modal .bg-white {
        width: calc(100vw - 24px);
        max-width: 420px;
    }

    #add-modal .bg-white {
        width: calc(100vw - 24px);
        max-width: 520px;
    }

    /* Inline add box */
    #inline-add-box {
        width: calc(100vw - 32px);
        max-width: 380px;
        padding: 20px 22px;
    }

    /* AI Chat panel */
    .ai-chat-panel {
        width: calc(100vw - 32px);
        max-width: 380px;
        right: 16px;
        bottom: 68px;
    }

    .ai-panel-inner {
        max-height: 480px;
    }

    /* Usage panel */
    .usage-panel {
        width: 280px;
        left: 12px;
        bottom: 68px;
    }

    .usage-fab {
        width: 40px;
        height: 40px;
        font-size: 16px;
        bottom: 16px;
        left: 12px;
    }

    /* Confirm bar */
    .cb {
        padding: 10px 16px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .cb button {
        font-size: 12px;
        padding: 6px 12px;
    }

    /* Fullscreen flow */
    .flow-fs-header {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .flow-fs-breadcrumb-inline {
        gap: 6px;
    }

    .fs-proc {
        font-size: 12px;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .flow-fs-stats-inline {
        display: none;
    }

    .flow-fs-chart-area {
        padding: 16px;
    }

    .flow-fs-mermaid-wrap {
        min-width: 600px;
    }

    .flow-fs-mermaid-wrap svg {
        min-width: 500px !important;
        min-height: 200px !important;
    }

    /* Proc body inner */
    .proc-body-inner {
        padding: 14px;
    }

    /* Proc nav bar */
    .proc-nav-bar {
        padding: 8px 12px;
        gap: 8px;
    }

    .proc-nav-btn {
        padding: 5px 10px;
        font-size: 10px;
    }

    .proc-nav-context {
        min-width: 80px;
    }

    /* Gen loader */
    .gen-loader-phases {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .gen-phase-pill {
        font-size: 9px;
        padding: 3px 10px;
    }

    /* Inline flow */
    .flow-inline-diagram {
        padding: 14px;
        min-height: 180px;
    }

    .flow-inline-diagram .mermaid-flow-chart {
        min-width: 500px;
    }

    /* Dropdown */
    .mdd-m {
        min-width: 130px;
    }

    /* Summary panel body */
    .summary-panel-body {
        max-height: 250px;
    }

    /* Stat panel */
    .stat-panel {
        padding: 14px 16px;
    }

    .sg {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 8px;
    }
}

/* ─── PHONE LANDSCAPE / SMALL TABLET (≤640px) ─── */
@media (max-width: 640px) {

    /* Department split — narrower */
    .dept-split-grid {
        grid-template-columns: 140px 1fr;
    }

    .dept-left-panel {
        min-width: 140px;
    }

    .di {
        padding: 6px 8px;
        gap: 6px;
        font-size: 12px;
    }

    /* Objects 1-col on small screens */
    .obj-row-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .og {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .oc {
        padding: 10px;
    }

    /* UIUX grids single col */
    .uiux-grid-2 {
        grid-template-columns: 1fr;
    }

    .uiux-grid-3 {
        grid-template-columns: 1fr;
    }

    .uiux-tab-content {
        padding: 16px 14px 28px;
        gap: 14px;
    }

    .uiux-section {
        padding: 14px 16px;
        border-radius: 12px;
    }

    .uiux-section-title {
        font-size: 13px;
        margin-bottom: 14px;
    }

    /* Pane cards */
    .pane-card {
        padding: 10px;
        border-radius: 10px;
    }

    .pane-card .scroll-area {
        max-height: 160px;
    }

    /* Flow */
    .flow-container {
        padding: 12px;
        border-radius: 12px;
    }

    .flow-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .flow-title {
        font-size: 11px;
    }

    .flow-node-card {
        width: 140px;
        padding: 8px 10px;
        border-radius: 10px;
    }

    .flow-step-num {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .flow-step-text {
        font-size: 10px;
    }

    .flow-step-label {
        font-size: 8px;
    }

    .flow-connector {
        width: 30px;
    }

    .flow-diamond {
        width: 100px;
        height: 100px;
    }

    .flow-diamond-inner {
        width: 70px;
    }

    .flow-diamond-inner .flow-step-text {
        font-size: 9px;
    }

    /* Cards row */
    .cards-row-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .stat-card-compact {
        padding: 8px;
        gap: 6px;
        border-radius: 10px;
    }

    .stat-card-compact .stat-card-value {
        font-size: 15px;
    }

    .stat-card-compact .stat-card-label {
        font-size: 8px;
    }

    .stat-card-compact .stat-card-icon {
        width: 26px;
        height: 26px;
        font-size: 12px;
        border-radius: 6px;
    }

    /* Obj mini card */
    .obj-mini-card {
        padding: 8px;
        border-radius: 8px;
    }

    /* Confirm bar */
    .cb {
        padding: 8px 12px;
        gap: 6px;
    }

    .cb .text-sm {
        font-size: 12px;
    }

    .cb .text-xs {
        font-size: 10px;
    }

    /* AI Chat panel full width minus margins */
    .ai-chat-panel {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 64px;
    }

    .ai-panel-msgs {
        min-height: 160px;
        max-height: 260px;
        padding: 14px;
    }

    .ai-panel-input-area {
        padding: 12px;
    }

    .ai-panel-input-field {
        padding: 10px 12px;
        font-size: 12px;
    }

    .ai-panel-send-btn {
        width: 38px;
        height: 38px;
    }

    /* Usage panel */
    .usage-panel {
        width: calc(100vw - 24px);
        left: 12px;
        bottom: 64px;
        max-width: 320px;
    }

    .usage-panel-body {
        padding: 14px;
        gap: 10px;
    }

    .usage-metric-value {
        font-size: 18px;
    }

    /* Fullscreen flow */
    .flow-fs-header {
        padding: 8px 12px;
    }

    .fs-dept {
        font-size: 11px;
    }

    .fs-proc {
        font-size: 11px;
        max-width: 150px;
    }

    .flow-fs-btn-sm {
        padding: 5px 10px;
        font-size: 11px;
    }

    .flow-fs-chart-area {
        padding: 12px;
    }

    .flow-fs-mermaid-wrap {
        min-width: 500px;
    }

    .flow-zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Proc card top */
    .proc-card-top {
        padding: 8px 10px;
        gap: 4px;
    }

    .proc-card-row1 .proc-title-text {
        font-size: 12px;
    }

    .proc-badge-row .pbadge {
        font-size: 9px;
        padding: 1px 4px;
    }

    .proc-freq-inline {
        font-size: 8px;
        padding: 1px 5px;
    }

    /* Nav bar */
    .proc-nav-bar {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px;
    }

    .proc-nav-center {
        gap: 6px;
    }

    .proc-nav-context .nav-counter {
        font-size: 11px;
    }

    /* Dep sections */
    .dep-section-card {
        padding: 8px 10px !important;
    }

    .dep-section-header {
        gap: 4px;
    }

    /* Collapse sections */
    .collapse-btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    .collapse-body {
        padding: 10px;
    }

    /* Handle */
    .handle-brand {
        font-size: 13px;
    }

    /* Gen loader */
    .gen-loader-text {
        font-size: 13px;
    }

    .gen-loader-sub {
        font-size: 10px;
    }

    .gen-loader-bars {
        width: 70px;
        height: 40px;
    }
}

/* ─── PHONE PORTRAIT (≤480px) ─── */
@media (max-width: 480px) {

    /* Department panel — thinner */
    .dept-split-grid {
        grid-template-columns: 120px 1fr;
    }

    .dept-left-panel {
        min-width: 120px;
    }

    .di {
        padding: 5px 6px;
        gap: 5px;
        font-size: 11px;
        margin: 1px 2px;
        border-radius: 6px;
    }

    /* Topbar */
    #main>.bg-white.border-b {
        padding-left: 8px;
        padding-right: 8px;
        gap: 6px;
    }

    #stage-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    #draft-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    /* Preview zone */
    /* Preview zone */
    #preview-zone {
        padding: 8px 10px;
    }

    /* Cards row */
    .cards-row-layout {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }

    .stat-card-compact {
        padding: 6px 8px;
        gap: 5px;
        border-radius: 8px;
    }

    .stat-card-compact .stat-card-value {
        font-size: 14px;
    }

    .stat-card-compact .stat-card-label {
        font-size: 7px;
        letter-spacing: 0.04em;
    }

    .stat-card-compact .stat-card-icon {
        width: 24px;
        height: 24px;
        font-size: 11px;
        border-radius: 6px;
    }

    /* Process cards */
    .proc-cards-grid {
        gap: 6px;
    }

    .proc-card-top {
        padding: 7px 8px;
        gap: 3px;
    }

    .proc-card-row1 .proc-title-text {
        font-size: 11px;
    }

    .proc-card-row1 {
        gap: 5px;
    }

    .proc-card-row2 {
        gap: 4px;
    }

    .proc-badge-row .pbadge {
        font-size: 8px;
        padding: 0px 3px;
        border-radius: 6px;
    }

    .proc-freq-inline {
        font-size: 7px;
        padding: 0px 4px;
    }

    .proc-revise-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .proc-rm-btn {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .proc-arrow-icon {
        font-size: 9px;
    }

    /* Process body */
    .proc-body-inner {
        padding: 10px;
    }

    /* Pane cards */
    .proc-combined-tab {
        gap: 8px;
    }

    .pane-card {
        padding: 8px;
        border-radius: 8px;
    }

    .pane-header {
        margin-bottom: 6px;
    }

    .pane-label {
        font-size: 9px;
    }

    .pane-card .scroll-area {
        max-height: 140px;
    }

    /* Objects */
    .obj-row-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .og {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .oc {
        padding: 8px 10px;
        border-radius: 10px;
    }

    .obj-mini-card {
        padding: 6px 8px;
        border-radius: 6px;
    }

    .obj-badge-type,
    .obj-badge-attr {
        font-size: 8px;
        padding: 0px 4px;
    }

    .obj-attr-inner-wrap {
        padding: 10px 12px;
    }

    .obj-attr-scroll-area {
        max-height: 300px !important;
    }

    /* UIUX Studio */
    .uiux-studio-wrap {
        min-height: 400px;
        border-radius: 14px;
    }

    .uiux-studio-header {
        padding: 10px 12px;
        gap: 6px;
    }

    .uiux-studio-title {
        font-size: 13px;
    }

    .uiux-studio-badge {
        font-size: 11px;
    }

    .uiux-save-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
        border-radius: 8px;
    }

    .uiux-back-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .uiux-tabs-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .uiux-tab-btn {
        padding: 10px 12px;
        font-size: 11px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .uiux-tab-content {
        padding: 12px 10px 24px;
        gap: 12px;
    }

    .uiux-section {
        padding: 12px 12px;
        border-radius: 10px;
    }

    .uiux-section-title {
        font-size: 12px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .uiux-form-grid {
        gap: 14px 16px;
    }

    .uiux-label {
        font-size: 10px;
    }

    .uiux-select {
        padding: 8px 30px 8px 10px;
        font-size: 12px;
        border-radius: 8px;
    }

    /* Flow */
    .flow-container {
        padding: 10px;
        border-radius: 10px;
        min-height: 220px;
    }

    .flow-header {
        margin-bottom: 12px;
    }

    .flow-title {
        font-size: 10px;
        gap: 5px;
    }

    .flow-close-btn {
        padding: 4px 10px;
        font-size: 10px;
        border-radius: 8px;
    }

    .flow-node-card {
        width: 120px;
        padding: 7px 8px;
        border-radius: 8px;
        border-width: 1.5px;
    }

    .flow-step-num {
        width: 20px;
        height: 20px;
        font-size: 9px;
        margin-bottom: 5px;
        border-width: 1.5px;
    }

    .flow-step-label {
        font-size: 7px;
        margin-bottom: 2px;
    }

    .flow-step-text {
        font-size: 9px;
    }

    .flow-connector {
        width: 24px;
    }

    .flow-arrow-line::after {
        border-left-width: 6px;
        border-top-width: 4px;
        border-bottom-width: 4px;
    }

    .flow-diamond {
        width: 85px;
        height: 85px;
        border-radius: 8px;
    }

    .flow-diamond-inner {
        width: 60px;
    }

    .flow-diamond-inner .flow-step-text {
        font-size: 8px;
    }

    .flow-diamond-branches {
        gap: 10px;
    }

    .flow-branch-yes,
    .flow-branch-no {
        font-size: 8px;
        padding: 1px 6px;
    }

    .flow-stats-bar {
        gap: 8px;
        padding-top: 10px;
        margin-top: 12px;
    }

    .flow-stat {
        font-size: 10px;
        gap: 4px;
    }

    .flow-stat-dot {
        width: 6px;
        height: 6px;
    }

    .flow-toggle-btn {
        font-size: 9px;
        padding: 2px 8px;
    }

    .flow-step-meta {
        max-width: 120px;
    }

    .flow-pre,
    .flow-post {
        font-size: 8px;
    }

    .flow-manual-badge {
        font-size: 8px;
        padding: 1px 6px;
    }

    /* Inline flow */
    .flow-inline-header {
        padding: 6px 10px;
    }

    .flow-inline-title {
        font-size: 9px;
    }

    .flow-inline-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .flow-inline-diagram {
        padding: 10px;
        min-height: 160px;
    }

    .flow-inline-diagram .mermaid-flow-chart {
        min-width: 400px;
    }

    /* Fullscreen flow */
    .flow-fs-header {
        padding: 6px 10px;
    }

    .flow-fs-breadcrumb-inline {
        gap: 4px;
    }

    .fs-dept {
        font-size: 10px;
    }

    .fs-proc {
        font-size: 10px;
        max-width: 120px;
    }

    .flow-fs-btn-sm {
        padding: 4px 8px;
        font-size: 10px;
        gap: 4px;
    }

    .flow-fs-esc {
        display: none;
    }

    .flow-fs-chart-area {
        padding: 8px;
    }

    .flow-fs-mermaid-wrap {
        min-width: 400px;
    }

    .flow-fs-mermaid-wrap svg {
        min-width: 380px !important;
        min-height: 160px !important;
    }

    .flow-zoom-controls {
        bottom: 12px;
        right: 12px;
    }

    .flow-zoom-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
        border-radius: 8px;
    }

    .flow-zoom-level {
        font-size: 9px;
    }

    /* Modals */
    #new-modal .bg-white,
    #ai-modal .bg-white,
    #revise-modal .bg-white,
    #add-modal .bg-white {
        width: calc(100vw - 16px);
        padding: 16px;
        border-radius: 16px;
    }

    #new-modal h3,
    #ai-modal h3,
    #revise-modal h3,
    #add-modal h3 {
        font-size: 14px;
    }

    #ai-q,
    #revise-q {
        min-height: 60px;
        font-size: 12px;
    }

    /* Inline add */
    #inline-add-box {
        width: calc(100vw - 20px);
        padding: 16px 18px;
        border-radius: 14px;
        gap: 10px;
    }

    #ia-input {
        font-size: 12px;
        padding: 8px 10px;
    }

    /* Confirm bar */
    .cb {
        padding: 6px 10px;
        gap: 6px;
    }

    .cb .text-sm {
        font-size: 11px;
    }

    .cb .text-xs {
        font-size: 9px;
    }

    .cb button {
        font-size: 11px;
        padding: 5px 10px;
        border-radius: 8px;
    }

    /* AI Chat panel */
    .ai-chat-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 60px;
    }

    .ai-panel-inner {
        max-height: 440px;
        border-radius: 16px;
    }

    .ai-panel-header {
        padding: 12px 14px;
    }

    .ai-panel-msgs {
        min-height: 140px;
        max-height: 220px;
        padding: 12px;
    }

    .ai-panel-input-area {
        padding: 10px;
    }

    .ai-panel-input-field {
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 10px;
    }

    .ai-panel-send-btn {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .ai-panel-close {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    /* Usage panel & FAB */
    .usage-fab {
        width: 36px;
        height: 36px;
        font-size: 14px;
        bottom: 12px;
        left: 8px;
        border-radius: 10px;
    }

    .usage-panel {
        width: calc(100vw - 16px);
        left: 8px;
        bottom: 56px;
        border-radius: 16px;
        max-width: none;
    }

    .usage-panel-header {
        padding: 12px 14px;
    }

    .usage-panel-body {
        padding: 12px;
        gap: 8px;
    }

    .usage-metric-card {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .usage-metric-label {
        font-size: 10px;
    }

    .usage-metric-value {
        font-size: 16px;
    }

    .usage-metric-val-sm {
        font-size: 13px;
    }

    .usage-panel-footer {
        padding: 8px 14px;
    }

    .usage-close-btn {
        width: 24px;
        height: 24px;
    }

    /* Proc nav bar */
    .proc-nav-bar {
        padding: 6px 8px;
        gap: 4px;
    }

    .proc-nav-center {
        gap: 4px;
    }

    .proc-nav-btn {
        padding: 4px 8px;
        font-size: 9px;
        border-radius: 8px;
        gap: 4px;
    }

    .proc-nav-context {
        min-width: 60px;
    }

    .proc-nav-context .nav-dept {
        font-size: 8px;
    }

    .proc-nav-context .nav-counter {
        font-size: 10px;
    }

    /* Dep sections */
    .dep-section-card {
        padding: 6px 8px !important;
        border-radius: 8px !important;
        margin-bottom: 6px;
    }

    .dep-section-header {
        gap: 3px;
        padding-bottom: 5px;
        margin-bottom: 4px;
    }

    .dep-section-card table td {
        padding: 4px 6px 4px 0;
        font-size: 11px;
    }

    .dep-section-card .dep-section-body {
        max-height: 150px;
    }

    .dep-section-actions {
        margin-top: 8px;
        padding-top: 8px;
    }

    .dep-section-indicator {
        font-size: 7px;
        padding: 1px 5px;
    }

    .dep-sec-type-badge {
        font-size: 7px;
        padding: 0px 4px;
    }

    /* Constraint badges */
    .attr-c-badge {
        font-size: 8px;
        padding: 0px 4px;
        margin-right: 2px;
    }

    .attr-type-badge {
        font-size: 9px;
        padding: 1px 5px;
    }

    .attr-ref-pill {
        font-size: 9px;
        padding: 1px 6px;
        gap: 3px;
    }

    /* Section group header */
    .section-group-header {
        padding: 4px 8px;
        gap: 6px;
    }

    .section-group-indicator {
        font-size: 7px;
        padding: 1px 6px;
    }

    .section-group-name {
        font-size: 10px;
    }

    /* Dropdown source */
    .dd-source-static,
    .dd-source-linked,
    .dd-source-empty {
        padding: 3px 6px;
        font-size: 9px;
        gap: 4px;
    }

    .dd-source-badge {
        font-size: 7px;
        padding: 0px 4px;
    }

    .dd-enum-values {
        font-size: 9px;
    }

    .dd-entity-name {
        font-size: 9px;
    }

    .dd-field-map {
        font-size: 8px;
    }

    /* Collapse sections */
    .collapse-btn {
        padding: 7px 8px;
        font-size: 10px;
        border-radius: 8px;
    }

    .collapse-body {
        padding: 8px;
        border-radius: 0 0 8px 8px;
    }

    /* Scroll area */
    .scroll-area {
        max-height: 300px;
    }

    /* Add buttons */
    .ab {
        font-size: 9px;
        padding: 1px 6px;
        border-radius: 5px;
    }

    .add-row {
        gap: 3px;
    }

    /* Remove button */
    .rm-btn {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    /* Summary panel */
    .summary-panel-body {
        max-height: 200px;
    }

    /* Stat panel */
    .stat-panel {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .sg {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .sc {
        padding: 8px 10px;
        border-radius: 8px;
    }

    /* Gen loader */
    .gen-loader-bars {
        width: 60px;
        height: 35px;
    }

    .gen-loader-text {
        font-size: 12px;
    }

    .gen-loader-sub {
        font-size: 9px;
    }

    .gen-loader-phases {
        gap: 4px;
    }

    .gen-phase-pill {
        font-size: 8px;
        padding: 2px 8px;
    }

    /* Page loader */
    .loader-spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }

    /* Handle */
    .handle-brand {
        font-size: 12px;
    }

    .handle-hint {
        font-size: 9px;
    }

    .handle-icon-btn {
        width: 26px;
        height: 26px;
        right: 8px;
    }

    #hero-drag-handle.collapsed-state {
        height: 32px;
    }

    /* Revise icon button */
    .revise-icon-btn {
        width: 24px;
        height: 24px;
    }

    .revise-icon-btn .ri-icon {
        font-size: 11px;
    }

    /* Dropdown menu */
    .mdd-m {
        min-width: 120px;
        border-radius: 10px;
    }

    .mdd-i {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Usage badge inline */
    .usage-badge {
        font-size: 8px;
        padding: 1px 4px;
        gap: 3px;
    }

    /* Dept expand btn */
    .dept-expand-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
        border-radius: 8px;
        top: 8px;
        left: 8px;
    }

    /* Tech settings */
    .ts-label {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .ts-input {
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 8px;
    }
}

/* ─── VERY SMALL PHONES (≤360px) ─── */
@media (max-width: 360px) {

    /* Department split — minimal */
    .dept-split-grid {
        grid-template-columns: 100px 1fr;
    }

    .dept-left-panel {
        min-width: 100px;
    }

    .di {
        padding: 4px 5px;
        gap: 4px;
        font-size: 10px;
    }

    /* Cards row */
    .cards-row-layout {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }

    .stat-card-compact {
        padding: 5px 6px;
        gap: 4px;
    }

    .stat-card-compact .stat-card-value {
        font-size: 13px;
    }

    .stat-card-compact .stat-card-label {
        font-size: 7px;
    }

    .stat-card-compact .stat-card-icon {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    /* Preview */
    #preview-zone {
        padding: 6px 8px;
    }

    /* Process card */
    .proc-card-top {
        padding: 6px 7px;
    }

    .proc-card-row1 .proc-title-text {
        font-size: 10px;
    }

    /* Objects single col */
    .obj-row-grid {
        grid-template-columns: 1fr;
    }

    /* UIUX */
    .uiux-tab-content {
        padding: 10px 8px 20px;
        gap: 10px;
    }

    .uiux-section {
        padding: 10px;
    }

    .uiux-select {
        padding: 7px 26px 7px 8px;
        font-size: 11px;
    }

    /* Flow */
    .flow-node-card {
        width: 100px;
        padding: 6px 7px;
    }

    .flow-step-text {
        font-size: 8px;
    }

    .flow-step-num {
        width: 18px;
        height: 18px;
        font-size: 8px;
        margin-bottom: 4px;
    }

    .flow-connector {
        width: 18px;
    }

    .flow-diamond {
        width: 70px;
        height: 70px;
    }

    .flow-diamond-inner {
        width: 50px;
    }

    /* Modals */
    #new-modal .bg-white,
    #ai-modal .bg-white,
    #revise-modal .bg-white,
    #add-modal .bg-white {
        padding: 12px;
        border-radius: 14px;
    }

    /* Confirm bar */
    .cb {
        padding: 5px 8px;
    }

    .cb button {
        font-size: 10px;
        padding: 4px 8px;
    }

    /* AI Chat */
    .ai-chat-panel {
        width: calc(100vw - 12px);
        right: 6px;
        bottom: 56px;
    }

    .ai-panel-inner {
        max-height: 400px;
    }

    .ai-panel-msgs {
        min-height: 120px;
        max-height: 180px;
    }

    /* Usage */
    .usage-panel {
        width: calc(100vw - 12px);
        left: 6px;
        bottom: 52px;
    }

    .usage-fab {
        width: 32px;
        height: 32px;
        font-size: 13px;
        bottom: 10px;
        left: 6px;
    }

    /* Fullscreen flow */
    .flow-fs-mermaid-wrap {
        min-width: 350px;
    }

    .flow-fs-mermaid-wrap svg {
        min-width: 320px !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   TOUCH DEVICE ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .proc-revise-btn {
        width: 32px;
        height: 32px;
    }

    .proc-rm-btn {
        width: 28px;
        height: 28px;
    }

    .rm-btn {
        width: 24px;
        height: 24px;
    }

    .obj-revise-btn {
        width: 24px;
        height: 24px;
        opacity: 1;
    }

    /* Disable hover-expand on touch */
    .proc-revise-btn:hover {
        width: 32px;
        gap: 0;
        padding: 0;
    }

    .proc-revise-btn:hover .revise-text {
        max-width: 0;
        opacity: 0;
    }

    .revise-icon-btn:hover {
        width: 28px;
    }

    .revise-icon-btn:hover .ri-text {
        max-width: 0;
        margin-left: 0;
    }

    /* Better tap targets for buttons */
    .ab {
        padding: 4px 10px;
        font-size: 11px;
    }

    .collapse-btn {
        padding: 12px 14px;
    }

    .flow-toggle-btn {
        padding: 5px 12px;
        font-size: 11px;
    }

    .flow-close-btn {
        padding: 7px 16px;
    }

    .proc-nav-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Disable hover tooltips on touch */
    .proc-nav-btn .nav-tip {
        display: none !important;
    }

    /* Smooth scrolling on touch */
    .proc-cards-grid,
    .pane-card .scroll-area,
    .obj-attr-inner-wrap,
    .obj-attr-scroll-area,
    .dep-section-card .dep-section-body,
    .flow-container,
    .scroll-area {
        -webkit-overflow-scrolling: touch;
    }

    /* Modal buttons bigger */
    .mo button {
        min-height: 40px;
    }

    /* Dropdown items bigger */
    .mdd-i {
        padding: 10px 14px;
    }

    /* Drag handle bigger touch area */
    #hero-drag-handle {
        height: 12px;
    }

    #hero-drag-handle.collapsed-state {
        height: 40px;
    }
}


/* ═══════════════════════════════════════════════════════════════
   LANDSCAPE PHONE SPECIFIC
   ═══════════════════════════════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {

    /* Reduce vertical spacing */
    .cards-row-layout {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .stat-card-compact {
        padding: 5px 8px;
    }

    /* Proc cards scrollable shorter */
    .proc-cards-grid {
        max-height: 280px;
    }

    /* Modals scroll */
    .mo>div {
        max-height: 90vh;
        overflow-y: auto;
    }

    /* AI Panel shorter */
    .ai-panel-inner {
        max-height: 360px;
    }

    .ai-panel-msgs {
        min-height: 100px;
        max-height: 160px;
    }

    /* Usage panel shorter */
    .usage-panel {
        max-height: 300px;
        overflow-y: auto;
    }

    /* Gen loader compact */
    .gen-loader-overlay {
        gap: 12px;
    }

    .gen-loader-bars {
        width: 60px;
        height: 35px;
    }

    /* Flow container shorter */
    .flow-container {
        max-height: 350px;
    }

    /* Fullscreen flow use full height */
    .flow-fs-header {
        height: 40px;
        padding: 4px 12px;
    }
}


/* ═══════════════════════════════════════════════════════════════
   HIGH DPI / RETINA ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════ */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    /* Sharper borders on retina */
    .proc-card-unified,
    .pane-card,
    .obj-mini-card,
    .flow-container,
    .flow-node-card {
        border-width: 1px;
    }

    .proc-card-unified.is-open {
        border-width: 1px;
    }

    ::-webkit-scrollbar {
        width: 3px;
        height: 3px;
    }
}


/* ═══════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════ */
@media print {
    body {
        overflow: visible !important;
        height: auto !important;
    }

    #sidebar,
    .usage-fab,
    .usage-panel,
    .ai-chat-panel,
    .ai-chat-pill,
    #hero-drag-handle,
    .cb,
    .mo,
    #inline-add-overlay,
    .page-loader,
    .gen-loader-overlay,
    .flow-fullscreen-overlay,
    .proc-revise-btn,
    .proc-rm-btn,
    .rm-btn,
    .obj-revise-btn,
    .revise-icon-btn,
    .flow-toggle-btn,
    .flow-close-btn,
    .dept-expand-btn,
    .handle-icon-btn,
    .proc-nav-bar {
        display: none !important;
    }

    #main {
        overflow: visible !important;
        height: auto !important;
    }

    #scroll-wrap {
        overflow: visible !important;
        height: auto !important;
    }

    .proc-cards-grid {
        max-height: none !important;
        overflow: visible !important;
    }

    .proc-card-unified {
        break-inside: avoid;
    }

    .stat-card-compact {
        box-shadow: none !important;
        border: 1px solid #d1fae5 !important;
    }

    .btn-g {
        box-shadow: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   StakeholderAI — Modal & Components
   ═══════════════════════════════════════════════════════════════ */

.sai-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.sai-overlay.sai-visible {
    opacity: 1;
    visibility: visible;
}

.sai-card {
    background: #ffffff;
    border-radius: 20px;
    width: 520px;
    max-width: 94vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transform: translateY(16px) scale(0.96);
    transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.15), opacity 0.2s ease;
    opacity: 0;
}

.sai-visible .sai-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.sai-header {
    padding: 16px 20px 12px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-bottom: 1px solid #bbf7d0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sai-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sai-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #18a562, #21bf75);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(33, 191, 117, 0.35);
}

.sai-title {
    font-size: 14px;
    font-weight: 800;
    color: #15803d;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.sai-subtitle {
    font-size: 10px;
    font-weight: 600;
    color: #4ade80;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sai-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #ef4444;
    transition: all 0.15s;
}

.sai-close:hover {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, .3);
    transform: rotate(90deg);
}

.sai-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.sai-textarea {
    width: 100%;
    padding: 12px 14px;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 12px;
    font-size: 13px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    outline: none;
    resize: vertical;
    min-height: 70px;
    transition: border-color 0.15s;
}

.sai-textarea:focus {
    border-color: #21bf75;
    box-shadow: 0 0 0 3px rgba(33, 191, 117, 0.1);
}

.sai-status {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.sai-status-loading {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.sai-status-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.sai-status-warn {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.sai-footer {
    padding: 12px 20px 16px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #f0fdf4;
}

.sai-btn-cancel {
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all 0.15s;
}

.sai-btn-cancel:hover {
    background: #e2e8f0;
    color: #475569;
}

.sai-btn-go {
    padding: 9px 22px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #18a562, #21bf75);
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    box-shadow: 0 3px 10px rgba(33, 191, 117, 0.3);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sai-btn-go:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.sai-btn-go:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.sai-btn-apply {
    padding: 9px 22px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #18a562, #21bf75);
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    box-shadow: 0 3px 10px rgba(33, 191, 117, 0.3);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sai-btn-apply:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.sai-btn-apply-revise {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

/* ── Result cards ── */
.sai-result {
    margin-top: 12px;
}

.sai-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sai-result-count {
    font-size: 11px;
    font-weight: 800;
    color: #15803d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sai-select-all {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
}

.sai-result-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.sai-result-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sai-result-card:hover {
    border-color: #bbf7d0;
    box-shadow: 0 2px 10px rgba(33, 191, 117, 0.08);
}

.sai-result-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.sai-checkbox-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-top: 2px;
}

.sai-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #21bf75;
    cursor: pointer;
}

.sai-result-card-info {
    flex: 1;
    min-width: 0;
}

.sai-result-role {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.sai-result-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.4;
}

.sai-result-meta {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-left: 26px;
}

.sai-meta-tag {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sai-badge {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.sai-badge-new {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.sai-badge-reuse {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.sai-badge-rename {
    background: #fefce8;
    color: #ca8a04;
    border: 1px solid #fde68a;
}

.sai-badge-delete {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.sai-badge-add {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ── Revise operation cards ── */
.sai-op-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    transition: border-color 0.15s;
}

.sai-op-card:hover {
    border-color: #cbd5e1;
}

.sai-op-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.sai-op-detail {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    padding-left: 26px;
}

.sai-op-desc {
    font-size: 11px;
    color: #94a3b8;
    padding-left: 26px;
    margin-top: 4px;
}

.sai-op-shared {
    font-size: 11px;
    font-weight: 600;
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 6px 10px;
    margin: 8px 0 4px 26px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sai-op-shared-info {
    font-size: 10px;
    color: #64748b;
    padding-left: 26px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sai-op-choice {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0 4px 26px;
}

.sai-radio-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.sai-radio-wrap input[type="radio"] {
    accent-color: #21bf75;
}

.sai-summary {
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Others card ── */
.sai-others-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
}

.sai-others-icon {
    font-size: 28px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.sai-others-title {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 12px;
}

.sai-others-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sai-others-list li {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sai-others-list li i {
    color: #16a34a;
    font-size: 10px;
    width: 14px;
    text-align: center;
}

.sai-others-hint {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
}

/* ── FK / Connection attribute value hint ─────────────────────────── */
.attr-fk-value-hint {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.fk-hint-key {
    font-size: 9px;
    color: #6366f1;
    font-family: monospace;
    font-weight: 600;
}

.fk-hint-val {
    font-size: 9px;
    color: #10b981;
    font-family: monospace;
    font-weight: 600;
}

.fk-hint-sep {
    font-size: 9px;
    color: #94a3b8;
}

.fk-hint-key em,
.fk-hint-val em {
    font-style: normal;
    font-weight: 700;
}

/* ── Connection badge in dropdown info ───────────────────────────── */
.dd-source-badge.connection {
    background: #ede9fe;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

/* ── Dropdown info: key/value split display ──────────────────────── */
.dd-stores-key {
    font-size: 9px;
    color: #6366f1;
    font-family: monospace;
    font-weight: 600;
}

.dd-shows-val {
    font-size: 9px;
    color: #10b981;
    font-family: monospace;
    font-weight: 600;
}

.dd-sep {
    font-size: 9px;
    color: #94a3b8;
}

.dd-stores-key em,
.dd-shows-val em {
    font-style: normal;
    font-weight: 700;
}