.system__modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.system__modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 800px;
    box-shadow: 0 0 7px 1px rgba(0, 0, 0, .5);
    z-index: 2;
    border-radius: 10px 10px 0 0;
}

.system__modal_title {
    padding: 10px;
    background: #EDF2F7;
    border-bottom: 1px solid #BFBFBF;
    border-radius: 10px 10px 0 0;
    text-align: center;
    font-weight: bold;
    font-size: 16px !important;
    color: #003681;
    text-wrap: nowrap;
    text-overflow: ellipsis;
}

.system__modal_body {
    padding: 10px 10px 10px 10px;
    background: white;
    max-height: 80vh;
    overflow-y: auto;
}

.system__modal_footer {
    border-top: 1px solid #BFBFBF;
    padding: 5px;
    background: #EDF2F7;
    display: flex;
    justify-content: space-between;
}

.system__modal_footer-button {
    border: 1px solid #BFBFBF;
    padding: 7px;
    text-align: center;
    min-width: 100px;
    font-weight: bold;
    background: #f1f1f1;
}

.system__modal_footer-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.text-wrapper {
    max-width: 25rem; /* Adjust as needed */
    overflow: hidden;
    display: flex;
    align-items: center;
}

.text-wrapper .text-container {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
}

.text-wrapper .more-link {
    display: none;
}

.text-wrapper .text-container.expanded {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.tgx-attach-action-buttons {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    z-index: 100;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);

}

/* Родитель, у которого есть прямой потомок .tgx-attach-action-buttons */
*:has(> .tgx-attach-action-buttons) {
    position: relative;
}

/* Скрываем все прямые кнопки */
*:has(> .tgx-attach-action-buttons) > .tgx-attach-action-buttons {
    opacity: 0;
    filter: blur(5px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, filter 0.3s ease, visibility 0s linear 0.3s;
}

*:has(> .tgx-attach-action-buttons:hover > :not(:empty)):hover {
    outline: 1px dotted #2761a1;
}

/* Показываем кнопки только при наведении на родителя */
*:has(> .tgx-attach-action-buttons):hover > .tgx-attach-action-buttons,
*:has(> .tgx-attach-action-buttons):focus-within > .tgx-attach-action-buttons {
    opacity: 0.75;
    filter: blur(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease, filter 0.3s ease, visibility 0s linear;
}

*:has(> .tgx-attach-action-buttons):hover > .tgx-attach-action-buttons:hover {
    opacity: 1;
}

.render-markdown-header a {
    display: none;
}

.render-markdown-header:hover a {
    display: inline;
}

*:has(> *:only-child) > *:only-child > .tgx-attach-action-buttons > .btn-delete {
    display: none !important;
}

*:has(> *:only-child) > *:only-child > .tgx-attach-action-buttons > .btn-move {
    display: none !important;
}

.tgx-attach-action-buttons > .tgx-action-button {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #021d4c, #3174b8);
    box-shadow: 0 15px 15px rgba(0, 0, 0, 0.25), inset 0 4px 4px rgba(0, 0, 0, 0.25);
    color: #fff;
    border: none;
    padding: .5rem;
    border-radius: 0.2rem;
    font-size: 1.2rem;
}

.tgx-attach-action-buttons > .tgx-action-button:hover {
    background: linear-gradient(to left, #021d4c, #3174b8);
}

.tgx-attach-action-buttons > .tgx-action-button.btn-move {
    cursor: grab;
}

.tgx-insertion-zone {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
    text-decoration: none !important;
    padding: .5rem !important;
    opacity: .75 !important;
    background-color: rgba(255, 255, 255, .75) !important;
    transition: opacity 0.3s ease, border 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease !important;
}

.tgx-insertion-zone span {
    color: transparent;
    background-clip: text;
    background-image: linear-gradient(to right, #021d4c, #3174b8);
    font-size: 1.4rem;
    font-weight: bold;
}

.tgx-insertion-zone div {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    font-weight: 300;
    background: linear-gradient(to right, #021d4c, #3174b8);
    margin-bottom: 1rem;
}

.tgx-insertion-zone:hover {
    opacity: 1 !important;
}

a.tgx-insertion-zone:hover i {
    color: var(--accent-100);
}

.ql-container {
    font-size: unset !important;
}

.ql-container .ql-editor [style*="font-size"],
.ql-container .ql-editor [style*="font-family"],
.ql-container .ql-editor [style*="color"],
.ql-container .ql-editor [style*="background-color"] {
    all: unset !important;
    font-size: inherit !important;
    font-family: inherit !important;
    color: inherit !important;
    background-color: transparent !important;
}

.ql-editor {
    padding: 0 !important;
}

.ql-toolbar {
    width: 100%;
}

.tree {
    font-size: 0.95rem;
}

.tree ul {
    list-style: none;
    margin: 0;
    padding-left: 1rem;
}

.tree li {
    margin: 0.4rem 0;
    position: relative;
}


.tree li > .action {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tree li:hover > .action {
    opacity: 1;
}

.tree li::before {
    content: "";
    position: absolute;
    left: -1rem;
    top: 0.7rem;
    width: 0.8rem;
    height: 1px;
}

.tree button {
    background: none;
    border: none;
    padding: 0;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-wrap: nowrap;
}

.tree a {
    text-wrap: nowrap;
}

.tree li {
    text-wrap: nowrap;
}

.tree button:hover {
    text-decoration: underline;
}

.tree .icon-toggle {
    transition: transform 0.2s ease;
}

.tree button[aria-expanded="true"] .icon-toggle {
    transform: rotate(90deg);
}

.tree .add-page {
    cursor: pointer;
}

.tree .add-page:hover {
    text-decoration: underline;
}