/* R19 — isolated project lifecycle controls. */

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

.project-card-shell {
    position: relative;
    min-width: 0;
}

.project-card-shell .project-card {
    display: block;
    height: 100%;
}

.project-card-more-menu,
.project-more-menu {
    position: absolute;
    z-index: 8;
}

.project-card-more-menu {
    top: 10px;
    inset-inline-end: 10px;
}

.project-more-menu {
    top: 0;
    inset-inline-end: 0;
}

.project-card-more-menu summary,
.project-more-menu summary {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: #ffffff;
    background: rgba(7, 16, 34, .78);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    list-style: none;
    box-shadow: 0 7px 18px rgba(0, 0, 0, .28);
}

.project-card-more-menu summary::-webkit-details-marker,
.project-more-menu summary::-webkit-details-marker {
    display: none;
}

.project-card-more-menu summary:hover,
.project-more-menu summary:hover {
    background: rgba(35, 74, 142, .95);
}

.project-action-menu {
    position: absolute;
    top: 42px;
    inset-inline-end: 0;
    display: grid;
    min-width: 190px;
    padding: 7px;
    background: #10213f;
    border: 1px solid rgba(153, 186, 255, .28);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .35);
}

.project-action-menu a,
.project-action-menu button {
    width: 100%;
    padding: 10px 11px;
    color: #eaf1ff;
    background: transparent;
    border: 0;
    border-radius: 8px;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.project-action-menu a:hover,
.project-action-menu button:hover {
    background: rgba(97, 140, 224, .18);
}

.project-action-menu form {
    margin: 0;
}

.project-action-menu .project-action-danger {
    color: #ffb5bd;
}

.project-hero {
    position: relative;
}

.archive-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 16px;
}

.archive-project-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 15px;
    padding: 14px;
    background: rgba(15, 32, 61, .77);
    border: 1px solid rgba(132, 161, 214, .22);
    border-radius: 16px;
}

.archive-project-poster {
    min-height: 146px;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: #dce8ff;
    background: linear-gradient(145deg, #172d53, #0c172b);
    border-radius: 10px;
}

.archive-project-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive-project-body {
    min-width: 0;
}

.archive-project-body h3 {
    margin: 8px 0 5px;
    font-size: 16px;
}

.archive-project-body p,
.archive-project-body small {
    color: #aebfdf;
}

.archive-label,
.danger-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    color: #ffe4ab;
    background: rgba(174, 112, 26, .18);
    border: 1px solid rgba(255, 190, 83, .26);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.archive-reason {
    margin: 10px 0;
    padding: 8px 10px;
    color: #d4ddf0 !important;
    background: rgba(255, 255, 255, .04);
    border-radius: 8px;
    font-size: 12px;
}

.archive-project-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
}

.archive-project-actions form {
    margin: 0;
}

.danger-link,
.text-danger {
    color: #ff9faa;
    text-decoration: none;
}

.danger-link:hover,
.text-danger:hover {
    color: #ffd0d5;
}

.project-delete-panel {
    max-width: 760px;
    border-color: rgba(255, 103, 116, .38);
    box-shadow: 0 14px 42px rgba(118, 12, 24, .15);
}

.project-delete-panel h3 {
    margin: 12px 0 5px;
}

.danger-list {
    display: grid;
    gap: 10px;
    margin: 18px 0;
    padding-inline-start: 22px;
    color: #dce8ff;
}

.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    color: #fff;
    background: linear-gradient(135deg, #bd3443, #831c2b);
    border: 1px solid rgba(255, 181, 190, .4);
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.danger-button:hover {
    filter: brightness(1.1);
}

@media (max-width: 680px) {
    .page-head-actions,
    .page-head-actions a,
    .archive-project-actions,
    .archive-project-actions form,
    .archive-project-actions button {
        width: 100%;
    }

    .archive-project-card {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .project-action-menu {
        min-width: 178px;
    }
}

/* R19.2B — posters and file revision history. */

.poster-optimization-note {
    display: block;
    margin-top: 6px;
    color: #aebfdf;
    font-size: 12px;
}

.vault-replacement-panel {
    margin-top: 18px;
    border-color: rgba(94, 143, 238, .32);
}

.vault-replacement-panel .panel-head {
    align-items: flex-start;
    gap: 16px;
}

.revision-current-file {
    display: grid;
    gap: 5px;
    margin-bottom: 16px;
    padding: 13px 15px;
    background: rgba(92, 139, 228, .1);
    border: 1px solid rgba(134, 178, 255, .22);
    border-radius: 11px;
}

.revision-current-file span {
    color: #aebfdf;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.revision-current-file small,
.revision-table small {
    display: block;
    margin-top: 4px;
    color: #aebfdf;
}

.revision-table td:last-child a {
    color: #a8c7ff;
    font-weight: 800;
    text-decoration: none;
}

.revision-table td:last-child a:hover {
    color: #ffffff;
}

@media (max-width: 680px) {
    .vault-replacement-panel .panel-head,
    .vault-replacement-panel .panel-head a {
        width: 100%;
    }
}

/* R19.2C — All Projects 500x1000 poster alignment */
.project-library-grid > .project-card-shell {
    min-width: 0;
}

.project-library-grid .project-card-shell > .project-card {
    display: block;
    height: 100%;
}

.project-library-grid .project-card-shell .poster-frame {
    aspect-ratio: 1 / 2;
}

.project-library-grid .project-card-shell .poster-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.project-library-grid .project-card-shell .poster-fallback {
    min-height: 100%;
}

@media (max-width: 680px) {
    .project-library-grid .project-card-shell > .project-card {
        display: grid !important;
        grid-template-columns: 108px minmax(0, 1fr);
        min-height: 132px;
    }

    .project-library-grid .project-card-shell .poster-frame {
        grid-column: 1;
        grid-row: 1;
        width: 108px;
        min-height: 132px;
        height: 100%;
        aspect-ratio: auto;
    }

    .project-library-grid .project-card-shell .poster-frame .status-overlay {
        display: none !important;
    }

    .project-library-grid .project-card-shell .project-card-body {
        grid-column: 2;
        grid-row: 1;
        align-content: center;
        gap: 7px;
        padding: 15px 15px 14px;
    }

    .project-library-grid .project-card-shell .project-card-body strong {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        font-size: 17px;
        line-height: 1.25;
    }

    .project-library-grid .project-card-shell .project-card-body small,
    .project-library-grid .project-card-shell .project-card-body > span:not(.mobile-project-status) {
        font-size: 12px;
        line-height: 1.5;
    }

    .project-library-grid .project-card-shell .mobile-project-status {
        display: inline-flex;
    }
}

/* R19.2D — Correct poster ratio: storage is 500x650, card stays balanced. */
.project-library-grid > .project-card-shell {
    min-width: 0;
}

.project-library-grid .project-card-shell .poster-frame {
    aspect-ratio: 2 / 2.6 !important;
    background: linear-gradient(145deg, #122541, #081321) !important;
}

.project-library-grid .project-card-shell .poster-frame img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
}

.project-library-grid .project-card-shell:hover .poster-frame img {
    transform: none !important;
}

@media (max-width: 680px) {
    .project-library-grid .project-card-shell .poster-frame img {
        object-fit: contain !important;
    }
}

/* R19.3 — Interactive File Tree */

.vault-file-tree {
    margin-top: 18px;
    border: 1px solid rgba(126, 162, 224, .20);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(8, 19, 36, .68);
}

.vault-file-tree-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(126, 162, 224, .16);
    background: linear-gradient(135deg, rgba(29, 59, 104, .34), rgba(8, 19, 36, .1));
}

.vault-file-tree-head h3 {
    margin: 3px 0 5px;
}

.vault-file-tree-head p:last-child {
    margin: 0;
    color: #aebfdf;
}

.vault-file-tree-list {
    padding: 10px;
}

.file-tree-section,
.file-tree-group,
.file-tree-file,
.file-tree-subgroup {
    border-radius: 10px;
}

.file-tree-section {
    margin: 8px 0;
    border: 1px solid rgba(126, 162, 224, .16);
    background: rgba(9, 23, 43, .72);
}

.file-tree-section > summary,
.file-tree-group > summary,
.file-tree-file > summary,
.file-tree-subgroup > summary {
    list-style: none;
    cursor: pointer;
}

.file-tree-section > summary::-webkit-details-marker,
.file-tree-group > summary::-webkit-details-marker,
.file-tree-file > summary::-webkit-details-marker,
.file-tree-subgroup > summary::-webkit-details-marker {
    display: none;
}

.file-tree-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding: 10px 12px 10px 16px;
}

.file-tree-section > summary:hover {
    background: rgba(69, 123, 205, .12);
}

.file-tree-summary-title,
.file-tree-section-actions,
.file-tree-file-name,
.file-tree-file-actions,
.file-tree-translation,
.file-tree-translation-actions {
    display: flex;
    align-items: center;
}

.file-tree-summary-title {
    min-width: 0;
    gap: 10px;
}

.file-tree-summary-title strong {
    display: block;
    color: #f4f8ff;
}

.file-tree-summary-title small {
    display: block;
    margin-top: 3px;
    color: #8fa7cf;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
}

.file-tree-chevron {
    color: #9fc4ff;
    font-size: 26px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .16s ease;
}

.file-tree-section[open] > summary .file-tree-chevron {
    transform: rotate(90deg);
}

.file-tree-section-actions {
    flex: 0 0 auto;
    gap: 8px;
}

.file-tree-count,
.file-tree-add,
.file-tree-file-actions a,
.file-tree-translation-actions a,
.file-tree-open-link {
    color: #cfe0ff;
    text-decoration: none;
    font-weight: 800;
}

.file-tree-count,
.file-tree-add {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
}

.file-tree-count {
    border: 1px solid rgba(138, 182, 255, .28);
    background: rgba(73, 127, 217, .12);
}

.file-tree-add {
    border: 1px solid rgba(97, 215, 170, .30);
    background: rgba(43, 169, 128, .13);
    color: #c9ffe7;
}

.file-tree-count:hover,
.file-tree-add:hover,
.file-tree-file-actions a:hover,
.file-tree-translation-actions a:hover,
.file-tree-open-link:hover {
    color: #ffffff;
    filter: brightness(1.14);
}

.file-tree-section-body {
    padding: 0 12px 12px 34px;
}

.file-tree-group {
    border-left: 1px dashed rgba(146, 180, 235, .24);
}

.file-tree-group > summary,
.file-tree-subgroup > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    color: #dce9ff;
    font-weight: 800;
}

.file-tree-folder {
    margin-inline-end: 6px;
    color: #a5c7ff;
}

.file-tree-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(112, 153, 217, .16);
    color: #b8d3ff;
    font-size: 11px;
    font-weight: 800;
}

.file-tree-group-body {
    padding: 0 0 8px 16px;
}

.file-tree-file {
    margin: 5px 0;
    border: 1px solid rgba(126, 162, 224, .12);
    background: rgba(5, 16, 31, .45);
}

.file-tree-file > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px;
}

.file-tree-file > summary:hover {
    background: rgba(58, 104, 176, .12);
}

.file-tree-file-name {
    min-width: 0;
    gap: 9px;
}

.file-tree-file-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(89, 140, 220, .16);
    color: #c2dcff;
    font-size: 10px;
    font-weight: 900;
}

.file-tree-file-name strong,
.file-tree-translation strong {
    display: block;
    max-width: 650px;
    overflow: hidden;
    color: #f1f6ff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-tree-file-name small,
.file-tree-translation small {
    display: block;
    margin-top: 4px;
    color: #92a9cf;
    font-size: 11px;
}

.file-tree-file-actions {
    flex: 0 0 auto;
    gap: 10px;
    font-size: 12px;
}

.file-tree-file-body {
    padding: 0 12px 12px 54px;
}

.file-tree-subgroup {
    margin-top: 6px;
    border-left: 1px dashed rgba(146, 180, 235, .22);
    background: rgba(14, 32, 59, .38);
}

.file-tree-subgroup-icon {
    margin-inline-end: 7px;
    color: #a6c9ff;
}

.file-tree-subgroup-body {
    padding: 0 12px 12px 18px;
}

.file-tree-open-link {
    display: inline-flex;
    padding: 8px 0;
    font-size: 12px;
}

.file-tree-translation {
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid rgba(126, 162, 224, .10);
}

.file-tree-translation:first-child {
    border-top: 0;
}

.file-tree-translation > span:first-child {
    min-width: 0;
}

.file-tree-translation-actions {
    flex: 0 0 auto;
    gap: 10px;
    font-size: 12px;
}

.file-tree-empty {
    margin: 0;
    padding: 10px 12px;
    color: #8fa7cf;
    font-size: 12px;
}

.legacy-file-table {
    margin-top: 18px;
    border: 1px solid rgba(126, 162, 224, .18);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(8, 19, 36, .45);
}

.legacy-file-table > summary {
    cursor: pointer;
    padding: 14px 16px;
    color: #c9dcff;
    font-weight: 800;
}

.legacy-file-table > summary::marker {
    color: #9fc4ff;
}

.legacy-file-table .file-table-wrap {
    border-top: 1px solid rgba(126, 162, 224, .14);
}

@media (max-width: 760px) {
    .file-tree-section > summary,
    .file-tree-file > summary,
    .file-tree-translation {
        align-items: flex-start;
    }

    .file-tree-section > summary {
        flex-direction: column;
    }

    .file-tree-section-actions {
        width: 100%;
    }

    .file-tree-count,
    .file-tree-add {
        flex: 1;
        justify-content: center;
    }

    .file-tree-file > summary {
        flex-direction: column;
    }

    .file-tree-file-actions {
        width: 100%;
        padding-inline-start: 43px;
    }

    .file-tree-file-body {
        padding-inline-start: 22px;
    }

    .file-tree-file-name strong,
    .file-tree-translation strong {
        max-width: 210px;
    }

    .file-tree-translation {
        flex-direction: column;
    }
}

/* R19.3B — Add actions and counts on all File Tree levels */

.file-tree-section.is-empty-section > summary {
    min-height: 48px;
    opacity: .78;
}

.file-tree-section.is-empty-section > summary:hover {
    opacity: 1;
}

.file-tree-section.has-files {
    border-color: rgba(103, 162, 255, .32);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .12);
}

.file-tree-section.has-files > summary {
    background: linear-gradient(90deg, rgba(34, 80, 144, .22), rgba(8, 19, 36, .18));
}

.file-tree-file-chevron {
    flex: 0 0 auto;
    color: #9fc4ff;
    font-size: 22px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .16s ease;
}

.file-tree-file[open] > summary .file-tree-file-chevron {
    transform: rotate(90deg);
}

.file-tree-file-name {
    gap: 8px;
}

.file-tree-file {
    border-color: rgba(117, 168, 247, .20);
}

.file-tree-file[open] {
    background: linear-gradient(90deg, rgba(17, 48, 89, .46), rgba(5, 16, 31, .30));
}

.file-tree-file-body {
    padding-top: 2px;
}

.file-tree-subgroup {
    border: 1px solid rgba(127, 167, 226, .14);
    border-left: 2px solid rgba(126, 180, 255, .34);
}

.file-tree-subgroup > summary {
    min-height: 40px;
}

.file-tree-group-summary-actions,
.file-tree-subgroup-summary-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.file-tree-group-summary-actions a,
.file-tree-subgroup-summary-actions a {
    color: #b8d8ff;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.file-tree-group-summary-actions a:hover,
.file-tree-subgroup-summary-actions a:hover {
    color: #ffffff;
}

.file-tree-add-inline {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 7px;
    border: 1px solid rgba(97, 215, 170, .28);
    border-radius: 6px;
    background: rgba(43, 169, 128, .12);
    color: #c9ffe7 !important;
}

.file-tree-add-inline:hover {
    background: rgba(43, 169, 128, .24);
}

@media (max-width: 760px) {
    .file-tree-file-actions {
        padding-inline-start: 0;
    }

    .file-tree-group-summary-actions,
    .file-tree-subgroup-summary-actions {
        gap: 5px;
    }

    .file-tree-group-summary-actions a,
    .file-tree-subgroup-summary-actions a {
        font-size: 10px;
    }
}

/* =========================================================
   R19.4F — Recursive Workflow Tree CSS repair
   ========================================================= */

.recursive-workflow-tree {
    margin-top: 18px;
}

.recursive-workflow-tree .vault-file-tree-list {
    padding: 12px;
}

.recursive-workflow-tree .file-tree-section {
    margin: 10px 0;
    border: 1px solid rgba(89, 144, 228, .30);
    border-radius: 12px;
    background: #091b31;
    overflow: hidden;
}

.recursive-workflow-tree .file-tree-section > summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px;
    min-height: 56px;
    padding: 10px 14px 10px 16px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(90deg, rgba(31, 75, 135, .36), rgba(10, 28, 51, .18));
}

.recursive-workflow-tree .file-tree-section > summary::-webkit-details-marker,
.recursive-workflow-tree .file-tree-group > summary::-webkit-details-marker,
.recursive-workflow-tree .recursive-tree-node > summary::-webkit-details-marker {
    display: none;
}

.recursive-workflow-tree .file-tree-section > summary:hover,
.recursive-workflow-tree .recursive-tree-node > summary:hover {
    background: rgba(51, 112, 196, .18);
}

.recursive-workflow-tree .file-tree-summary-title,
.recursive-workflow-tree .file-tree-section-actions {
    display: flex !important;
    align-items: center !important;
}

.recursive-workflow-tree .file-tree-summary-title {
    min-width: 0;
    gap: 9px;
}

.recursive-workflow-tree .file-tree-summary-title strong {
    display: block;
    color: #f4f8ff !important;
    font-size: 15px;
}

.recursive-workflow-tree .file-tree-summary-title small {
    display: block;
    margin-top: 3px;
    color: #91b8f5 !important;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
}

.recursive-workflow-tree .file-tree-chevron {
    display: inline-block;
    color: #9fc4ff !important;
    font-size: 23px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .18s ease;
}

.recursive-workflow-tree .file-tree-section[open] > summary .file-tree-chevron {
    transform: rotate(90deg);
}

.recursive-workflow-tree .file-tree-section-actions {
    flex: 0 0 auto;
    gap: 8px;
}

.recursive-workflow-tree .file-tree-count,
.recursive-workflow-tree .file-tree-add {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none !important;
    white-space: nowrap;
}

.recursive-workflow-tree .file-tree-count {
    border: 1px solid rgba(128, 178, 255, .36);
    background: rgba(52, 103, 181, .20);
    color: #c9deff !important;
}

.recursive-workflow-tree .file-tree-add {
    border: 1px solid rgba(97, 215, 170, .38);
    background: rgba(33, 159, 118, .18);
    color: #d1ffea !important;
}

.recursive-workflow-tree .file-tree-section-body {
    padding: 8px 14px 14px 30px;
}

.recursive-workflow-tree .file-tree-group {
    border-left: 1px dashed rgba(138, 181, 245, .32);
}

.recursive-workflow-tree .file-tree-group > summary {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 8px 10px;
    color: #dceaff !important;
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    list-style: none;
}

.recursive-workflow-tree .file-tree-folder {
    color: #a5c7ff !important;
    margin-inline-end: 5px;
}

.recursive-workflow-tree .file-tree-group-count,
.recursive-workflow-tree .recursive-count {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    min-height: 23px;
    padding: 0 7px;
    border: 1px solid rgba(125, 175, 252, .25);
    border-radius: 999px;
    background: rgba(68, 116, 194, .16);
    color: #c7ddff !important;
    font-size: 10px;
    font-weight: 900;
}

.recursive-workflow-tree .recursive-tree-root-list {
    padding: 0 0 8px 14px;
}

.recursive-workflow-tree .recursive-tree-node {
    margin: 7px 0;
    border: 1px solid rgba(108, 163, 245, .23);
    border-radius: 10px;
    background: rgba(4, 16, 31, .72);
    overflow: hidden;
}

.recursive-workflow-tree .recursive-tree-node > summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px;
    min-height: 55px;
    padding: 9px 12px;
    cursor: pointer;
    list-style: none;
}

.recursive-workflow-tree .recursive-tree-title {
    display: flex !important;
    align-items: center !important;
    min-width: 0;
    gap: 8px;
}

.recursive-workflow-tree .recursive-tree-chevron {
    flex: 0 0 auto;
    display: inline-block;
    color: #9fc4ff !important;
    font-size: 21px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .18s ease;
}

.recursive-workflow-tree .recursive-tree-node[open] > summary .recursive-tree-chevron {
    transform: rotate(90deg);
}

.recursive-workflow-tree .recursive-tree-kind {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    min-height: 21px;
    padding: 0 6px;
    border: 1px solid rgba(129, 177, 250, .25);
    border-radius: 5px;
    background: rgba(74, 126, 208, .10);
    color: #a9cdff !important;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.recursive-workflow-tree .recursive-tree-name {
    min-width: 0;
}

.recursive-workflow-tree .recursive-tree-name strong {
    display: block;
    max-width: 560px;
    overflow: hidden;
    color: #f3f8ff !important;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recursive-workflow-tree .recursive-tree-name small {
    display: block;
    max-width: 620px;
    margin-top: 3px;
    overflow: hidden;
    color: #99b3d8 !important;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recursive-workflow-tree .recursive-tree-actions {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.recursive-workflow-tree .recursive-tree-actions a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 0 7px;
    border: 1px solid rgba(94, 214, 169, .30);
    border-radius: 6px;
    background: rgba(36, 156, 119, .15);
    color: #d1ffea !important;
    font-size: 10px;
    font-weight: 900;
    text-decoration: none !important;
    white-space: nowrap;
}

.recursive-workflow-tree .recursive-tree-actions a:hover {
    border-color: rgba(134, 255, 202, .65);
    background: rgba(37, 174, 131, .28);
    color: #ffffff !important;
}

.recursive-workflow-tree .recursive-tree-actions .recursive-action-translation {
    border-color: rgba(170, 133, 255, .34);
    background: rgba(126, 82, 209, .18);
    color: #e7daff !important;
}

.recursive-workflow-tree .recursive-count.muted {
    border-color: rgba(135, 156, 191, .24);
    background: rgba(78, 96, 125, .16);
    color: #a9bbd6 !important;
}

.recursive-workflow-tree .recursive-tree-children {
    margin: 0 12px 11px 30px;
    padding-left: 12px;
    border-left: 1px dashed rgba(139, 185, 250, .34);
}

.recursive-workflow-tree .recursive-tree-empty {
    margin: 0 12px 11px 30px;
    padding: 10px 12px;
    border-left: 1px dashed rgba(139, 185, 250, .26);
    color: #93acd0 !important;
    font-size: 12px;
}

/* Repair raw File Sections navigation above the tree */
.file-sections,
.file-sections-nav,
.vault-section-nav,
section:has(> h3:first-child) > .section-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.file-sections a,
.file-sections-nav a,
.vault-section-nav a,
section:has(> h3:first-child) > .section-links a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid rgba(111, 160, 240, .24);
    border-radius: 7px;
    background: rgba(45, 92, 163, .13);
    color: #b9d3ff !important;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none !important;
}

.file-sections a:hover,
.file-sections-nav a:hover,
.vault-section-nav a:hover,
section:has(> h3:first-child) > .section-links a:hover {
    background: rgba(66, 124, 211, .28);
    color: #fff !important;
}

@media (max-width: 980px) {
    .recursive-workflow-tree .recursive-tree-node > summary {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .recursive-workflow-tree .recursive-tree-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .recursive-workflow-tree .file-tree-section > summary {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .recursive-workflow-tree .file-tree-section-actions {
        width: 100%;
    }

    .recursive-workflow-tree .file-tree-count,
    .recursive-workflow-tree .file-tree-add {
        flex: 1;
    }

    .recursive-workflow-tree .file-tree-section-body {
        padding-left: 12px;
    }

    .recursive-workflow-tree .recursive-tree-root-list {
        padding-left: 0;
    }

    .recursive-workflow-tree .recursive-tree-children,
    .recursive-workflow-tree .recursive-tree-empty {
        margin-left: 10px;
        padding-left: 7px;
    }

    .recursive-workflow-tree .recursive-tree-name strong,
    .recursive-workflow-tree .recursive-tree-name small {
        max-width: 245px;
    }
}

/* =========================================================
   R19.4F — Recursive Workflow Tree CSS repair
   ========================================================= */

.recursive-workflow-tree {
    margin-top: 18px;
}

.recursive-workflow-tree .vault-file-tree-list {
    padding: 12px;
}

.recursive-workflow-tree .file-tree-section {
    margin: 10px 0;
    border: 1px solid rgba(89, 144, 228, .30);
    border-radius: 12px;
    background: #091b31;
    overflow: hidden;
}

.recursive-workflow-tree .file-tree-section > summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px;
    min-height: 56px;
    padding: 10px 14px 10px 16px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(90deg, rgba(31, 75, 135, .36), rgba(10, 28, 51, .18));
}

.recursive-workflow-tree .file-tree-section > summary::-webkit-details-marker,
.recursive-workflow-tree .file-tree-group > summary::-webkit-details-marker,
.recursive-workflow-tree .recursive-tree-node > summary::-webkit-details-marker {
    display: none;
}

.recursive-workflow-tree .file-tree-section > summary:hover,
.recursive-workflow-tree .recursive-tree-node > summary:hover {
    background: rgba(51, 112, 196, .18);
}

.recursive-workflow-tree .file-tree-summary-title,
.recursive-workflow-tree .file-tree-section-actions {
    display: flex !important;
    align-items: center !important;
}

.recursive-workflow-tree .file-tree-summary-title {
    min-width: 0;
    gap: 9px;
}

.recursive-workflow-tree .file-tree-summary-title strong {
    display: block;
    color: #f4f8ff !important;
    font-size: 15px;
}

.recursive-workflow-tree .file-tree-summary-title small {
    display: block;
    margin-top: 3px;
    color: #91b8f5 !important;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
}

.recursive-workflow-tree .file-tree-chevron {
    display: inline-block;
    color: #9fc4ff !important;
    font-size: 23px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .18s ease;
}

.recursive-workflow-tree .file-tree-section[open] > summary .file-tree-chevron {
    transform: rotate(90deg);
}

.recursive-workflow-tree .file-tree-section-actions {
    flex: 0 0 auto;
    gap: 8px;
}

.recursive-workflow-tree .file-tree-count,
.recursive-workflow-tree .file-tree-add {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none !important;
    white-space: nowrap;
}

.recursive-workflow-tree .file-tree-count {
    border: 1px solid rgba(128, 178, 255, .36);
    background: rgba(52, 103, 181, .20);
    color: #c9deff !important;
}

.recursive-workflow-tree .file-tree-add {
    border: 1px solid rgba(97, 215, 170, .38);
    background: rgba(33, 159, 118, .18);
    color: #d1ffea !important;
}

.recursive-workflow-tree .file-tree-section-body {
    padding: 8px 14px 14px 30px;
}

.recursive-workflow-tree .file-tree-group {
    border-left: 1px dashed rgba(138, 181, 245, .32);
}

.recursive-workflow-tree .file-tree-group > summary {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 8px 10px;
    color: #dceaff !important;
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    list-style: none;
}

.recursive-workflow-tree .file-tree-folder {
    color: #a5c7ff !important;
    margin-inline-end: 5px;
}

.recursive-workflow-tree .file-tree-group-count,
.recursive-workflow-tree .recursive-count {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    min-height: 23px;
    padding: 0 7px;
    border: 1px solid rgba(125, 175, 252, .25);
    border-radius: 999px;
    background: rgba(68, 116, 194, .16);
    color: #c7ddff !important;
    font-size: 10px;
    font-weight: 900;
}

.recursive-workflow-tree .recursive-tree-root-list {
    padding: 0 0 8px 14px;
}

.recursive-workflow-tree .recursive-tree-node {
    margin: 7px 0;
    border: 1px solid rgba(108, 163, 245, .23);
    border-radius: 10px;
    background: rgba(4, 16, 31, .72);
    overflow: hidden;
}

.recursive-workflow-tree .recursive-tree-node > summary {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px;
    min-height: 55px;
    padding: 9px 12px;
    cursor: pointer;
    list-style: none;
}

.recursive-workflow-tree .recursive-tree-title {
    display: flex !important;
    align-items: center !important;
    min-width: 0;
    gap: 8px;
}

.recursive-workflow-tree .recursive-tree-chevron {
    flex: 0 0 auto;
    display: inline-block;
    color: #9fc4ff !important;
    font-size: 21px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform .18s ease;
}

.recursive-workflow-tree .recursive-tree-node[open] > summary .recursive-tree-chevron {
    transform: rotate(90deg);
}

.recursive-workflow-tree .recursive-tree-kind {
    flex: 0 0 auto;
    display: inline-flex !important;
    align-items: center;
    min-height: 21px;
    padding: 0 6px;
    border: 1px solid rgba(129, 177, 250, .25);
    border-radius: 5px;
    background: rgba(74, 126, 208, .10);
    color: #a9cdff !important;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.recursive-workflow-tree .recursive-tree-name {
    min-width: 0;
}

.recursive-workflow-tree .recursive-tree-name strong {
    display: block;
    max-width: 560px;
    overflow: hidden;
    color: #f3f8ff !important;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recursive-workflow-tree .recursive-tree-name small {
    display: block;
    max-width: 620px;
    margin-top: 3px;
    overflow: hidden;
    color: #99b3d8 !important;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recursive-workflow-tree .recursive-tree-actions {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.recursive-workflow-tree .recursive-tree-actions a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 0 7px;
    border: 1px solid rgba(94, 214, 169, .30);
    border-radius: 6px;
    background: rgba(36, 156, 119, .15);
    color: #d1ffea !important;
    font-size: 10px;
    font-weight: 900;
    text-decoration: none !important;
    white-space: nowrap;
}

.recursive-workflow-tree .recursive-tree-actions a:hover {
    border-color: rgba(134, 255, 202, .65);
    background: rgba(37, 174, 131, .28);
    color: #ffffff !important;
}

.recursive-workflow-tree .recursive-tree-actions .recursive-action-translation {
    border-color: rgba(170, 133, 255, .34);
    background: rgba(126, 82, 209, .18);
    color: #e7daff !important;
}

.recursive-workflow-tree .recursive-count.muted {
    border-color: rgba(135, 156, 191, .24);
    background: rgba(78, 96, 125, .16);
    color: #a9bbd6 !important;
}

.recursive-workflow-tree .recursive-tree-children {
    margin: 0 12px 11px 30px;
    padding-left: 12px;
    border-left: 1px dashed rgba(139, 185, 250, .34);
}

.recursive-workflow-tree .recursive-tree-empty {
    margin: 0 12px 11px 30px;
    padding: 10px 12px;
    border-left: 1px dashed rgba(139, 185, 250, .26);
    color: #93acd0 !important;
    font-size: 12px;
}

/* Repair raw File Sections navigation above the tree */
.file-sections,
.file-sections-nav,
.vault-section-nav,
section:has(> h3:first-child) > .section-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.file-sections a,
.file-sections-nav a,
.vault-section-nav a,
section:has(> h3:first-child) > .section-links a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid rgba(111, 160, 240, .24);
    border-radius: 7px;
    background: rgba(45, 92, 163, .13);
    color: #b9d3ff !important;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none !important;
}

.file-sections a:hover,
.file-sections-nav a:hover,
.vault-section-nav a:hover,
section:has(> h3:first-child) > .section-links a:hover {
    background: rgba(66, 124, 211, .28);
    color: #fff !important;
}

@media (max-width: 980px) {
    .recursive-workflow-tree .recursive-tree-node > summary {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .recursive-workflow-tree .recursive-tree-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .recursive-workflow-tree .file-tree-section > summary {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .recursive-workflow-tree .file-tree-section-actions {
        width: 100%;
    }

    .recursive-workflow-tree .file-tree-count,
    .recursive-workflow-tree .file-tree-add {
        flex: 1;
    }

    .recursive-workflow-tree .file-tree-section-body {
        padding-left: 12px;
    }

    .recursive-workflow-tree .recursive-tree-root-list {
        padding-left: 0;
    }

    .recursive-workflow-tree .recursive-tree-children,
    .recursive-workflow-tree .recursive-tree-empty {
        margin-left: 10px;
        padding-left: 7px;
    }

    .recursive-workflow-tree .recursive-tree-name strong,
    .recursive-workflow-tree .recursive-tree-name small {
        max-width: 245px;
    }
}
