/* ==========================================================================
   Base UI styles: system modal, TGX controls, markdown and shared utilities
   ========================================================================== */

/* Локальные токены */
:root {
    --c-primary-900: #021d4c;
    --c-primary-600: #3174b8;
    --c-primary-500: #2761a1;

    --c-modal-bg: #edf2f7;
    --c-border: #bfbfbf;

    --grad-primary: linear-gradient(90deg, var(--c-primary-900) 0%, var(--c-primary-600) 100%);
    --grad-primary-rev: linear-gradient(270deg, var(--c-primary-900) 0%, var(--c-primary-600) 100%);
    --grad-primary-inverse: linear-gradient(90deg, var(--c-primary-600) 0%, var(--c-primary-900) 100%);
    --grad-text: linear-gradient(to right, var(--c-primary-900), var(--c-primary-600));

    --shadow-1: 0 0 7px 1px rgba(0, 0, 0, 0.5);
    --shadow-2: 0 15px 15px rgba(0, 0, 0, 0.25), inset 0 4px 4px rgba(0, 0, 0, 0.25);
    --shadow-3: 0 5px 5px rgba(0, 0, 0, 0.25), inset 0 4px 4px rgba(0, 0, 0, 0.25);
    --bubble-drop-shadow: drop-shadow(0 -2px 8px rgba(0, 0, 0, 0.06)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.16)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.10));

    --r-sm: 0.5rem;
    --r-md: 0.7rem;
    --r-lg: 10px;
    --r-xl: 2rem;

    --z-backdrop: 1;
    --z-modal: 2;
    --z-float: 100;
    --z-top: 9999;

    --tr-fast: 0.2s ease;
    --tr-mid: 0.3s ease;
    --bubble-transition-closed: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
    --bubble-transition-open: opacity 0.15s ease, transform 0.15s ease, visibility 0s;

    --size-upload-card: 6rem;
    --size-upload-preview-icon: 2.5rem;
    --size-upload-add-icon: 2rem;
    --upload-overlay-bg: rgb(0 0 0 / 40%);
}

/* ==========================================================================
   System modal
   ========================================================================== */

.system__modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-backdrop);
}

.system__modal {
    position: fixed;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 800px;
    z-index: var(--z-modal);

    box-shadow: var(--shadow-1);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    overflow: hidden; /* чтобы шапка/тело не выходили за радиус */
}

.system__modal_title {
    padding: 10px;
    background: var(--c-modal-bg);
    border-bottom: 1px solid var(--c-border);

    text-align: center;
    font-weight: 700;
    font-size: 16px !important;
    color: #003681;

    text-wrap: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.system__modal_body {
    padding: 10px;
    background: #fff;
    max-height: 80vh;
    overflow-y: auto;
}

.system__modal_footer {
    border-top: 1px solid var(--c-border);
    padding: 5px;
    background: var(--c-modal-bg);

    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.system__modal_footer-button {
    border: 1px solid var(--c-border);
    padding: 7px;
    min-width: 100px;

    text-align: center;
    font-weight: 700;
    background: #f1f1f1;
}

.system__modal_footer-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ==========================================================================
   Text wrapper / ellipsis
   ========================================================================== */

.text-wrapper {
    max-width: 25rem;
    overflow: hidden;

    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.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;
}

/* ==========================================================================
   Attach action buttons (hover/focus reveal)
   ========================================================================== */

.tgx-attach-action-buttons {
    position: absolute;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-float);
    width: fit-content;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

/* Родитель, у которого есть прямой потомок .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 var(--tr-mid), filter var(--tr-mid), visibility 0s linear var(--tr-mid);
}

/* Базовая подсветка хоста с кнопками */
*:has(> .tgx-attach-action-buttons > :not(:empty)):hover {
    outline: 1px dotted var(--c-primary-500);
}

/* Показ по hover/focus-within */
*:has(> .tgx-attach-action-buttons):hover > .tgx-attach-action-buttons,
*:has(> .tgx-attach-action-buttons):focus-within > .tgx-attach-action-buttons {
    opacity: 0.85;
    filter: blur(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity var(--tr-mid), filter var(--tr-mid), visibility 0s linear;
}

/* Если внутри есть более глубокий hover/focus-хост, скрываем кнопки предка */
*:has(> .tgx-attach-action-buttons):hover:has(*:hover > .tgx-attach-action-buttons) {
    outline: none;
}

*:has(> .tgx-attach-action-buttons):hover:has(*:hover > .tgx-attach-action-buttons) > .tgx-attach-action-buttons,
*:has(> .tgx-attach-action-buttons):focus-within:has(*:focus-within > .tgx-attach-action-buttons) > .tgx-attach-action-buttons {
    opacity: 0;
    filter: blur(5px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--tr-mid), filter var(--tr-mid), visibility 0s linear var(--tr-mid);
}

*:has(> .tgx-attach-action-buttons):hover > .tgx-attach-action-buttons:hover {
    opacity: 1;
}

/* Кнопки */
.tgx-attach-action-buttons > .tgx-action-button {
    cursor: pointer;
    line-height: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    background: linear-gradient(to right, var(--c-primary-900), var(--c-primary-600));
    box-shadow: var(--shadow-2);
    color: #fff;

    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1.2rem;
}

.tgx-attach-action-buttons > .tgx-action-button:hover {
    background: linear-gradient(to left, var(--c-primary-900), var(--c-primary-600));
}

.tgx-attach-action-buttons > .tgx-action-button.btn-move {
    cursor: grab;
}

/* Скрываем удаление/перемещение если единственный элемент */
*:has(> *:only-child) > *:only-child > .tgx-attach-action-buttons > .btn-delete,
*:has(> *:only-child) > *:only-child > .tgx-attach-action-buttons > .btn-move {
    display: none !important;
}

/* ==========================================================================
   Markdown typography
   ========================================================================== */

.render-markdown-header {
    margin: 1.6rem 0 0.8rem;
    line-height: 1.35;
    font-weight: 700;
}

.render-markdown-h1 {
    font-size: clamp(1.9rem, 3.2vw, 2.45rem);
}

.render-markdown-h2 {
    font-size: clamp(1.65rem, 2.7vw, 2rem);
}

.render-markdown-h3 {
    font-size: clamp(1.4rem, 2.2vw, 1.7rem);
}

.render-markdown-h4 {
    font-size: clamp(1.2rem, 1.9vw, 1.45rem);
}

.render-markdown-h5 {
    font-size: clamp(1.08rem, 1.6vw, 1.2rem);
}

.render-markdown-h6 {
    font-size: clamp(0.98rem, 1.4vw, 1.05rem);
}

.render-markdown-header-anchor {
    display: none;
    margin-left: 0.5rem;
    color: var(--c-primary-600);
    text-decoration: none;
    opacity: 0.7;
}

.render-markdown-header:hover .render-markdown-header-anchor,
.render-markdown-header:focus-within .render-markdown-header-anchor {
    display: inline;
}

.render-markdown-header-anchor:hover {
    opacity: 1;
}

.render-markdown-paragraph {
    margin: 0 0 1rem;
    line-height: 1.75;
    text-wrap: pretty;
}

.render-markdown-divider {
    margin: 1.4rem 0;
    border: 0;
    border-top: 1px solid #c8d2e1;
    border-top: 1px solid color-mix(in srgb, var(--c-primary-600) 30%, white);
}

.render-markdown-list {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.render-markdown-list .render-markdown-list {
    margin: 0.45rem 0 0.2rem;
}

.render-markdown-list-item {
    margin: 0.3rem 0;
    line-height: 1.65;
}

.render-markdown-blockquote {
    margin: 1.1rem 0;
    padding: 0.75rem 1rem;
    border-left: 0.3rem solid #8db0d9;
    border-left: 0.3rem solid color-mix(in srgb, var(--c-primary-600) 40%, white);
    border-radius: 0 0.5rem 0.5rem 0;
    background: #f4f8fc;
    background: color-mix(in srgb, var(--c-primary-600) 7%, white);
}

.render-markdown-pre {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border-radius: var(--r-md);
    overflow-x: auto;
    background: #0f1a28;
    color: #e7edf7;
    line-height: 1.55;
}

.render-markdown-code-block {
    background: transparent;
    color: inherit;
    font-size: 0.95rem;
}

.render-markdown-code-inline {
    background: #eaf1fa;
    background: color-mix(in srgb, var(--c-primary-600) 10%, white);
    border-radius: 0.35rem;
    padding: 0.1rem 0.3rem;
    font-size: 0.92em;
}

.render-markdown-link {
    text-decoration-thickness: 0.09em;
    text-underline-offset: 0.18em;
}

.render-markdown-link-external::after {
    content: "\2197";
    margin-left: 0.22rem;
    font-size: 0.86em;
    opacity: 0.8;
}

.render-markdown-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: var(--r-sm);
}

.render-markdown-table-wrap {
    margin: 1rem 0;
    overflow-x: auto;
}

.render-markdown-table {
    width: 100%;
    min-width: 32rem;
    border-collapse: collapse;
}

.render-markdown-table-head-cell,
.render-markdown-table-cell {
    padding: 0.6rem 0.75rem;
    border: 1px solid #cdd9e8;
    border: 1px solid color-mix(in srgb, var(--c-primary-600) 22%, white);
    vertical-align: top;
}

.render-markdown-table-head-cell {
    font-weight: 700;
    background: #eef4fb;
    background: color-mix(in srgb, var(--c-primary-600) 12%, white);
}

@media (max-width: 768px) {
    .render-markdown-paragraph {
        line-height: 1.65;
    }

    .render-markdown-table {
        min-width: 24rem;
    }
}

/* ==========================================================================
   Insertion zone
   ========================================================================== */

.tgx-insertion-zone {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-around !important;
    align-items: center !important;

    height: 100% !important;
    width: 100% !important;

    border-radius: var(--r-sm);
    text-decoration: none !important;
    padding: 1.5rem !important;

    opacity: 0.85 !important;
    background-color: rgba(255, 255, 255, 0.75) !important;

    transition: opacity var(--tr-mid),
    border var(--tr-mid),
    transform var(--tr-mid),
    box-shadow var(--tr-mid) !important;
}

.tgx-insertion-zone:hover {
    opacity: 1 !important;
}

.tgx-insertion-zone span {
    color: transparent;
    background-clip: text;
    background-image: var(--grad-text);

    font-size: 1.6rem;
    font-weight: 700;
}

.tgx-insertion-zone div {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;

    font-size: 4rem;
    color: #fff;

    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    font-weight: 300;

    background: var(--grad-primary);
    margin-bottom: 1rem;
}

/* ==========================================================================
   Quill overrides
   ========================================================================== */

.ql-container {
    font-size: unset !important;
}

.ql-editor {
    padding: 0 !important;
}

.ql-toolbar {
    width: 100%;
}

/* Сброс inline стилей редактора */
.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;
}

/* ==========================================================================
   Tree
   ========================================================================== */

.tree {
    font-size: 0.95rem;
}

.tree ul {
    list-style: none;
    margin: 0;
    padding-left: 1rem;
}

.tree li {
    margin: 0.4rem 0;
    position: relative;
    text-wrap: nowrap;
}

.tree li::before {
    content: "";
    position: absolute;
    left: -1rem;
    top: 0.7rem;
    width: 0.8rem;
    height: 1px;
}

.tree li > .action {
    opacity: 0;
    transition: opacity var(--tr-mid);
}

.tree li:hover > .action {
    opacity: 1;
}

.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 button:hover,
.tree .add-page:hover {
    text-decoration: underline;
}

.tree .icon-toggle {
    transition: transform var(--tr-fast);
}

.tree button[aria-expanded="true"] .icon-toggle {
    transform: rotate(90deg);
}

.tree .add-page {
    cursor: pointer;
}

/* ==========================================================================
   Bookmark login corner
   ========================================================================== */

.tgx-bookmark-login {
    position: fixed;
    inset: 0 auto auto 0;
    width: 2rem;
    height: 2rem;

    display: block;
    z-index: var(--z-top);
    cursor: pointer;
}

.tgx-bookmark-login::before {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(315deg, var(--c-primary-600) 0%, var(--c-primary-900) 100%);
    clip-path: polygon(0 0, 100% 0, 0 100%);

    transform: scale(1);
    transform-origin: top left;
    opacity: 0.05;

    transition: transform 0.25s ease, opacity 0.25s ease;
}

.tgx-bookmark-login:hover::before {
    transform: scale(2);
    opacity: 1;
}

/* ==========================================================================
   Pre text container
   ========================================================================== */

.tgx-pre-text-container {
    text-wrap: wrap;
    text-align: justify;
    overflow: auto;
    white-space: pre-wrap;
}

/* ==========================================================================
   File actions (delete / download)
   ========================================================================== */

.tgx-delete-file,
.tgx-download-file {
    position: absolute;
    top: -0.3rem;

    padding: 0.1rem;
    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;
    cursor: pointer;
    z-index: var(--z-modal);

    border-radius: 50%;
    line-height: 1;
    border: none;
    text-decoration: none;

    background: var(--grad-primary-inverse);
}

.tgx-delete-file {
    right: -0.3rem;
}

.tgx-download-file {
    left: -0.3rem;
}

.tgx-delete-file i {
    font-size: 1.2rem;
}

.tgx-download-file i {
    font-size: .7rem;
    padding: 4px;
}

.tgx-upload-field-multiple {
    width: 100%;
}

.tgx-upload-field-multiple-file > .tgx-upload-add,
.tgx-upload-field-multiple-image > .tgx-upload-add {
    display: none !important;
}

.tgx-upload-item:not(.tgx-upload-item-filled) > .tgx-delete-file {
    display: none !important;
}

.tgx-upload-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tgx-upload-item {
    position: relative;
    width: var(--size-upload-card);
    min-width: var(--size-upload-card);
    height: var(--size-upload-card);
}

.tgx-upload-card {
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: var(--size-upload-card);
    height: var(--size-upload-card);
    border-radius: var(--r-md);
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.25);
    border: 1px solid rgb(49 116 184 / 22%);
    background: #fff;
    overflow: hidden;
}

.tgx-upload-card .tgx-upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--c-primary-600);
    opacity: 0.75;
    transition: opacity var(--tr-mid), transform var(--tr-mid);
}

.tgx-upload-card .tgx-upload-icon i {
    font-size: var(--size-upload-preview-icon);
}

.tgx-upload-card-image .tgx-upload-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tgx-upload-card-image:not(.is-filled) .tgx-upload-image {
    opacity: 0;
}

.tgx-upload-card-image.is-filled .tgx-upload-icon {
    opacity: 0;
    transform: scale(0.9);
}

.tgx-upload-card-image.is-filled:hover::before,
.tgx-upload-card-file.is-filled:hover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--upload-overlay-bg);
    z-index: 1;
}

.tgx-upload-card-image.is-filled:hover::after,
.tgx-upload-card-file.is-filled:hover::after {
    content: "\F4CA";
    font-family: "bootstrap-icons", serif;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: var(--size-upload-preview-icon);
    z-index: 2;
}

.tgx-upload-card-file {
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.4rem;
}

.tgx-upload-card-file .tgx-upload-icon,
.tgx-upload-card-file .tgx-upload-file-name {
    transition: opacity var(--tr-mid), transform var(--tr-mid);
}

.tgx-upload-card-file:not(.is-filled) .tgx-upload-file-name {
    display: none;
}

.tgx-upload-file-name {
    width: 100%;
    font-size: 0.62rem;
    line-height: 1.2;
    color: #58677d;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tgx-upload-card-file.is-filled .tgx-upload-icon {
    opacity: 1;
}

.tgx-upload-card-file.is-filled:hover .tgx-upload-icon,
.tgx-upload-card-file.is-filled:hover .tgx-upload-file-name {
    opacity: 0;
    transform: scale(0.95);
}

.tgx-upload-add {
    width: var(--size-upload-card);
    height: var(--size-upload-card);
    border-radius: var(--r-md);
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.25);
}

.tgx-upload-add i {
    font-size: var(--size-upload-add-icon);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.tgx-form {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
}

.tgx-form-label {
    display: flex;
    align-items: center;
}

.tgx-form-label label {
    font-size: 18px;
}

.tgx-form-value input,
.tgx-form-value select,
.tgx-form-value textarea {
    box-shadow: var(--shadow-2);
    border-radius: var(--r-md) !important;
    padding: 0.5rem 1rem !important;
}

/* Ensure CodeMirror fullscreen layer stays above modal title/header/content. */
.CodeMirror-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
}

.CodeMirror-fullscreen .CodeMirror-scroll {
    max-height: none !important;
}

/* Record modal columns */
.tgx-modal-record-table {
    width: 100%;
    table-layout: fixed;
}

.tgx-modal-record-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.tgx-modal-record-layout {
    flex: 1 1 auto;
    min-height: 0;
}

.tgx-modal-record-scroll {
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.tgx-modal-record-host {
    min-height: 0;
}

.tgx-modal-record-host > .tgx-box-container-blur {
    flex: 1 1 auto;
    min-height: 0;
}

.tgx-modal-record-table .tgx-modal-form-row {
    width: 100%;
}

.tgx-modal-record-table .tgx-modal-record-label-cell {
    width: 100%;
    min-width: 0;
    text-align: left !important;
    vertical-align: top;
}

.tgx-modal-record-table .tgx-modal-record-value-cell {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.tgx-modal-record-table .tgx-modal-record-value-cell .form-control,
.tgx-modal-record-table .tgx-modal-record-value-cell .form-select,
.tgx-modal-record-table .tgx-modal-record-value-cell textarea {
    width: 100%;
}

@media (min-width: 768px) {
    .tgx-modal-record-table .tgx-modal-record-label-cell {
        width: 14rem;
        min-width: 14rem;
        max-width: 14rem;
        text-align: right !important;
        padding-right: 1rem;
    }
}

@media (max-width: 767.98px) {
    .tgx-modal-record-dialog {
        margin: 0.25rem;
        min-height: calc(100% - 0.5rem);
    }

    .tgx-modal-record-host {
        min-height: calc(100dvh - 0.5rem);
    }

    .tgx-modal-record-host > .tgx-box-container-blur {
        height: 100%;
        max-height: calc(100dvh - 0.5rem);
    }
}

/* Expanded field mode inside modal forms (prevents row overlap on large editors). */
.tgx-box-container-blur .tgx-row-expanded {
    align-items: flex-start
}

.tgx-box-container-blur .tgx-row-expanded .tgx-field-expanded {
    width: 100%
}

@media (min-width: 768px) {
    .tgx-box-container-blur .tgx-row-expanded {
        flex-direction: column
    }

    .tgx-box-container-blur .tgx-row-expanded > .tgx-form-label,
    .tgx-box-container-blur .tgx-row-expanded > td:first-child {
        width: 100%;
        max-width: none;
        min-width: 0;
        text-align: left;
        padding-right: 0;
    }

    .tgx-box-container-blur .tgx-row-expanded > .tgx-form-value,
    .tgx-box-container-blur .tgx-row-expanded > td:last-child {
        width: 100%;
        max-width: none;
        min-width: 0;
        flex: 1 1 auto;
    }
}

/* ==========================================================================
   Blur Container
   ========================================================================== */

.box-container-blur,
.tgx-box-container-blur {
    border: 3px solid rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);

    padding: clamp(1rem, 3.2vw, 2.5rem);
    color: #fff;

    border-radius: var(--r-xl);
    box-shadow: var(--shadow-2);
}

.box-container-blur a,
.tgx-box-container-blur a {
    opacity: .75;
    color: white;
}

.box-container-blur a:hover,
.tgx-box-container-blur a:hover {
    opacity: 1
}

.box-container-blur .accordion-item,
.tgx-box-container-blur .accordion-item {
    background: unset
}

.box-container-blur .accordion-body,
.tgx-box-container-blur .accordion-body {
    color: white
}

.box-container-blur code,
.tgx-box-container-blur code {
    color: #d7e7ef
}

/* Mobile override: keep compact padding even when TGX utility classes are present. */
@media (max-width: 768px) {
    .tgx-box-container-blur {
        padding: 1.5rem
    }
}

/* ==========================================================================
   Buttons (primary/light)
   ========================================================================== */

.tgx-btn-primary,
.tgx-btn-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    opacity: 0.95;
    cursor: pointer;
    line-height: 0;

    border: none;
    text-decoration: none;

    border-radius: var(--r-xl);
    text-transform: uppercase;
    font-weight: 700;
}

.tgx-btn-primary {
    background: var(--grad-primary);
    box-shadow: var(--shadow-3);
    color: #fff !important;
    padding: 1.5rem 2rem;
}

.tgx-btn-primary:not(:disabled):hover {
    opacity: 1;
    background: var(--grad-primary-rev);
}

.tgx-btn-primary:disabled {
    opacity: .75;
}

.tgx-btn-light {
    background: #fff;
    box-shadow: var(--shadow-2);
    color: var(--c-primary-500) !important;
    padding: 1.31rem 1.5rem;
}

.tgx-btn-light:hover {
    opacity: 1;
}

.tgx-btn-primary *,
.tgx-btn-light * {
    line-height: 0;
}

/* Bootstrap backdrop tweak */
.modal-backdrop.show {
    opacity: 0.75 !important;
}

/* ==========================================================================
   Text shadow + white color utility
   ========================================================================== */

.tgx-text-shadow,
.tgx-text-shadow * {
    text-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
}

.tgx-color-white,
.tgx-color-white * {
    color: #fff !important;
}

/* ==========================================================================
   Loader
   ========================================================================== */

body.tgx-loader {
    height: 100%;
}

.tgx-loader {
    --loader-size: 64px;
    --loader-scale-duration: 0.3s;

    position: relative;
    overflow: hidden;
    pointer-events: none;
    cursor: wait;

    height: auto;
    width: 100%;
}

.tgx-loader > * {
    opacity: 0.4;
    filter: blur(10px);
}

.tgx-loader::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;

    width: 100%;
    height: 100%;
    max-width: var(--loader-size);
    max-height: var(--loader-size);

    background-image: url(/public/assets/images/gif/loader.svg);
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;

    transform: translate(-50%, -50%) scale(0);
    opacity: 1;

    animation: scaleUp var(--loader-scale-duration) ease-in-out forwards;
}

@keyframes scaleUp {
    from {
        transform: translate(-50%, -50%) scale(0);
    }
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.tgx-bubble {
    position: fixed;
    z-index: var(--z-top);
    background: #fff;
    border-radius: var(--r-xl);
    padding: 1rem 2rem;
    filter: var(--bubble-drop-shadow);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(var(--enter-x, 0px), var(--enter-y, 10px)) scale(0.98);
    transition: var(--bubble-transition-closed);
    isolation: isolate;

    --arrow-size: clamp(12px, 2.2vw, 18px);
    --arrow-x: 80px;
    --arrow-y: 60px;
}

.tgx-bubble[data-state="measuring"] {
    transition: none;
    transform: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.tgx-bubble[data-state="open"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(0, 0) scale(1);
    transition: var(--bubble-transition-open);
}

.tgx-bubble__title {
    font-size: clamp(18px, 3.6vw, 28px);
    font-weight: 700;
    color: var(--c-primary-900);
    margin: 0 0 10px 0;
    line-height: 1.1;
    text-align: center;
}

.tgx-bubble__text {
    font-size: clamp(14px, 3vw, 20px);
    opacity: 0.75;
    margin: 0;
    text-align: center;
    white-space: pre-wrap;
}

.tgx-bubble__actions {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.tgx-bubble__action {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: clamp(14px, 2.8vw, 18px);
    font-weight: 600;
    color: var(--c-primary-700, #1b66ff);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.tgx-bubble__action:hover {
    color: var(--c-primary-800, #1556d6);
}

.tgx-bubble__action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.tgx-bubble__close {
    display: none;
    position: absolute;
    top: 10px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: #9aa3ad;
}

.tgx-bubble__close:hover {
    color: #5f6b77;
}

.tgx-bubble::after {
    content: "";
    position: absolute;
    width: var(--arrow-size);
    height: var(--arrow-size);
    background: inherit;
    transform: rotate(45deg);
    z-index: -1;
    box-shadow: none;
}

.tgx-bubble[data-side="top"] {
    transform-origin: center bottom;
    --enter-y: 10px;
    --enter-x: 0px;
}

.tgx-bubble[data-side="top"]::after {
    left: calc(var(--arrow-x) - (var(--arrow-size) / 2));
    top: calc(100% - (var(--arrow-size) / 2));
}

.tgx-bubble[data-side="bottom"] {
    transform-origin: center top;
    --enter-y: -10px;
    --enter-x: 0px;
}

.tgx-bubble[data-side="bottom"]::after {
    left: calc(var(--arrow-x) - (var(--arrow-size) / 2));
    top: calc(-1 * (var(--arrow-size) / 2));
}

.tgx-bubble[data-side="left"] {
    transform-origin: right center;
    --enter-x: 10px;
    --enter-y: 0px;
}

.tgx-bubble[data-side="left"]::after {
    top: calc(var(--arrow-y) - (var(--arrow-size) / 2));
    left: calc(100% - (var(--arrow-size) / 2));
}

.tgx-bubble[data-side="right"] {
    transform-origin: left center;
    --enter-x: -10px;
    --enter-y: 0px;
}

.tgx-bubble[data-side="right"]::after {
    top: calc(var(--arrow-y) - (var(--arrow-size) / 2));
    left: calc(-1 * (var(--arrow-size) / 2));
}

@media (prefers-reduced-motion: reduce) {
    .tgx-bubble {
        transition: none !important;
    }
}
