:root {
    --primary-clr: #2f3349;
}

body {
    background-color: #FFF;
}

.bg-menu-theme {
    background-color: var(--primary-clr) !important;
    ;
    color: #cfcde4;
}

.menu .app-brand.demo h2 {
    font-size: 26px;
    letter-spacing: 1px;
    color: #cfcde4;
}

.app-brand-link {
    color: #cfcde4;
}

.bg-menu-theme .menu-link,
.bg-menu-theme .menu-horizontal-prev,
.bg-menu-theme .menu-horizontal-next {
    color: #cfcde4;
}

.bg-menu-theme .menu-inner>.menu-item.active>.menu-link {
    color: #cfcde4;
    background-color: color-mix(in sRGB, #e1def5 8%, #2f3349);
}

.layout-wrapper:not(.layout-horizontal) .bg-menu-theme .menu-inner>.menu-item.active:before {
    height: 2.7rem;
}

.bg-menu-theme .menu-inner>.menu-item.active:before {
    background: color-mix(in sRGB, #e1def5 8%, #2f3349);
}

.navbar-detached {
    box-shadow: 0 0 0 1px #e6e6e8 !important;
}

.btn-primary {
    color: #fff;
    background-color: #ff6b35;
    border-color: #ff6b35;
    box-shadow: 0 0.125rem 0.25rem 0 rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    color: #fff;
    background-color: #4a5078;
    border-color: #4a5078;
    transform: translateY(-1px);
}

.las-container .accordion-button .badge.bg-primary {
    background-color: #ff6b35 !important;
    color: #fff !important;
}

.text-primary {
    color: var(--primary-clr) !important;
}

/* ---------------- Multi-stepper Card ---------------- */
.multi-step-card {
    height: 650px;
    max-height: 90vh;
    overflow-y: auto;
    transition: height 0.3s ease;
}

.step-footer {
    margin-top: 20px;
    width: 100%;
}

/* ---------------- Stepper CSS ---------------- */
.stepper {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
}

.step-item {
    text-align: center;
    min-width: 80px;
    position: relative;
    flex: 1;
}

.step-item .circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e8eaf0;
    color: #9ca3af;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    font-weight: 700;
    font-size: 16px;
    z-index: 2;
    position: relative;
}


.step-item.active .circle {
    border: 3px solid #ff6b35;
    background: #fff;
    color: #ff6b35;
}

.step-item.completed .circle {
    background: #ff6b35;
    color: #fff;
}

.line {
    flex: 1;
    height: 3px;
    background: #d6d6d6;
    margin: 0 6px;
    align-self: center;
    min-width: 30px;
}

.step-item .small {
    font-size: 12px;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 60%;
    right: -40%;
    height: 3px;
    background: #ff6b35;
    z-index: 1;
    transition: all 0.3s ease;
}

.step-item.completed:not(:last-child)::after {
    /*background: linear-gradient(90deg, #2f3349 0%, #4a5078 100%);*/
    background: #ff6b35;
}

/*.step-item:hover:not(.active) .circle {*/
/*    transform: scale(1.05);*/
/*    background: #dde0ea;*/
/*}*/

/*.step-item.completed:hover .circle {*/
/*    transform: scale(1.05);*/
/*}*/


.user_initials_icon {
    color: #fff;
    background: var(--bs-primary);
    height: 30px;
    width: 30px;
    line-height: 30px;
    border-radius: 50px;
    font-size: 14px;
    display: inline-block;
    text-align: center;
}




/* ---------------- Step content ---------------- */
.step {
    min-height: 100%;
    /* Make each step take full card height */
}



/* Las Create And Edit */
/* =========================================================
   FIVE WHY – TREE DIAGRAM (REVISED & CLEAN)
   ========================================================= */
/* ONLY first problem's root node */
/* Accordion CLOSED state */
.accordion-button.collapsed {
    background-color: #f5f6fa;
    color: #212529;
}

/* Accordion OPEN state (keep lighter) */
.accordion-button:not(.collapsed) {
    color: #fff;
    background-color: #3d4260;
}

/* ONLY direct question inside first root */
.first-problem-root>.why-question {
    font-size: 18px;
    font-weight: 700;
}

/* ONLY direct add button inside first root */
.first-problem-root>.why-icons>.add-btn {
    width: 25px;
    height: 25px;
    font-size: 18px;
    line-height: 25px;
}

.first-problem-root>.why-icons>.delete-btn {
    width: 25px;
    height: 25px;
    font-size: 18px;
    line-height: 25px;
}


/* Wrapper */
.fivewhy-wrapper {
    overflow-x: auto;
    padding: 20px 0;
}

/* Tree container */
.why-tree {
    display: flex;
    justify-content: center;
}

/* =========================================================
   NODE BASE
   ========================================================= */
.why-node {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 16px 12px;
    margin: 2px;
    min-width: 190px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ced4da;
    background: #ffffff;
    color: #212529;
    transition: all 0.3s ease;
}

.why-node:hover:not(:has(.why-node:hover)) {
    background: #fafafa;
    border-color: #ff0000;
}

/* Question */
.why-question {
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 6px;
    width: 100%;
    text-align: left;
    padding-right: 0;
}

/* =========================================================
   TEXTAREA (BOOTSTRAP LOOK)
   ========================================================= */
.why-node textarea {
    width: 100%;
    font-size: 12px;
    resize: none;
    background: #ffffff;
    /* ALWAYS WHITE */
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    /* Bootstrap */
    padding: 0.375rem 0.75rem;
}

/* Let JS auto-height win over Bootstrap .form-control min-height (LAS edit drilling modal) */
#fiveWhyModal .why-node textarea.form-control {
    min-height: 0;
    box-sizing: border-box;
}

/* LAS drilling modal: stable column width (row negative margins + inline-flex caused overlapping “cards”). */
#fiveWhyModal {
    --why-card-width: 360px;
    --why-card-max-width: 440px;
    --why-capability-width: 400px;
    --why-root-min-width: 400px;
}

#fiveWhyModal .why-node {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: var(--why-card-width);
    min-width: var(--why-card-width);
    max-width: var(--why-card-max-width);
    flex: 0 0 auto;
    box-sizing: border-box;
    padding: 12px 12px 8px;
}

#fiveWhyModal .why-tree > .why-node.level-1 {
    width: max-content;
    min-width: var(--why-root-min-width);
    max-width: none;
}

#fiveWhyModal .why-node.why-node-expanded {
    max-width: none;
    align-items: stretch;
    box-sizing: border-box;
    padding-bottom: 4px;
    overflow: visible;
}

#fiveWhyModal .why-node.why-node-expanded.why-node-single-child {
    align-items: stretch;
}

#fiveWhyModal .why-node.why-node-expanded.why-node-single-child > .why-children {
    width: 100%;
    justify-content: center;
}

#fiveWhyModal .why-node.why-node-expanded.why-node-capability-parent {
    align-items: stretch;
}

#fiveWhyModal .why-node.why-capability-node {
    width: var(--why-capability-width);
    min-width: var(--why-capability-width);
    max-width: var(--why-capability-width);
}

#fiveWhyModal .why-children > .why-node.why-capability-node {
    width: var(--why-capability-width);
    min-width: var(--why-capability-width);
    max-width: var(--why-capability-width);
}

#fiveWhyModal .why-node.why-node-expanded > .why-question,
#fiveWhyModal .why-node.why-node-expanded > textarea:not([type="hidden"]),
#fiveWhyModal .why-node.why-node-expanded > .why-capability-fields {
    width: 100%;
    align-self: stretch;
    box-sizing: border-box;
}

#fiveWhyModal .why-node .why-children {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 36px;
    padding: 0;
    position: relative;
    gap: 1.25rem;
}

#fiveWhyModal .why-node.why-node-expanded > .why-children {
    flex-shrink: 0;
    align-self: stretch;
    gap: 1.25rem;
}

#fiveWhyModal .why-children > .why-node::before {
    top: -36px;
    height: 30px;
}

#fiveWhyModal .why-children > .why-node::after {
    top: -8px;
}

#fiveWhyModal .why-children > .why-node {
    flex: 0 0 auto;
    width: var(--why-card-width);
    min-width: var(--why-card-width);
    max-width: var(--why-card-max-width);
}

#fiveWhyModal .why-children > .why-node.why-node-expanded {
    min-width: var(--why-card-width);
    max-width: none;
}

#fiveWhyModal .why-question {
    font-size: 14px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.35;
    padding-right: 54px;
    box-sizing: border-box;
}

#fiveWhyModal .why-node .why-capability-fields {
    min-width: 0;
    gap: 0.5rem !important;
}

#fiveWhyModal .why-node .why-capability-fields .form-label {
    margin-bottom: 0.25rem;
    font-size: 12px;
}

/* Fullscreen LAS drilling modal: disable dialog translate/scale (fewer compositor glitches over long trees). */
#fiveWhyModal.modal.fade .modal-dialog,
#fiveWhyModal.modal.show .modal-dialog {
    transform: none !important;
    transition: none !important;
}

/* Sticky horizontal scrollbar in footer (edit / create / show drilling modals) */
#fiveWhyModal[data-sticky-hscroll] .modal-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

#fiveWhyModal[data-sticky-hscroll] .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 1rem;
}

#fiveWhyModal[data-sticky-hscroll] .fivewhy-modal-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
}

#fiveWhyModal[data-sticky-hscroll] .fivewhy-footer-hscroll-wrap {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 18px;
}

#fiveWhyModal[data-sticky-hscroll] .fivewhy-footer-hscroll-wrap.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

#fiveWhyModal[data-sticky-hscroll] .fivewhy-footer-hscroll {
    width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    height: 16px;
}

#fiveWhyModal[data-sticky-hscroll] .fivewhy-footer-hscroll-inner {
    height: 1px;
    pointer-events: none;
}

#fiveWhyModal[data-sticky-hscroll] .fivewhy-footer-actions {
    flex: 0 0 auto;
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    overflow-y: visible;
    padding-top: 10px;
    padding-bottom: 8px;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer .why-root-hint-outside {
    width: min(100%, 960px);
    margin: 0 auto;
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer .why-tree-wrapper {
    max-width: none;
    width: max-content;
    min-width: min-content;
    margin: 0 auto;
    box-sizing: border-box;
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer .why-tree {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    width: max-content;
    min-width: min-content;
    margin: 0 auto;
    padding-top: 8px;
    gap: 2rem;
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer::-webkit-scrollbar {
    height: 0;
    display: none;
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer .text-center.mb-2 {
    width: 100%;
    text-align: center !important;
    margin: 12px 0 16px;
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer .why-tree > .why-node.level-1 {
    flex: 0 0 auto;
    width: max-content;
    min-width: var(--why-root-min-width);
    max-width: none;
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer .why-children {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 1.25rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer .why-children > .why-node {
    flex: 0 0 auto;
    width: var(--why-card-width);
    min-width: var(--why-card-width);
    max-width: var(--why-card-max-width);
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer .why-children > .why-node.why-node-expanded {
    min-width: var(--why-card-width);
    max-width: none;
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer .why-children > .why-node.why-capability-node {
    width: var(--why-capability-width);
    min-width: var(--why-capability-width);
    max-width: var(--why-capability-width);
}

#fiveWhyModal[data-sticky-hscroll] #fiveWhyModalContainer .why-node.level-1::before {
    display: none;
}

/* =========================================================
   VALIDATION
   ========================================================= */
.is-invalid {
    border: 2px solid #dc3545 !important;
}

/* =========================================================
   ICONS
   ========================================================= */
.why-icons {
    position: absolute;
    top: -10px;
    right: 10px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    z-index: 2;
}

.why-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    color: #fff;
}

/* Add */
.add-btn {
    background: #0d6efd;
}

/* Delete */
.delete-btn {
    background: #dc3545;
}

.why-root-hint {
    width: 100%;
    display: block;
    margin: 10px 0 6px;
}

.why-root-hint-outside {
    max-width: min(100%, 960px);
    margin: 0 auto 12px;
    padding: 0 12px 4px;
    box-sizing: border-box;
}

.why-guide-top {
    border: 1px solid #22c55e;
    border-radius: 8px;
    padding: 5px 8px;
    text-align: left;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
    background: #fff;
}

.why-guide-arrow {
    color: #2563eb;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    flex-shrink: 0;
}

.why-guide-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 12px;
}

.why-guide-small-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    padding: 8px 6px;
    min-height: 62px;
    text-align: center;
}

/* Space between Action Guide and + ADD BRANCH control */
.why-tree-wrapper > .text-center.mb-2 {
    margin: 18px 0 22px;
    width: 100%;
}

.add-root-branch-btn {
    padding: 6px 20px;
    margin: 0 auto;
}

.why-guide-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.why-guide-icon-answer {
    border-radius: 6px;
    width: auto;
    min-width: 24px;
    padding: 0 6px;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.why-guide-icon-plus {
    background: #0d6efd;
    color: #ffffff;
}

.why-guide-icon-remove {
    background: #dc3545;
    color: #ffffff;
}

.why-guide-icon-root {
    border-radius: 999px;
    width: auto;
    min-height: 26px;
    padding: 2px 10px;
    font-size: 10px;
    background: #fff5f5;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.why-guide-icon-root .why-guide-plus-lg {
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    margin-right: 3px;
    vertical-align: -1px;
}

/* Larger “+” on main + ADD BRANCH control (drilling modal) */
.add-root-branch-btn .add-branch-plus {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

.why-guide-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.why-guide-card-text {
    font-size: 12px;
    color: #4b5563;
}

@media (max-width: 992px) {
    .why-guide-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .why-guide-grid {
        grid-template-columns: 1fr;
    }
}

.start-drilling-btn {
    min-width: 140px;
    width: auto;
    font-size: 12px;
    padding: 4px 10px;
    line-height: 1.2;
}

/* Levels 1–10: U+25CF ● black bullet on all WHY answer fields */
.why-node textarea.why-bullet-field {
    color: #0a0a0a;
}
.why-node textarea.why-bullet-field::placeholder {
    color: #0a0a0a;
    opacity: 1;
}

/* =========================================================
   CHILD CONTAINER
   ========================================================= */
.why-children {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 34px;
    position: relative;
}

/* =========================================================
   VERTICAL CONNECTOR (TOP → CHILD)
   ========================================================= */

/* Vertical line from parent to this node */
/* Vertical line from parent to this node */
.why-node::before {
    content: "";
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 28px;
    /* slightly shorter to fit arrow */
    background: #000000b7;
    /* black line */
}

/* Arrow head */
.why-node::after {
    content: "";
    position: absolute;
    top: -7px;
    /* position arrow just above node */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid #000000b7;
    /* ▼ arrow */
}

/* Root node should NOT have connector or arrow */
.level-1::before,
.level-1::after {
    display: none;
}



/* =========================================================
   DEPTH SHADING (LEVEL 1 → 8 ONLY)
   ========================================================= */
.level-1 {
    background: #f2f2f2;
}

/* slightly off-white */
.level-2 {
    background: #e9ecef;
}

.level-3 {
    background: #dee2e6;
}

.level-4 {
    background: #ced4da;
}

.level-5 {
    background: #adb5bd;
}

.level-6 {
    background: #9aa1a8;
}

/* clearly darker */
.level-7 {
    background: #7d858d;
}

/* darkest */

/* Text readability */
.level-6,
.level-7 {
    color: #212529;
}

/* =========================================================
   ROOT CAUSE
   ========================================================= */
.root-cause {
    border-color: #000000ff;
}

/* Accordion content border only */
.accordion-body {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-top: none;
    padding-top: 1rem !important;
}

.corrective-action-block {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

.corrective-action-block>label {
    text-align: center;
    display: block;
    font-weight: bold !important;
    color: #0f0f0fff;
    font-size: 1rem;
    margin-bottom: 12px;
}

.corrective-actions-container {
    display: flex;
    flex-direction: column;
}

.corrective-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.corrective-wrapper label {
    min-width: 150px;
    margin: 0 !important;
    padding: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.corrective-wrapper textarea {
    flex: 1;
    min-height: 44px;
    resize: vertical;
    border-radius: 8px;
}

.corrective-wrapper .remove-corrective {
    height: 36px;
    width: 36px;
    min-width: 36px;
    padding: 0;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-corrective {
    margin-top: 8px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .corrective-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .corrective-wrapper label {
        min-width: unset;
        font-size: 0.85rem;
    }

    .corrective-wrapper .remove-corrective {
        align-self: flex-end;
    }
}




/* =============================WRAPPER============================= */
.fivewhy-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 24px 0;
}

/* =============================TREE CORE============================= */
.fivewhy-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: max-content;
}

/* =============================QUESTION BOX============================= */
.fivewhy-node {
    background: #e8f0ff;
    border: 2px solid currentColor;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    text-align: center;
    max-width: 320px;
}

/* =============================ANSWER TEXT============================= */
.fivewhy-answer {
    margin-top: 6px;
    font-size: 13px;
    color: #374151;
    text-align: center;
}

/* =============================VERTICAL ARROW (SINGLE)============================= */
.fivewhy-arrow {
    width: 2px;
    height: 22px;
    background: #1e4ed8;
    margin: 8px auto;
    position: relative;
}

.fivewhy-arrow::after {
    content: "▼";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #1e4ed8;
}

/* =============================CHILD CONTAINER (THE MAGIC)============================= */
.fivewhy-children {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 120px;
    margin-top: 14px;
}

/* horizontal line EXACTLY between children */
/* =============================CHILD CONTAINER============================= */
.fivewhy-children {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 120px;
    margin-top: 14px;
}

/* =============================EACH CHILD============================= */
.fivewhy-child {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* vertical drop from horizontal line */
.fivewhy-child::before {
    content: "";
    width: 2px;
    height: 20px;
    background: #1e4ed8;
}

/* =============================HORIZONTAL LINE (PERFECT)============================= */
/* left half (from first child center to right) */
.fivewhy-child:first-child::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    right: -60px;
    height: 2px;
    background: #1e4ed8;
}

/* right half (from last child center to left) */
.fivewhy-child:last-child::after {
    content: "";
    position: absolute;
    top: 0;
    right: 50%;
    left: -60px;
    height: 2px;
    background: #1e4ed8;
}

/* middle children: full line through center */
.fivewhy-child:not(:first-child):not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60px;
    right: -60px;
    height: 2px;
    background: #1e4ed8;
}

/* =============================EACH CHILD COLUMN============================= */
.fivewhy-child {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* vertical drop from bus to box */
.fivewhy-child::before {
    content: "";
    width: 2px;
    height: 20px;
    background: #1e4ed8;
}

.recommendation-block {
    background: #f5f6fa;
}



/* =========================
            WRAPPER
            ========================= */
.pw-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 15px 0;
}

/* PDB chart (view/show): top scrollbar synced with diagram scroll */
.pdb-chart-scroll-host {
    width: 100%;
}

.pdb-chart-scroll-host .pdb-hscroll-track {
    width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    height: 16px;
    margin-bottom: 6px;
}

.pdb-chart-scroll-host .pdb-hscroll-track.is-hidden {
    visibility: hidden;
    pointer-events: none;
    margin-bottom: 0;
}

.pdb-chart-scroll-host .pdb-hscroll-inner {
    height: 1px;
    pointer-events: none;
}

.pdb-chart-scroll-host .pw-wrapper.pdb-hscroll-content {
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pdb-chart-scroll-host .pw-wrapper.pdb-hscroll-content::-webkit-scrollbar {
    height: 0;
    display: none;
}

/* =========================
            TREE ROOT
            ========================= */
.pw-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: fit-content;
}

/* =========================
            NODE BOX
            ========================= */
.pw-node {
    width: 320px;
    background: #e8f0ff;
    border: 2px solid currentColor;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
    text-align: center;
    word-wrap: break-word;
}

/* =========================
            ANSWER TEXT
            ========================= */
.pw-answer {
    margin-top: 6px;
    font-size: 13px;
    color: #374151;
    text-align: center;
}

/* =========================
            SINGLE VERTICAL CONNECTOR
========================= */
.pw-connector {
    margin-bottom: 4px;
}
/* .pw-connector {
    width: 2px;
    height: 24px;
    background: #1e4ed8;
    margin: 10px auto;
    position: relative;
}

.pw-connector::after {
    content: "▼";
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #1e4ed8;
} */

/* =========================
             CHILDREN ROW
            ========================= */
.pw-children {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 60px;
    margin-top: 12px;
}

/* =========================
            CHILD COLUMN
            ========================= */
.pw-child {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 320px;
}

/* vertical drop */
.pw-child::before {
    content: "";
    width: 2px;
    height: 20px;
    background: #1e4ed8;
}

/* horizontal line - first */
.pw-child:first-child::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    right: -50px;
    height: 2px;
    background: #1e4ed8;
}

/* horizontal line - last */
.pw-child:last-child::after {
    content: "";
    position: absolute;
    top: 0;
    right: 50%;
    left: -50px;
    height: 2px;
    background: #1e4ed8;
}

/* horizontal line - middle */
.pw-child:not(:first-child):not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0;
    left: -50px;
    right: -50px;
    height: 2px;
    background: #1e4ed8;
}
.why-remark {
    background: #fff3cd !important;
    /* Bootstrap warning subtle */
    min-height: 60px !important;
    /* smaller than main textarea */
    font-size: 11px !important;
    /* slightly smaller text */
    padding: 6px 8px !important;
    margin-top: 6px !important;
    border: 1px solid #f0ad4e !important;
}

/* Node added by expert */
.why-node.expert-node {
    background: #d1ecf1;
    border-color: #0dcaf0;
}

/* Expert remark text */
.expert-remark {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #ff0000;
    margin-top: 4px;
}
