:root {
    --ui-scale: 1;
}

/* Phóng cả trang bằng zoom để layout reflow theo, không dùng transform (transform không chiếm chỗ nên dễ chồng). */
html.sw-ui-scaled {
    zoom: var(--ui-scale);
}

/* Nút trợ năng giữ kích thước thật, không bị phóng theo trang. */
html.sw-ui-scaled #sw-a11y-bar {
    zoom: calc(1 / var(--ui-scale));
}

#sw-a11y-bar {
    position: fixed;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    user-select: none;
    pointer-events: none;
}

#sw-a11y-bar > * {
    pointer-events: auto;
}

#sw-a11y-bar .sw-a11y-fab {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    padding: 0;
}

#sw-a11y-bar .sw-a11y-fab:active {
    cursor: grabbing;
}

#sw-a11y-bar .sw-a11y-icon {
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

#sw-a11y-bar .sw-a11y-pct {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    margin-top: 2px;
}

#sw-a11y-bar .sw-a11y-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 28px;
    background: rgba(24, 49, 83, 0.94);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

#sw-a11y-bar.is-open .sw-a11y-panel {
    display: flex;
}

#sw-a11y-bar .sw-a11y-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}

#sw-a11y-bar .sw-a11y-btn:hover,
#sw-a11y-bar .sw-a11y-btn:focus {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

/* Khi phóng to: chữ trong thẻ menu xuống dòng, bảng cuộn ngang thay vì đè lên cột bên cạnh. */
html.sw-auto-fit-layout.sw-ui-scaled .mmrp-item {
    height: auto;
    min-width: 0;
    align-items: flex-start;
}

html.sw-auto-fit-layout.sw-ui-scaled .mmrp-item-label,
html.sw-auto-fit-layout.sw-ui-scaled .mmrp-card-title span {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

html.sw-auto-fit-layout.sw-ui-scaled .dataTables_wrapper,
html.sw-auto-fit-layout.sw-ui-scaled .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

html.sw-auto-fit-layout.sw-ui-scaled #myTab.nav-tabs {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
}
