.chtd-ai-plus-floating-group {
    align-items: center;
    gap: 4px;
    min-height: 31px;
}

/* Header desktop: keep all information blocks on the same two-row grid. */
@media (min-width: 769px) {

    #id_navbar-static-top,
    #id_header_group_chuyenhetoado,
    #id_header_group_dieukiendoi {
        height: 58px !important;
    }

    #id_header_group_chuyenhetoado,
    #id_header_group_dieukiendoi {
        align-items: stretch !important;
    }

    #id_header_group_chuyenhetoado {
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
    }

    #id_header_group_chuyenhetoado>div:first-child {
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
    }

    #id_header_group_timkiemdiadanh_arcgis {
        flex: 0 0 auto !important;
    }

    #id_header_group_dieukiendoi {
        display: flex !important;
        flex: 0 1 1055px !important;
        min-width: 0 !important;
        margin-left: auto !important;
        justify-content: flex-end !important;
    }

    #id_header_group_dieukiendoi>#id_header_group_A,
    #id_header_group_dieukiendoi>#id_header_group_wgs84vn2000,
    #id_header_group_dieukiendoi>#id_header_group_B,
    #id_header_group_dieukiendoi>#id_header_group_donvihanhchinh,
    #id_header_group_dieukiendoi>#id_header_dropdown_docao {
        box-sizing: border-box !important;
        height: 58px !important;
        margin: 0 !important;
        border-left: 0 !important;
        border-right: 1px solid #cbd5e1 !important;
    }

    #id_header_group_dieukiendoi>#id_header_group_A {
        display: flex !important;
        flex: 0 0 220px;
        flex-direction: column;
        justify-content: center;
        width: 220px !important;
        padding: 0 0 0 7px !important;
        border-left: 1px solid #cbd5e1 !important;
    }

    #id_header_group_dieukiendoi>#id_header_group_wgs84vn2000 {
        display: flex !important;
        flex: 0 0 240px;
        flex-direction: column;
        justify-content: center;
        width: 240px !important;
        padding: 0 0 0 6px !important;
    }

    #id_header_group_dieukiendoi>#id_header_group_B {
        display: flex !important;
        flex: 0 0 260px;
        flex-direction: column;
        justify-content: center;
        width: 260px !important;
        padding: 0 10px !important;
        overflow: hidden !important;
    }

    #id_header_group_dieukiendoi>#id_header_group_donvihanhchinh {
        display: flex !important;
        flex: 1 1 240px;
        flex-direction: column;
        justify-content: center;
        min-width: 0 !important;
        max-width: 240px !important;
        width: 240px !important;
        padding: 0 0 0 10px !important;
        overflow: hidden !important;
    }

    #id_header_group_dieukiendoi>#id_header_dropdown_docao {
        display: flex;
        flex: 0 0 92px;
        align-items: center;
        width: 92px !important;
        padding: 0 0 0 9.5px !important;
    }

    #id_header_group_A>h5,
    #id_header_group_wgs84vn2000>h5,
    #id_header_group_donvihanhchinh>h5 {
        display: flex !important;
        flex: 0 0 24px !important;
        height: 24px !important;
        min-height: 24px !important;
        align-items: center !important;
        margin: 0 !important;
        line-height: 16px !important;
    }

    #id_header_group_donvihanhchinh>h5 {
        min-width: 0 !important;
        white-space: nowrap !important;
    }

    #id_header_group_donvihanhchinh>h5>span[id^="id_header_txt_dvhc"] {
        display: block !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    #id_header_group_A>h5>img,
    #id_header_group_wgs84vn2000>h5>img,
    #id_header_group_donvihanhchinh>h5>img {
        flex: 0 0 auto;
    }

    #id_header_group_B>div {
        display: flex !important;
        height: 24px !important;
        min-height: 24px !important;
        align-items: center !important;
        margin: 0 !important;
        min-width: 0 !important;
        white-space: nowrap !important;
    }

    #id_header_group_B>div:first-child>div:first-child,
    #id_header_group_B>div:nth-child(2)>div:first-child {
        flex: 0 0 78px;
        width: 78px !important;
    }

    #id_header_sl_cha_kinhtuyentruc {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
    }

    #id_header_sl_cha_kinhtuyentruc .select2-container {
        width: 100% !important;
    }

    #id_header_group_B .radio {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    #id_header_group_B>div:nth-child(2)>div:last-child {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    #id_header_group_B>div:nth-child(2)>div:last-child>b,
    #id_header_group_B>div:nth-child(2)>div:last-child>span {
        white-space: nowrap !important;
    }

    #id_header_dropdown_docao>h5 {
        margin: 0 !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
    }

    #id_header_dropdown_docao>h5>p {
        margin-top: 1px !important;
        line-height: 1.15 !important;
        max-width: 85px !important;
        white-space: normal !important;
    }
}

.chtd-ai-plus-map-button {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 31px;
    height: 31px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgb(0 0 0 / 30%);
    cursor: pointer;
}

.chtd-ai-plus-map-button i {
    font-size: 11px;
    line-height: 1.2;
}

.chtd-ai-plus-map-button b {
    color: #0284C7;
    font-family: "Font Awesome 4", sans-serif;
    font-size: 9.5px;
    line-height: 1;
}

.chtd-ai-plus-map-button:hover {
    background: #eff6ff;
}

.chtd-ai-plus-map-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.chtd-header-shared-projection {
    width: 260px !important;
}

.chtd-header-shared-projection #id_header_text_kinhtuyentruc_giatri {
    display: none !important;
}

.chtd-header-shared-projection #id_header_sl_cha_kinhtuyentruc {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    padding-right: 0 !important;
    border-right: 0 !important;
}

.chtd-header-shared-projection #id_header_sl_cha_kinhtuyentruc .select2-container {
    width: 100% !important;
}

.chtd-header-shared-projection #id_header_sl_cha_kinhtuyentruc .select2-selection--single {
    height: 24px !important;
    border-color: #cbd5e1 !important;
}

.chtd-header-shared-projection #id_header_sl_cha_kinhtuyentruc .select2-selection__rendered {
    padding-left: 7px !important;
    color: #1f2937 !important;
    font-size: 12px !important;
    line-height: 22px !important;
}

.chtd-header-shared-projection #id_header_sl_cha_kinhtuyentruc .select2-selection__arrow {
    height: 22px !important;
}

@keyframes chtd-pulse-meridian-boundary {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgb(220 38 38 / 80%);
    }

    50% {
        box-shadow: 0 0 10px 4px rgb(220 38 38 / 35%);
    }
}

#id_header_group_B.chtd-meridian-outside-boundary {
    background: rgb(254 226 226 / 72%) !important;
    border-left: 3px solid #dc2626 !important;
}

#id_header_sl_cha_kinhtuyentruc.chtd-meridian-outside-boundary .select2-selection--single {
    animation: chtd-pulse-meridian-boundary 1s infinite !important;
    border: 2px solid #dc2626 !important;
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.tooltip.chtd-meridian-boundary-tooltip {
    max-width: 340px !important;
}

.tooltip.chtd-meridian-boundary-tooltip .tooltip-inner {
    max-width: 340px;
    padding: 7px 10px;
    background-color: #b93636 !important;
    color: #fff !important;
    font-size: 12px;
    font-weight: 500;
}

.tooltip.chtd-meridian-boundary-tooltip.in {
    opacity: 1 !important;
}

.tooltip.chtd-meridian-boundary-tooltip.bottom .tooltip-arrow {
    border-bottom-color: #b93636 !important;
}

.chtd-ai-plus-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 99999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgb(15 23 42 / 56%);
}

.chtd-ai-plus-modal {
    --chtd-ai-brand: #00CCFF;
    --chtd-ai-brand-dark: #036B86;
    --chtd-ai-brand-soft: #F0FBFF;
    --chtd-ai-brand-soft-hover: #D9F7FF;
    --chtd-ai-brand-border: #8AE8FF;

    display: flex;
    flex-direction: column;
    width: 590px;
    max-width: 100%;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border: 1px solid var(--chtd-ai-brand-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 50px rgb(15 23 42 / 30%);
    color: #1e293b;
}

@media (min-width: 769px) {
    .chtd-ai-plus-overlay {
        align-items: flex-start;
        justify-content: flex-start;
        padding: 0;
        background: transparent;
        pointer-events: none;
    }

    .chtd-ai-plus-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 350px;
        max-height: 100vh;
        border-radius: 8px;
        pointer-events: auto;
    }

    .chtd-ai-plus-header {
        padding: 4px 6px;
    }

    .chtd-ai-plus-body {
        padding: 0;
    }

    .chtd-ai-plus-dropzone {
        padding: 22px 8px;
    }

}

.chtd-ai-plus-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--chtd-ai-brand-border);
    background: var(--chtd-ai-brand-soft);
}

.chtd-ai-plus-header-main {
    display: flex;
    flex: 0 0 auto;
    order: 2;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

.chtd-ai-plus-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chtd-ai-plus-toolbar {
    display: flex;
    min-width: 0;
    order: 1;
    align-items: center;
    gap: 5px;
    color: #334155;
    font-size: 12px;
    white-space: nowrap;
}

.chtd-ai-plus-toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

.chtd-ai-plus-toolbar input {
    margin: 0;
}

.chtd-ai-plus-toolbar .is-near {
    color: #0099CC;
}

.chtd-ai-plus-toolbar .is-near input {
    accent-color: #0099CC;
}

.chtd-ai-plus-toolbar .is-order {
    color: #C026D3;
}

.chtd-ai-plus-toolbar .is-order input {
    accent-color: #C026D3;
}

.chtd-ai-plus-toolbar .is-loop {
    color: #00A63C;
}

.chtd-ai-plus-toolbar .is-loop input {
    accent-color: #00A63C;
}

.chtd-ai-plus-toolbar-separator {
    align-self: stretch;
    border-left: 1px solid #cbd5e1;
}

.chtd-ai-plus-export-excel {
    display: inline-flex;
    margin-left: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.chtd-ai-plus-export-excel img {
    width: 20px;
    height: 20px;
}

.chtd-ai-plus-close {
    padding: 0 0 0 1px;
    border: 0;
    background: transparent;
    color: #111;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.chtd-ai-plus-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
}

.chtd-ai-plus-header-choose,
.chtd-ai-plus-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--chtd-ai-brand-border);
    border-radius: 5px;
    background: #fff;
    color: var(--chtd-ai-brand-dark);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.chtd-ai-plus-header-choose {
    width: 22px;
    height: 22px;
    padding: 0;
    color: #f59e0b;
}

.chtd-ai-plus-header-choose span {
    display: none;
}

.chtd-ai-plus-header-choose:hover,
.chtd-ai-plus-action:hover {
    border-color: var(--chtd-ai-brand);
    background: var(--chtd-ai-brand-soft-hover);
}

.chtd-ai-plus-header-choose:disabled,
.chtd-ai-plus-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.chtd-ai-plus-action.is-cancel {
    border-color: #cbd5e1;
    background: #fff;
    color: #475569;
}

.chtd-ai-plus-action.is-save {
    padding: 0 3px 2px;
    border-color: var(--page-color);
    border-radius: 3px;
    background: var(--page-color);
    color: #fff;
    font-weight: 400;
    line-height: 1.5;
}

.chtd-ai-plus-header-actions .is-save {
    padding: 0 3px 2px;
}

.chtd-ai-plus-dropzone.is-hidden {
    display: none;
}

.chtd-ai-plus-dropzone {
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: center;
    padding: 18px 16px;
    border: 0;
    border-radius: 0;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    text-align: center;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.chtd-ai-plus-dropzone::after,
.chtd-ai-plus-preview-content::after {
    position: absolute;
    inset: 6px;
    border: 1px dashed var(--chtd-ai-brand);
    border-radius: 6px;
    content: "";
    pointer-events: none;
}

.chtd-ai-plus-preview-content::after {
    cursor: pointer;
    pointer-events: auto;
}

.chtd-ai-plus-dropzone:hover,
.chtd-ai-plus-dropzone.is-dragover {
    background: var(--chtd-ai-brand-soft);
}

.chtd-ai-plus-dropzone i,
.chtd-ai-plus-dropzone strong,
.chtd-ai-plus-dropzone span {
    display: block;
}

.chtd-ai-plus-dropzone i {
    margin-bottom: 7px;
    color: var(--chtd-ai-brand);
    font-size: 25px;
}

.chtd-ai-plus-dropzone strong {
    font-size: 13px;
}

.chtd-ai-plus-dropzone span {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.chtd-ai-plus-preview {
    display: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
}

.chtd-ai-plus-preview.is-visible {
    display: block;
}

.chtd-ai-plus-preview-content {
    display: flex;
    position: relative;
    min-height: 78px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 7px;
    border-radius: 0;
    background: #f8fafc;
}

.chtd-ai-plus-preview-content img,
.chtd-ai-plus-preview-content object {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 190px;
    object-fit: contain;
}

@media (min-width: 769px) {
    .chtd-ai-plus-dropzone,
    .chtd-ai-plus-preview-content {
        box-sizing: border-box;
        height: 204px;
    }
}

.chtd-ai-plus-error {
    display: none;
    padding: 7px 8px;
    color: #dc2626;
    font-size: 12px;
}

.chtd-ai-plus-error.is-visible {
    display: block;
}
