/* Root scope: mọi quy tắc giao diện của plugin chỉ tác động bên trong wrapper này. */
.xito-app {
    --xito-header-height: 100px;
    font-family: 'Merriweather', 'Roboto', serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
    min-width: 0;
    /* iOS chỉ tôn trọng text-size-adjust khi gắn gần gốc cây (html/body/wrapper),
       không phải khi chỉ gắn trên phần tử flex con. */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Giữ toàn bộ giao diện plugin thấp hơn WordPress Admin Bar. */
    position: relative;
    z-index: 9990;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    perspective: none !important;
    contain: none !important;
    isolation: auto !important;
    overflow: visible !important;
    will-change: auto !important;
    clip-path: none !important;
    mix-blend-mode: normal !important;
}

/* WordPress Admin Bar luôn là lớp cao nhất khi người dùng đăng nhập. */
#wpadminbar {
    z-index: 99999 !important;
}

/* =============================================================
   FONT RESET MẠNH: Loại bỏ font inline bị copy vào editor
   CSS !important trong stylesheet thắng cả inline style
   ============================================================= */

/* Vùng nội dung chuẩn: đặt font gốc */
.xito-app .x-body,
.xito-app .prayer-content,
.xito-app .reading,
.xito-app .xito-content {
    font-family: 'Merriweather', 'Roboto', serif !important;
}

/* Tất cả phần tử con kế thừa font — ngăn inline font-family ghi đè */
.xito-app .x-body *,
.xito-app .prayer-content *,
.xito-app .reading *,
.xito-app .xito-content * {
    font-family: inherit !important;
}

/* Ngoại lệ: thẻ code/pre giữ monospace */
.xito-app .x-body code, .xito-app .x-body pre,
.xito-app .prayer-content code, .xito-app .prayer-content pre,
.xito-app .reading code, .xito-app .reading pre,
.xito-app .xito-content code, .xito-app .xito-content pre {
    font-family: 'Courier New', Courier, monospace !important;
}

/* Header styles */
.xito-app .xito-header {
    background: #7a110d;
    padding: 8px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    /* Chiều cao cố định cho phép main wrapper bù chính xác khoảng trống. */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: var(--xito-header-height);
    box-sizing: border-box;
    z-index: 9990 !important;
    isolation: isolate;
    transform: none !important;
}
/* WP Admin Bar: header fixed top:0 bị che bởi #wpadminbar. */
body.admin-bar .xito-app .xito-header {
    top: 32px !important;
}
@media screen and (max-width: 782px) {
    body.admin-bar .xito-app .xito-header {
        top: 46px !important;
    }
}
.xito-app .xito-header-inner {
    position: relative !important;
    z-index: 2 !important;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 5%;
    box-sizing: border-box;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.xito-app .xito-header-left {
    display: flex;
    gap: 20px;
    align-items: center;
}
.xito-app .xito-header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}
.xito-app .xito-header-center {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin: 0 20px;
    gap: 15px;
}

/* Desktop header content - visible on desktop */
.xito-app .desktop-header-content {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.xito-app .header-nav-arrow {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
    user-select: none;
}
.xito-app .header-nav-arrow:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.1);
}
.xito-app .header-nav-arrow:active {
    transform: scale(0.95);
}
.xito-app .header-center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.3s;
}
.xito-app .header-center-content:hover {
    background: rgba(255,255,255,0.1);
}

/* Calendar month view popup */
.xito-app .calendar-month-popup {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    display: none;
    width: 350px;
    min-width: 0;
    max-width: calc(100vw - 20px);
    box-sizing: border-box;
    overflow-x: hidden;
    z-index: 2000;
}
.xito-app .calendar-month-popup.show {
    display: block;
}
.xito-app .calendar-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #7a110d;
}
.xito-app .calendar-month-title {
    font-weight: bold;
    color: #7a110d;
    font-size: 16px;
}
.xito-app .calendar-month-nav {
    display: flex;
    gap: 10px;
}
.xito-app .calendar-month-nav button {
    width: 30px;
    height: 30px;
    background: #7a110d;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.3s;
}
.xito-app .calendar-month-nav button:hover {
    opacity: 0.8;
}
.xito-app .calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 5px;
}
.xito-app .calendar-weekday {
    text-align: center;
    font-weight: bold;
    color: #7a110d;
    font-size: 12px;
    padding: 5px;
}
.xito-app .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.xito-app .calendar-loading {
    grid-column: 1 / -1;
    min-height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7a110d;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}
.xito-app .calendar-info-preview {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 54px;
    margin-top: 10px;
    padding: 10px;
    border-top: 1px solid rgba(122, 17, 13, 0.16);
    box-sizing: border-box;
    color: #333;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}
.xito-app .calendar-info-preview-title {
    display: block;
    max-width: 100%;
    color: #7a110d;
    font-weight: 700;
    white-space: normal !important;
    overflow-wrap: break-word !important;
}
.xito-app .calendar-info-preview-reading {
    display: block;
    max-width: 100%;
    margin-top: 2px;
    color: #555;
    white-space: normal !important;
    overflow-wrap: break-word !important;
}
.xito-app .calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    background: #f5f5f5;
    color: #333;
}
.xito-app .calendar-day:hover {
    background: #7a110d;
    color: #fff;
    transform: scale(1.1);
}
.xito-app .calendar-day.other-month {
    color: #ccc;
    background: #fafafa;
}
.xito-app .calendar-day.today {
    background: #5c8db8;
    color: #fff;
    font-weight: bold;
}
.xito-app .calendar-day.selected {
    background: #7a110d;
    color: #fff;
    font-weight: bold;
}
.xito-app .header-liturgy-info {
    text-align: center;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
}
.xito-app .header-liturgy-title {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 3px;
}
.xito-app .header-liturgy-reading {
    font-size: 12px;
    opacity: 0.9;
}
.xito-app .header-clock {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-top: 5px;
    font-family: monospace;
}
.xito-app .xito-header-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 24px;
    padding: 8px;
    border-radius: 5px;
    transition: background 0.3s;
    text-decoration: none;
    border: 0;
    background: transparent;
    font-family: inherit;
    line-height: 1;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    width: auto;
    height: auto;
}
.xito-app .xito-header-icon:hover {
    background: rgba(255,255,255,0.2);
}
.xito-app .xito-header-icon:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.xito-app .xito-header-icon > svg,
.xito-app .xito-header-icon svg,
.xito-app #settingsIcon svg,
.xito-app #settingsIcon > svg {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    flex: 0 0 24px;
    aspect-ratio: 1 / 1 !important;
    display: block;
    overflow: visible;
    fill: currentColor;
}

.xito-app .xito-header-setting-icon,
.xito-app #settingsIcon .xito-header-setting-icon {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    color: #ffffff;
    fill: currentColor;
    flex-shrink: 0 !important;
    flex: 0 0 22px !important;
    display: inline-block;
    vertical-align: middle;
    aspect-ratio: 1 / 1 !important;
    overflow: visible;
    transition: transform 0.3s ease;
}

.xito-app #settingsIcon:hover .xito-header-setting-icon,
.xito-app a:hover .xito-header-setting-icon,
.xito-app button:hover .xito-header-setting-icon {
    transform: rotate(90deg);
}

/* Icon Kinh Thánh dùng nét viền để dấu Thánh Giá không bị chìm vào bìa sách. */
.xito-app a#bibleIcon,
.xito-app a#bibleIcon:visited,
.xito-app a#bibleIcon:hover,
.xito-app a#bibleIcon:focus {
    color: #fff;
    text-decoration: none;
}
.xito-app #bibleIcon svg {
    fill: none;
    stroke: currentColor;
}

/* Mobile calendar icon - hidden on desktop */
.xito-app .mobile-calendar-icon {
    display: none;
}

/* Mobile calendar navigation container */
.xito-app .mobile-calendar-nav {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Show the calendar icon inside mobile nav */
.xito-app .mobile-calendar-nav .mobile-calendar-icon {
    display: flex;
    position: relative;
}

/* Mobile navigation arrows */
.xito-app .mobile-nav-arrow {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s;
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
}

.xito-app .mobile-nav-arrow:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

.xito-app .mobile-nav-arrow:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.4);
}

/* Mobile popup overlay — đặt BÊN TRONG .xito-header.
   Header-inner ở z-index 2, overlay ở z-index 1: bảng chọn luôn nhận click. */
.xito-app .mobile-popup-overlay {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}
.xito-app .mobile-popup-overlay.show {
    display: block !important;
}

/* Make sure our button is visible */
.xito-app .back-to-top#backToTop {
    display: none;
}
.xito-app .back-to-top#backToTop.show {
    display: flex;
}

/* Calendar dropdown */
.xito-app .calendar-dropdown {
    position: absolute;
    top: 45px;
    left: 0;
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    min-width: 320px;
    z-index: 1001;
}
.xito-app .calendar-dropdown.show {
    display: block;
}
.xito-app .calendar-nav-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.xito-app .calendar-nav-btn {
    width: 36px;
    height: 36px;
    background: #7a110d;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: opacity 0.3s;
}
.xito-app .calendar-nav-btn:hover {
    opacity: 0.8;
}
.xito-app .calendar-dropdown input[type="date"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}
.xito-app .calendar-current-date {
    text-align: center;
    color: #7a110d;
    font-weight: bold;
    margin-top: 8px;
    font-size: 14px;
}

/* Central Prayer Menu Dropdown */
.xito-app .prayer-menu-container {
    text-align: center;
    padding: 2px 0 4px 0;
    background: #f8f8f8;
    border-bottom: 2px solid #7a110d;
}
.xito-app .prayer-menu-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.xito-app .today-button {
    background: #d32f2f;
    border: 2px solid #b71c1c;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: #fff9c4;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    white-space: nowrap;
    display: inline-block;
}
.xito-app .today-button:hover {
    background: #c62828;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.4);
}
.xito-app .today-button:active {
    transform: translateY(0);
}
.xito-app .prayer-menu-dropdown {
    position: relative;
    display: inline-block;
}
.xito-app .prayer-menu-button {
    background: #fff;
    border: 2px solid #ddd;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 250px;
    justify-content: space-between;
}
.xito-app .prayer-menu-button:hover {
    border-color: #7a110d;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.xito-app .prayer-menu-button .arrow {
    font-size: 12px;
    transition: transform 0.3s;
}
.xito-app .prayer-menu-button.open .arrow {
    transform: rotate(180deg);
}
.xito-app .prayer-menu-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 8px;
    margin-top: 2px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}
.xito-app .prayer-menu-list.show {
    display: block;
}
.xito-app .prayer-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    color: #333;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 18px;
    border-radius: 5px;
    transition: all 0.2s;
    text-align: left;
    background: #f5f5f5;
}
.xito-app #currentPrayerName {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.xito-app .xito-prayer-icon {
    --xito-prayer-icon-color: rgba(198, 40, 40, 0.68);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.2em;
    height: 1.2em;
    /* Nền trắng/vàng: dùng đỏ dịu thay vì kế thừa màu chữ đen. */
    color: var(--xito-prayer-icon-color) !important;
    transition: color 0.2s ease;
}
.xito-app .xito-prayer-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    color: var(--xito-prayer-icon-color) !important;
    fill: var(--xito-prayer-icon-color) !important;
}
.xito-app .xito-prayer-icon svg path,
.xito-app .xito-prayer-icon svg circle,
.xito-app .xito-prayer-icon svg rect,
.xito-app .xito-prayer-icon svg g {
    color: var(--xito-prayer-icon-color) !important;
    fill: var(--xito-prayer-icon-color) !important;
}
.xito-app .prayer-menu-item-label {
    min-width: 0;
}
.xito-app .prayer-menu-item:hover {
    filter: brightness(0.92);
}
.xito-app .prayer-menu-item.current {
    background: #ff0000;
    color: #fff;
}
.xito-app .prayer-menu-item.past {
    background: #898989;
    color: #fff;
}
.xito-app .prayer-menu-item.current .xito-prayer-icon,
.xito-app .prayer-menu-item.past .xito-prayer-icon {
    --xito-prayer-icon-color: #fff;
}
.xito-app .prayer-menu-item.future {
    background: #fbf7df;
    color: #0b2d3c;
}

/* Thanh chuyển nhanh Giờ Kinh ở cuối bài đọc */
.xito-app .xito-bottom-prayer-nav-shell {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 24px auto 4px;
    padding: 16px 15px 4px;
    box-sizing: border-box;
}
.xito-app .xito-bottom-prayer-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    margin: 0;
    padding: 2px;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scroll-behavior: smooth;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}
.xito-app .xito-bottom-prayer-nav-shell.is-scrollable .xito-bottom-prayer-nav {
    justify-content: flex-start;
}
.xito-app .xito-bottom-prayer-nav::-webkit-scrollbar {
    display: none;
}
.xito-app .xito-bottom-prayer-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(211, 47, 47, 0.45);
    border-radius: 50%;
    background: #fff;
    color: #d32f2f;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.xito-app .xito-bottom-prayer-arrow[hidden] {
    display: none !important;
}
.xito-app .xito-bottom-prayer-arrow svg {
    width: 19px;
    height: 19px;
}
.xito-app .xito-bottom-prayer-arrow:hover,
.xito-app .xito-bottom-prayer-arrow:focus-visible {
    background: #d32f2f;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.28);
}
.xito-app .xito-bottom-prayer-arrow:focus-visible {
    outline: 3px solid rgba(211, 47, 47, 0.25);
    outline-offset: 2px;
}
.xito-app .xito-bottom-prayer-arrow:active {
    transform: translateY(0);
}
.xito-app .xito-bottom-prayer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    box-sizing: border-box;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.xito-app .xito-bottom-prayer-link.is-past {
    background: #7b7b7b;
    color: #fff;
}
.xito-app .xito-bottom-prayer-link.is-current {
    background: #d32f2f;
    color: #fff;
}
.xito-app .xito-bottom-prayer-link.is-current .xito-prayer-icon,
.xito-app .xito-bottom-prayer-link.is-past .xito-prayer-icon {
    --xito-prayer-icon-color: #fff;
}
.xito-app .xito-bottom-prayer-link.is-future {
    background: #fff3b0;
    color: #4e3b00;
}
.xito-app .xito-bottom-prayer-link:hover,
.xito-app .xito-bottom-prayer-link:focus-visible {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}
.xito-app .xito-bottom-prayer-link:focus-visible {
    outline: 3px solid rgba(122, 17, 13, 0.35);
    outline-offset: 2px;
}
.xito-app .xito-bottom-prayer-link:active {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}
.xito-app .xito-bottom-prayer-link .nav-text-desktop {
    display: inline;
}
.xito-app .xito-bottom-prayer-link .nav-text-mobile {
    display: none;
}

@media (max-width: 768px) {
    .xito-app .xito-bottom-prayer-nav-shell {
        margin-top: 18px;
        padding: 14px 8px 6px;
    }
    .xito-app .xito-bottom-prayer-link .xito-prayer-icon {
        width: 16px;
        height: 16px;
    }
    .xito-app .xito-bottom-prayer-arrow {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }
}

/* Events dropdown */
.xito-app .events-dropdown {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    background: #fbf7df;
    border: 2px solid #7a110d;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    min-width: 240px;
    max-width: min(340px, calc(100vw - 20px));
    z-index: 1001;
}
.xito-app .events-dropdown.show {
    display: block;
}
/* Ngoại Lịch menu styles */
.xito-app .ngoai-lich-menu-title {
    font-weight: bold;
    color: #630703;
    font-size: 15px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0d0d0;
}
.xito-app .ngoai-lich-menu {
    list-style: none;
    margin: 10px -15px -15px -15px;
    padding: 0;
}
.xito-app .ngoai-lich-menu-item {
    border-bottom: 1px solid #e8d8b0;
}
.xito-app .ngoai-lich-menu-item:last-child {
    border-bottom: none;
}
.xito-app .ngoai-lich-menu-item a {
    display: block;
    padding: 10px 2px;
    background: #fbf7df;
    color: #630703;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    font-size: 18px;
    transition: background 0.2s, color 0.2s;
    border-radius: 0;
}
.xito-app .ngoai-lich-menu-item a:hover {
    background: #d0d0d0;
    color: #630703;
}
@media (max-width: 900px) {
    .xito-app .ngoai-lich-menu-item a {
        font-size: 16px;
    }
}
.xito-app .events-content {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}
.xito-app .events-title {
    font-weight: bold;
    color: #7a110d;
    margin-bottom: 8px;
    font-size: 16px;
}
.xito-app .event-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.xito-app .event-item:last-child {
    border-bottom: none;
}

/* Settings dropdown */
.xito-app .settings-dropdown {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    min-width: 280px;
    max-width: min(400px, calc(100vw - 20px));
    z-index: 1001;
    text-align: left;
    box-sizing: border-box;
}
.xito-app .settings-dropdown.show {
    display: block;
}
/* Căn mọi hàng điều khiển theo lề trái (cùng trục với nhãn), tránh flex cha căn giữa */
.xito-app .settings-dropdown .font-size-control,
.xito-app .settings-dropdown .theme-buttons,
.xito-app .settings-dropdown .bold-toggle,
.xito-app .settings-dropdown .scroll-speed-control {
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.xito-app .setting-group {
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}
.xito-app .setting-group:last-child {
    margin-bottom: 0;
}
.xito-app .setting-label {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    margin-left: 0;
    padding-left: 0;
    display: block;
    font-size: 14px;
    text-align: left;
    width: 100%;
}
.xito-app .theme-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}
.xito-app .theme-btn {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}
.xito-app .theme-btn.active {
    border-color: #7a110d;
    border-width: 3px;
}
.xito-app .theme-btn:hover {
    border-color: #7a110d;
}
/* Theme color previews */
.xito-app .theme-btn[data-theme="white"] {
    background: #fff;
    color: #333;
}
.xito-app .theme-btn[data-theme="dark"] {
    background: #3a3a3a;
    color: #f2f2f2;
}
.xito-app .theme-btn[data-theme="paper"] {
    background: #f4e8d0;
    color: #2c2416;
}
.xito-app .scroll-speed-control {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 10px;
    margin-left: 0;
    padding-left: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.xito-app .scroll-speed-control input[type="range"] {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.xito-app .scroll-speed-value {
    font-weight: bold;
    font-size: 14px;
    color: #7a110d;
    min-width: 1.25em;
    flex-shrink: 0;
    text-align: center;
    line-height: 1;
}
.xito-app .scroll-speed-label {
    font-size: 12px;
    color: #666;
    min-width: 44px;
    flex-shrink: 0;
    text-align: left;
    margin: 0;
    padding: 0;
}
.xito-app .scroll-speed-label:last-child {
    text-align: right;
    min-width: 44px;
}

/* Main content wrapper to account for fixed header */
.xito-app .xito-main-wrapper {
    margin-top: var(--xito-header-height);
    min-height: calc(100vh - var(--xito-header-height));
}

/* Back to top button */
.xito-app .back-to-top {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: var(--xito-top-bg, rgba(122, 17, 13, 0.8));
    color: var(--xito-top-fg, #fff);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 999;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.xito-app .back-to-top.show {
    display: flex;
}
.xito-app .back-to-top:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.xito-app .back-to-top:active {
    transform: translateY(0);
}

/* Thanh công cụ đọc nổi */
.xito-app .xito-reading-toolbar {
    position: fixed;
    left: 50%;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    z-index: 9995;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    max-width: calc(100vw - 20px);
    padding: 5px 9px;
    border: 1px solid rgba(183, 28, 28, 0.42);
    border-radius: 50px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.95);
    color: #8d3038;
    box-shadow: 0 8px 24px rgba(54, 25, 20, 0.2);
    transform: translateX(-50%);
    opacity: 0.95;
    visibility: visible;
    transition: transform 0.28s ease, opacity 0.28s ease, visibility 0.28s ease, background-color 0.25s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.xito-app.theme-white .xito-reading-toolbar {
    background: rgba(255, 255, 255, 0.95);
}
.xito-app.theme-paper .xito-reading-toolbar {
    background: rgba(250, 242, 225, 0.95);
}
.xito-app.theme-dark .xito-reading-toolbar {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(48, 48, 48, 0.95);
    color: #f5d7d7;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.xito-app .xito-reading-toolbar.is-hidden {
    transform: translate(-50%, calc(100% + 110px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.xito-app .xito-reading-tool {
    width: 36px;
    height: 36px;
    min-width: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: inherit;
    font: 700 15px/1 'Roboto', sans-serif;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.xito-app .xito-reading-tool:hover,
.xito-app .xito-reading-tool:focus-visible {
    background: rgba(183, 28, 28, 0.11);
    outline: none;
}
.xito-app .xito-reading-tool:focus-visible {
    box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.28);
}
.xito-app .xito-reading-tool:active {
    transform: scale(0.92);
}
.xito-app .xito-reading-tool.is-active,
.xito-app .xito-reading-tool[aria-pressed="true"] {
    background: rgba(198, 40, 40, 0.16);
    color: #c62828;
}
.xito-app.theme-dark .xito-reading-tool.is-active,
.xito-app.theme-dark .xito-reading-tool[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}
.xito-app .xito-reading-tool-bold {
    font-family: Georgia, serif;
    font-size: 17px;
}
.xito-app .xito-reading-tool svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.xito-app .xito-theme-icon {
    display: none;
}
.xito-app #xitoToolbarTheme[data-theme="white"] .xito-theme-icon-white,
.xito-app #xitoToolbarTheme[data-theme="dark"] .xito-theme-icon-dark,
.xito-app #xitoToolbarTheme:not([data-theme]) .xito-theme-icon-paper,
.xito-app #xitoToolbarTheme[data-theme="paper"] .xito-theme-icon-paper {
    display: block;
}
.xito-app .xito-fs-icon {
    display: none;
}
.xito-app #xitoToolbarFullscreen .xito-fs-enter {
    display: block;
}
.xito-app #xitoToolbarFullscreen[aria-pressed="true"] .xito-fs-enter {
    display: none;
}
.xito-app #xitoToolbarFullscreen[aria-pressed="true"] .xito-fs-exit {
    display: block;
}
.xito-app .xito-reading-toolbar-divider {
    width: 1px;
    height: 24px;
    margin: 0 3px;
    flex: 0 0 1px;
    background: currentColor;
    opacity: 0.17;
}

/* Popup chia sẻ */
.xito-app .xito-share-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.58);
}
.xito-app .xito-share-overlay[hidden] {
    display: none !important;
}
.xito-app .xito-share-modal {
    position: relative;
    width: min(380px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 24px;
    border-radius: 18px;
    box-sizing: border-box;
    background: #fff;
    color: #333;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
}
.xito-app .xito-share-modal h2 {
    margin: 0 28px 10px;
    color: #7a110d;
    font-size: 21px;
}
.xito-app .xito-share-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3eeee;
    color: #6e2727;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}
.xito-app .xito-share-quote {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fbf7df;
    color: #4a2d2d;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.xito-app .xito-share-qr {
    width: 174px;
    min-height: 174px;
    margin: 0 auto 15px;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 10px;
    box-sizing: border-box;
    background: #fff;
}
.xito-app .xito-share-qr img,
.xito-app .xito-share-qr svg,
.xito-app .xito-share-qr canvas {
    display: block;
    width: 100%;
    height: auto;
}
.xito-app .xito-share-copy {
    min-height: 42px;
    padding: 10px 18px;
    border: 0;
    border-radius: 9px;
    background: #8b1717;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.xito-app .xito-share-copy-status {
    min-height: 20px;
    margin-top: 5px;
    color: #2e7d32;
    font-size: 13px;
}
.xito-app .xito-share-socials {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.xito-app .xito-share-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid rgba(122, 17, 13, 0.24);
    border-radius: 8px;
    color: #7a110d;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.xito-app .xito-share-socials svg {
    width: 16px;
    height: 16px;
}
html.xito-share-open,
html.xito-share-open body {
    overflow: hidden;
}

html.is-xito-auto-scrolling {
    scroll-behavior: auto !important;
}
html.is-xito-auto-scrolling .xito-main-wrapper,
html.is-xito-auto-scrolling .xito-webapp,
html.is-xito-auto-scrolling #xito-reading-content {
    will-change: transform;
}

/* Nhóm nổi: pause + chỉnh tốc độ — chỉ hiện khi tự động cuộn bật */
.xito-app .auto-scroll-floating-group {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 998;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
}
.xito-app .auto-scroll-floating-group > * {
    pointer-events: auto;
}
.xito-app .auto-scroll-floating-group.show {
    display: flex;
}
/* Desktop: + trên, pause giữa, − dưới (DOM: −, pause, + → order) */
@media (min-width: 769px) {
    .xito-app .auto-scroll-floating-group .auto-scroll-speed-plus { order: 1; }
    .xito-app .auto-scroll-floating-group .auto-scroll-stop-btn { order: 2; }
    .xito-app .auto-scroll-floating-group .auto-scroll-speed-minus { order: 3; }
}

.xito-app .auto-scroll-speed-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: rgba(74, 144, 226, 0.42);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    font-family: 'Roboto', sans-serif;
}
.xito-app .auto-scroll-speed-btn:hover:not(:disabled) {
    background: rgba(74, 144, 226, 0.62);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}
.xito-app .auto-scroll-speed-btn:active:not(:disabled) {
    transform: scale(0.96);
}
.xito-app .auto-scroll-speed-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Floating pause — cùng kích thước / palette với nút ± */
.xito-app .auto-scroll-stop-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    background: rgba(74, 144, 226, 0.42);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.xito-app .auto-scroll-stop-btn:hover {
    background: rgba(74, 144, 226, 0.62);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}
.xito-app .auto-scroll-stop-btn:active {
    transform: scale(0.96);
}

@media (max-width: 768px) {
    .xito-app .xito-reading-toolbar {
        gap: 1px;
        padding: 4px 7px;
    }
    .xito-app .xito-reading-tool {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }
    .xito-app .xito-reading-toolbar-divider {
        margin: 0 1px;
    }
    .xito-app .xito-share-modal {
        padding: 22px 16px 18px;
    }
    .xito-app .auto-scroll-floating-group {
        left: 50%;
        top: auto;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 4px);
        transform: translateX(-50%);
        flex-direction: row;
        gap: 10px;
    }
    .xito-app .auto-scroll-floating-group .auto-scroll-speed-plus,
    .xito-app .auto-scroll-floating-group .auto-scroll-speed-minus,
    .xito-app .auto-scroll-floating-group .auto-scroll-stop-btn {
        order: 0;
    }
    .xito-app .auto-scroll-stop-btn,
    .xito-app .auto-scroll-speed-btn {
        color: #8f3f47;
        background: rgba(143, 63, 71, 0.12);
        box-shadow: none;
    }
    .xito-app .auto-scroll-stop-btn:hover,
    .xito-app .auto-scroll-speed-btn:hover:not(:disabled) {
        background: rgba(143, 63, 71, 0.22);
        box-shadow: none;
    }
    .xito-app .auto-scroll-stop-btn:active,
    .xito-app .auto-scroll-speed-btn:active:not(:disabled) {
        transform: scale(0.96);
    }
}

.xito-app .font-size-control {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}
.xito-app .font-size-control input[type="range"] {
    flex: 1;
}
.xito-app .font-size-value {
    font-weight: bold;
    color: #7a110d;
    min-width: 45px;
}
.xito-app .font-size-reset-btn {
    margin-top: 8px;
    padding: 6px 10px;
    border: 1px solid #bbb;
    border-radius: 5px;
    background: #f7f7f7;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.xito-app .font-size-reset-btn:hover {
    border-color: #7a110d;
    color: #7a110d;
    background: #fff;
}
.xito-app .bold-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    align-content: flex-start;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.xito-app .bold-toggle-label {
    font-size: 12px;
    color: #555;
    line-height: 1.2;
    flex: 0 0 auto;
    white-space: nowrap;
    margin: 0;
    padding: 0;
}
.xito-app .toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    flex: 0 0 auto;
    margin: 0;
    background: #ccc;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s;
}
.xito-app .toggle-switch.active {
    background: #7a110d;
}
.xito-app .toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}
.xito-app .toggle-switch.active .toggle-slider {
    transform: translateX(24px);
}

/* Theme backgrounds */
.xito-app.theme-white .x-box,
.xito-app.theme-white .x-body {
    background: #fff;
    color: #000;
}
/* Ban đêm: nền đen nhạt; chữ đen → trắng; gạch đầu dòng trắng; đỏ → đỏ nhạt */
.xito-app.theme-dark .x-box,
.xito-app.theme-dark .x-body {
    background: #3a3a3a;
    color: #f2f2f2 !important;
}
.xito-app.theme-dark .x-body p,
.xito-app.theme-dark .x-body li,
.xito-app.theme-dark .x-body div,
.xito-app.theme-dark .x-body td,
.xito-app.theme-dark .x-body th,
.xito-app.theme-dark .x-body blockquote,
.xito-app.theme-dark .x-body label,
.xito-app.theme-dark .x-body h1,
.xito-app.theme-dark .x-body h2,
.xito-app.theme-dark .x-body h3,
.xito-app.theme-dark .x-body h4,
.xito-app.theme-dark .x-body h5,
.xito-app.theme-dark .x-body h6 {
    color: #f2f2f2 !important;
}
.xito-app.theme-dark .x-body a {
    color: #e8e8e8 !important;
    text-decoration: underline;
}
.xito-app.theme-dark .x-body a:hover {
    color: #fff !important;
}
/* Gạch đầu dòng dạng "-" (::before trong plugin) */
.xito-app.theme-dark .x-body ul li::before {
    color: #f2f2f2 !important;
}
/* Danh sách dùng marker mặc định */
.xito-app.theme-dark .x-body ul li::marker,
.xito-app.theme-dark .x-body ol li::marker {
    color: #f2f2f2 !important;
}
/* Chữ đen / xám đậm set inline trong editor */
.xito-app.theme-dark .x-body [style*="color:#000"],
.xito-app.theme-dark .x-body [style*="color: #000"],
.xito-app.theme-dark .x-body [style*="color:#000000"],
.xito-app.theme-dark .x-body [style*="color: #000000"],
.xito-app.theme-dark .x-body [style*="color:black"],
.xito-app.theme-dark .x-body [style*="color: black"],
.xito-app.theme-dark .x-body [style*="rgb(0, 0, 0)"],
.xito-app.theme-dark .x-body [style*="rgb(0,0,0)"],
.xito-app.theme-dark .x-body [style*="#333"],
.xito-app.theme-dark .x-body [style*="#333333"] {
    color: #f2f2f2 !important;
}
.xito-app.theme-dark .x-body font[color="#000000"],
.xito-app.theme-dark .x-body font[color="#000"],
.xito-app.theme-dark .x-body font[color="black"] {
    color: #f2f2f2 !important;
}
.xito-app.theme-dark .x-body font[color="#ff0000"],
.xito-app.theme-dark .x-body font[color="#b70102"],
.xito-app.theme-dark .x-body font[color="#d83131"],
.xito-app.theme-dark .x-body font[color="#7a110d"] {
    color: #ff9a9a !important;
}
/* Màu đỏ phụng vụ / plugin → đỏ nhạt (ghi đè cả block .x-body strong|span bên dưới) */
.xito-app.theme-dark .x-body strong[style*="#ff0000"],
.xito-app.theme-dark .x-body strong[style*="#FF0000"],
.xito-app.theme-dark .x-body strong[style*="#b70102"],
.xito-app.theme-dark .x-body strong[style*="#B70102"],
.xito-app.theme-dark .x-body strong[style*="#d83131"],
.xito-app.theme-dark .x-body strong[style*="#D83131"],
.xito-app.theme-dark .x-body strong[style*="#7a110d"],
.xito-app.theme-dark .x-body strong[style*="#7A110D"],
.xito-app.theme-dark .x-body span[style*="#ff0000"],
.xito-app.theme-dark .x-body span[style*="#FF0000"],
.xito-app.theme-dark .x-body span[style*="#b70102"],
.xito-app.theme-dark .x-body span[style*="#B70102"],
.xito-app.theme-dark .x-body span[style*="#d83131"],
.xito-app.theme-dark .x-body span[style*="#D83131"],
.xito-app.theme-dark .x-body span[style*="#7a110d"],
.xito-app.theme-dark .x-body span[style*="#7A110D"],
.xito-app.theme-dark .x-body p[style*="#ff0000"],
.xito-app.theme-dark .x-body p[style*="#b70102"],
.xito-app.theme-dark .x-body p[style*="#d83131"],
.xito-app.theme-dark .x-body p[style*="#7a110d"],
.xito-app.theme-dark .x-body [style*="rgb(255, 0, 0)"],
.xito-app.theme-dark .x-body [style*="rgb(183, 1, 2)"],
.xito-app.theme-dark .x-body [style*="rgb(216, 49, 49)"],
.xito-app.theme-dark .x-body [style*="color: red"],
.xito-app.theme-dark .x-body [style*="color:red"],
.xito-app.theme-dark .x-body [style*="#c00"],
.xito-app.theme-dark .x-body [style*="#C00"],
.xito-app.theme-dark .x-body [style*="#d32f2f"],
.xito-app.theme-dark .x-body [style*="#dc3545"] {
    color: #ff9a9a !important;
}
.xito-app.theme-paper .x-box,
.xito-app.theme-paper .x-body {
    background: #f4e8d0;
    color: #2c2416;
}

@media (max-width: 768px) {
    /* Mobile specific styles */

    .xito-app {
        --xito-header-height: 60px;
    }
    
    .xito-app .xito-header {
        padding: 8px 10px;
    }
    .xito-app .xito-header-inner {
        justify-content: space-between;
        gap: 15px;
    }
    
    /* Keep header center for layout but hide desktop content */
    .xito-app .xito-header-center {
        display: flex;
        margin: 0 10px;
    }
    
    /* Hide desktop header content on mobile */
    .xito-app .desktop-header-content {
        display: none;
    }
    
    /* Show mobile calendar navigation with arrows */
    .xito-app .mobile-calendar-nav {
        display: flex;
        visibility: visible;
        opacity: 1;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    /* Make mobile nav arrows more visible on small screens */
    .xito-app .mobile-nav-arrow {
        display: flex;
        visibility: visible;
        opacity: 1;
        width: 34px;
        height: 34px;
        font-size: 18px;
        background: rgba(255,255,255,0.25);
        border: 2px solid rgba(255,255,255,0.4);
        color: #fff;
    }
    
    .xito-app .mobile-calendar-nav .mobile-calendar-icon {
        display: flex;
        visibility: visible;
        opacity: 1;
    }
    
    /* Arrange icons */
    .xito-app .xito-header-left,
    .xito-app .xito-header-right {
        gap: 0;
        flex: 0 0 auto;
    }
    
    .xito-app .xito-header-icon svg,
    .xito-app .xito-header-icon > svg,
    .xito-app #settingsIcon svg {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px;
        min-height: 24px;
        aspect-ratio: 1 / 1 !important;
        flex-shrink: 0;
    }
    
    .xito-app .mobile-calendar-nav .xito-header-icon svg {
        width: 28px;
        height: 28px;
    }
    
    /* Header tạo context độc lập; inner + dropdown luôn ở trên overlay con. */
    .xito-app .xito-header {
        z-index: 9995 !important;
        overflow: visible !important;
        contain: none !important;
    }
    .xito-app .xito-header > .xito-header-inner {
        position: relative !important;
        z-index: 2 !important;
        overflow: visible !important;
        pointer-events: auto !important;
    }
    .xito-app .xito-header > .mobile-popup-overlay {
        position: fixed !important;
        inset: 0 !important;
        z-index: 1 !important;
        pointer-events: auto !important;
    }

    /* Popups centered on mobile — cao hơn overlay, nhận click. */
    .xito-app .calendar-dropdown,
    .xito-app .events-dropdown,
    .xito-app .settings-dropdown,
    .xito-app .download-dropdown {
        position: fixed !important;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        min-width: 280px;
        max-width: 90vw;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 99999 !important;
        pointer-events: auto !important;
    }
    
    .xito-app .calendar-month-popup {
        position: fixed !important;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: min(350px, calc(100vw - 20px));
        min-width: 0;
        max-width: calc(100vw - 20px);
        margin-top: 0;
        z-index: 99999 !important;
        pointer-events: auto !important;
    }
    
    .xito-app .prayer-menu-button {
        min-width: 200px;
        padding: 10px 20px;
        font-size: 14px;
    }
    .xito-app .prayer-menu-container {
        padding: 3px 0;
    }
    .xito-app .prayer-menu-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    .xito-app .today-button {
        padding: 10px 20px;
        font-size: 14px;
        min-width: auto;
    }
    .xito-app .xito-main-wrapper {
        margin-top: var(--xito-header-height);
    }
    
    /* Content box full width on mobile */
    .xito-app .x-box { 
        padding: 0 0 20px 0 !important; 
        box-shadow: none;
        margin: 0;
    }
    .xito-app .x-box h1 {
        padding: 10px 15px;
    }
    .xito-app .x-box .xito-post-title {
        font-size: 33px !important;
        font-weight: 400 !important;
    }
    .xito-app .x-body { 
        padding-left: 15px !important; 
        padding-right: 15px !important; 
    }
    
    .xito-app .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

.xito-app .x-box { 
    max-width: 100%; 
    margin: 0 auto; 
    background: #fff; 
    padding: 0 20px 20px 20px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1); 
}

.xito-app .x-box .xito-post-title {
    font-family: "SVN Secesja Pro", "SVN-Secesja Pro", serif !important;
    font-weight: 500 !important;
    font-style: normal !important;
    font-size: 40px !important;
}

/* Popup Bài đọc Thánh lễ */
.xito-app .bible-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99980;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.75);
    animation: xito-bible-fade-in 0.3s ease;
}

.xito-app .bible-popup-overlay.show {
    display: flex;
}

@keyframes xito-bible-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.xito-app .bible-popup-card {
    position: relative;
    width: 100%;
    max-width: 500px;
    padding: 40px 30px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
    animation: xito-bible-slide-up 0.3s ease;
}

@keyframes xito-bible-slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.xito-app .bible-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.2s, color 0.2s;
}

.xito-app .bible-popup-close:hover {
    background: #e0e0e0;
    color: #000;
}

.xito-app .bible-popup-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff0000 0%, #7a110d 100%);
}

.xito-app .bible-popup-icon svg {
    width: 45px;
    height: 45px;
    fill: #fff;
}

.xito-app .bible-popup-title {
    margin-bottom: 12px;
    color: #ff0000;
    font-size: 24px;
    font-weight: bold;
}

.xito-app .bible-popup-description {
    margin-bottom: 30px;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

.xito-app .bible-popup-button {
    display: inline-block;
    padding: 16px 40px;
    border-radius: 30px;
    background: linear-gradient(135deg, #ff0000 0%, #7a110d 100%);
    box-shadow: 0 4px 15px rgba(183, 1, 2, 0.3);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
}

.xito-app .bible-popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(183, 1, 2, 0.4);
    color: #fff;
}

@media (max-width: 768px) {
    .xito-app .bible-popup-card {
        max-width: 90%;
        padding: 30px 20px;
    }

    .xito-app .bible-popup-title {
        font-size: 20px;
    }

    .xito-app .bible-popup-description {
        font-size: 14px;
    }
}

/* Download dropdown */
.xito-app .download-dropdown {
    position: absolute;
    top: 45px;
    right: 0;
    background: #fff;
    border: 2px solid #7a110d;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    min-width: 320px;
    max-width: min(400px, calc(100vw - 20px));
    z-index: 1001;
}
.xito-app .download-dropdown.show {
    display: block;
}
.xito-app .download-group {
    margin-bottom: 15px;
}
.xito-app .download-group:last-child {
    margin-bottom: 0;
}
.xito-app .download-title {
    font-weight: bold;
    color: #7a110d;
    margin-bottom: 8px;
    font-size: 15px;
}
.xito-app .download-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}
.xito-app .download-days-selector {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 15px;
}
.xito-app .download-day-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.xito-app .download-day-btn:hover {
    border-color: #7a110d;
    color: #7a110d;
    background: #fff7f7;
}
.xito-app .download-day-btn.selected {
    background: #7a110d;
    border-color: #7a110d;
    color: #fff;
    border-width: 3px;
}
.xito-app .download-action-button {
    width: 100%;
    background: #7a110d;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
.xito-app .download-action-button:hover:not(:disabled) {
    background: #ff0000;
}
.xito-app .download-action-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.xito-app .cache-status {
    padding: 10px;
    background: #E8F5E9;
    color: #2E7D32;
    border-radius: 5px;
    font-size: 12px;
    margin-bottom: 12px;
    display: none;
}
.xito-app .cache-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 12px;
    border-top: 1px solid #e0e0e0;
}
.xito-app .cache-item {
    padding: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}
.xito-app .cache-item-info {
    flex: 1;
}
.xito-app .cache-item-date {
    font-weight: bold;
    color: #333;
}
.xito-app .cache-item-liturgy {
    color: #999;
    font-size: 11px;
    margin-top: 2px;
}
.xito-app .cache-item-delete {
    background: #f44336;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
}
.xito-app .cache-item-delete:hover {
    background: #d32f2f;
}
.xito-app .cache-actions {
    padding: 10px 8px 5px;
    text-align: center;
}
.xito-app .cache-clear-all {
    background: #666;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}
.xito-app .cache-clear-all:hover {
    background: #444;
}

/* Popup Offline: đặt SAU CSS desktop để luôn thắng min-width/right của desktop. */
@media (max-width: 768px) {
    .xito-app .download-dropdown {
        position: fixed;
        top: 50%;
        right: auto;
        left: 50%;
        width: 90vw;
        min-width: 0;
        max-width: 90vw;
        max-height: 80vh;
        box-sizing: border-box;
        overflow-y: auto;
        transform: translate(-50%, -50%);
        z-index: 99980;
    }
}

.xito-app .x-nav { display:flex; justify-content:center; gap:5px; border-bottom:3px solid #ff0000; padding-bottom:10px; margin-bottom:20px; flex-wrap:wrap; }
.xito-app .x-btn { padding:8px 12px; background:#f5f5f5; border:1px solid #ddd; cursor:pointer; font-weight:bold; }
.xito-app .x-btn.active { background:#ff0000; color:#fff; border-color:#ff0000; }
/* Tiêu đề Giờ kinh ngoài trang chủ cũng phải Đỏ mận, Đậm, In hoa */
.xito-app .x-head { 
    display: none; /* Ẩn tiêu đề giờ kinh vì đã có ở Menu */
}
.xito-app .x-panel {
    scroll-margin-top: calc(var(--xito-header-height, 64px) + 12px);
}
.xito-app .x-body { 
    color:#000; 
    font-family: 'Merriweather', serif !important; 
    /* Mobile Portrait mặc định */
    font-size: 16px !important;
    --xito-body-fs: 16px;
    font-weight: bold;
    padding-left: 3%; 
    padding-right: 3%; 
    /* Chống "Text Inflation"/font boosting của trình duyệt Mobile (Safari/Chrome). */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Accordion [thu_muc]: không tạo stacking context — luôn cuộn dưới .xito-header. */
.xito-app .x-body .xito-accordion-scope,
.xito-app .x-body .xito-app.xito-accordion-scope,
.xito-app .acutis-accordion-item {
    position: relative !important;
    z-index: auto !important;
    isolation: auto !important;
    transform: none !important;
    contain: none !important;
}
.xito-app .x-body .acutis-accordion-content {
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    background: transparent !important;
    font-family: inherit !important;
}

/* Mobile Landscape (điện thoại xoay ngang) */
@media (max-width: 767px) and (orientation: landscape) {
    .xito-app .x-body {
        font-size: 17px !important;
        --xito-body-fs: 17px;
        font-weight: bold;
    }
}

/* Tablet Portrait nhỏ / iPad đứng */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .xito-app .x-body {
        font-size: 20px !important;
        --xito-body-fs: 20px;
        font-weight: normal;
    }
}

/* Tablet lớn / iPad Pro / màn hình trung bình */
@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape),
       (min-width: 1025px) and (max-width: 1366px) and (orientation: portrait) {
    .xito-app .x-body {
        font-size: 22px !important;
        --xito-body-fs: 22px;
        font-weight: normal;
    }
}

/* Desktop */
@media (min-width: 1367px) {
    .xito-app .x-body {
        font-size: 26px !important;
        --xito-body-fs: 26px;
        font-weight: normal;
    }
}

/* Chỉ áp dụng cho tiêu đề Giờ Kinh trong phần nội dung chính x-body */
.xito-app .x-body .xito-title-font {
    font-family: "SVN Nexa Rush Slab Black Shadow", serif !important;
    font-weight: 400 !important;
    font-size: 32px !important;
    line-height: 1.2;
    color: #8f1c16 !important;
}

@media (max-width: 900px) {
    .xito-app .x-body .xito-title-font {
        font-size: 24px !important;
    }
}

/* Khoảng cách giữa các paragraph trong Ca vịnh (có gạch đầu dòng) */
.xito-app .x-body p {
    margin-bottom: 12pt;
    margin-top: 0;
}

/* CSS MẠNH: Tô đậm và đỏ các ký hiệu đặc biệt */
.xito-app .x-body strong[style*="color:#ff0000"], .xito-app .x-body strong[style*="color:#b70102"], .xito-app .x-body strong[style*="color:#d83131"] { color: #ff0000 !important; font-weight: bold !important; }
.xito-app .x-body span[style*="color:#ff0000"], .xito-app .x-body span[style*="color:#b70102"], .xito-app .x-body span[style*="color:#d83131"] { color: #ff0000 !important; }

/* Đổi bullets thành gạch đầu dòng ngắn đậm (-) */
.xito-app .x-body ul { list-style-type: none !important; padding-left: 0 !important; margin-left: 3% !important; }
.xito-app .x-body ul li { position: relative; padding-left: calc(0.5% + 0.5em); margin-bottom: 6pt; margin-left: 0.5%; }
.xito-app .x-body ul li::before { 
    content: '-'; 
    font-weight: bold; 
    position: absolute; 
    left: 0; 
    color: #000;
}
/* Xóa gạch đầu dòng cho các dòng Tx */
.xito-app .x-body .no-bullet,
.xito-app .x-body .no-bullet::before { 
    list-style: none !important;
    list-style-type: none !important;
}
.xito-app .x-body .no-bullet::before {
    content: '' !important;
    display: none !important;
}
.xito-app .x-body li.no-bullet {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* ── Mobile: giảm thụt lề 3 mục Ca vịnh / Thỉnh ca / Thánh ca Tin Mừng ── */
@media (max-width: 768px) {
    /* ul/li bullet: giảm từ 3% → 1% */
    .xito-app .x-body ul { margin-left: 1% !important; }
    .xito-app .x-body ul li { margin-left: 0 !important; }
    /* Dòng thơ thường trong 3 mục: giảm từ 4% → 2% */
    .xito-app .x-body .x-sect-target { margin-left: 2% !important; }
    /* Dòng bullet trong 3 mục: giảm từ 3% → 1% */
    .xito-app .x-body .x-sect-target.x-sect-bullet { margin-left: 1% !important; }
}
/* Ban đêm: ghi đè block “đỏ đậm” phía trên — đặt cuối (browser hay lưu rgb từ #ff0000) */
.xito-app.theme-dark .x-body strong[style*="color:#ff0000"],
.xito-app.theme-dark .x-body strong[style*="color:#b70102"],
.xito-app.theme-dark .x-body strong[style*="color:#d83131"],
.xito-app.theme-dark .x-body span[style*="color:#ff0000"],
.xito-app.theme-dark .x-body span[style*="color:#b70102"],
.xito-app.theme-dark .x-body span[style*="color:#d83131"],
.xito-app.theme-dark .x-body strong[style*="rgb(255, 0, 0)"],
.xito-app.theme-dark .x-body strong[style*="rgb(183, 1, 2)"],
.xito-app.theme-dark .x-body strong[style*="rgb(216, 49, 49)"],
.xito-app.theme-dark .x-body span[style*="rgb(255, 0, 0)"],
.xito-app.theme-dark .x-body span[style*="rgb(183, 1, 2)"],
.xito-app.theme-dark .x-body span[style*="rgb(216, 49, 49)"] {
    color: #ff9a9a !important;
}

/* ============================================================
   Smart Install Prompt — #xito-install-prompt
   ============================================================ */
.xito-app#xito-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99970;
    width: calc(100% - 40px);
    max-width: 480px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(237, 28, 36, 0.12);
    border-left: 5px solid #ed1c24;
    animation: xip-slide-up 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes xip-slide-up {
    from { opacity: 0; transform: translateX(-50%) translateY(30px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0);    }
}

.xito-app .xip-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
}

.xito-app .xip-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: #ed1c24;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.xito-app .xip-content {
    flex: 1;
    min-width: 0;
}

.xito-app .xip-message {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.xito-app .xip-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.xito-app .xip-btn {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    transition: opacity 0.2s;
}

.xito-app .xip-btn:hover,
.xito-app .xip-btn:focus {
    opacity: 0.85;
    outline: none;
}

.xito-app .xip-btn-install {
    background: #ed1c24;
    color: #fff;
}

.xito-app .xip-btn-dismiss {
    background: #f0f0f0;
    color: #555;
}

/* Dark mode overrides */
.xito-app.theme-dark#xito-install-prompt {
    background: #2a2a2a;
    border-left-color: #ed1c24;
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.5);
}

.xito-app.theme-dark .xip-message { color: #eee; }

.xito-app.theme-dark .xip-btn-dismiss {
    background: #3a3a3a;
    color: #ccc;
}

/* ============================================================
   Nhóm 4 — Grid hai cột: ký hiệu và nội dung.
   ============================================================ */
.xito-app .x-body .xito-tx-pattern {
    /*
     * !important là có chủ đích: nội dung dán từ Word/TinyMCE có thể mang
     * display/margin/padding inline. Nếu chúng thắng, span prefix/text vẫn tồn
     * tại nhưng không còn chia hai cột và nhìn giống như formatter bị bỏ qua.
     */
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) !important;
    align-items: start;
    column-gap: clamp(0.25em, 1vw, 0.5em) !important;
    margin: 0 0 12pt 3% !important;
    padding: 0 !important;
    text-indent: 0 !important;
    text-align: left !important;
    width: 97% !important;
    min-width: 0;
    box-sizing: border-box;
}

/*
 * XĐ. / X. / * / Đ. / ĐC: đều được JS gán is-group-align.
 * Trước đây class này không có CSS nên mỗi dòng dùng max-content riêng:
 * cột nội dung sau X. hoặc * bắt đầu sớm hơn XĐ./ĐC:, không thẳng hàng.
 * Dùng chung một độ rộng prefix để toàn bộ phần Xướng đáp có hanging indent
 * và điểm bắt đầu cột nội dung giống hệt Đ./ĐC:.
 */
.xito-app .x-body .xito-tx-pattern.is-group-align {
    /*
     * 2em đủ chứa ký hiệu rộng nhất (XĐ./ĐC:) nhưng không tạo khoảng trống
     * lớn như 3em. Khoảng hở 0.2em giữ chữ không dính sát ký hiệu.
     */
    grid-template-columns: 2em minmax(0, 1fr) !important;
    column-gap: 0.2em !important;
}

/* Prefix giữ nguyên một cụm nhưng chiều rộng luôn do glyph/font thực tế quyết định. */
.xito-app .x-body .xito-prefix-col {
    width: 100%;
    min-width: 0;
    max-width: none;
    white-space: nowrap;
    line-height: inherit;
}

/* min-width và overflow-wrap ngăn chuỗi dài ép vỡ cột nội dung. */
.xito-app .x-body .xito-text-col {
    min-width: 0;
    max-width: 100%;
    text-align: justify !important;
    -moz-text-align-last: left;
    text-align-last: left !important;
    text-justify: inter-word;
    word-spacing: normal;
    overflow-wrap: anywhere;
}

/* Nhóm 5 — luôn 1 hàng ngang. KHÔNG dùng font-size: inherit:
   inherit lấy cỡ của CHA TRỰC TIẾP (td/table/h5 hoặc style Word), không phải .x-body.
   Gắn vào --xito-body-fs do chính .x-body khai báo (và JS slider đồng bộ). */
.xito-app .x-body .xito-citation-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: nowrap !important;
    overflow: hidden;
    gap: clamp(0.2rem, 1.2vw, 0.75rem);
    width: 100%;
    min-width: 0;
    margin-left: 0;
    padding-left: 0;
    text-indent: 0;
    text-align: left;
    font-family: inherit !important;
    font-style: inherit !important;
    line-height: inherit !important;
    font-size: var(--xito-body-fs, 1em) !important;
    -webkit-text-size-adjust: 100% !important;
    -moz-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

.xito-app .x-body .xito-citation-title,
.xito-app .x-body .xito-citation-ref {
    min-width: 0;
    color: #ff0000;
    white-space: nowrap;
    font-family: inherit !important;
    font-style: inherit !important;
    line-height: inherit !important;
    font-size: var(--xito-body-fs, 1em) !important;
    -webkit-text-size-adjust: 100% !important;
    -moz-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

.xito-app .x-body .xito-citation-title {
    /* Tiêu đề không bao giờ co giãn hay bị cắt — giữ trọn vẹn nhãn (vd. "Đoản huấn"). */
    flex: 0 0 auto;
    font-weight: bold;
}

.xito-app .x-body .xito-citation-ref {
    /* Phần trích dẫn co lại trước khi bị đè lên tiêu đề trên màn hình cực hẹp,
       nhưng KHÔNG thu nhỏ font — chỉ giới hạn chiều rộng + ẩn phần dư bằng "…",
       đảm bảo hàng luôn gọn trong 1 dòng thay vì bị đẩy xuống dòng mới. */
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    font-weight: normal;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .xito-app .x-body .xito-tx-pattern {
        margin-left: 1% !important;
        width: 99% !important;
    }

    /*
     * Chỉ section Xướng đáp: khóa hai cột trên mobile.
     * Mọi dòng xuống hàng của nội dung luôn ở cột 2, không thể
     * tràn xuống phía dưới XĐ. / * / X.
     */
    .xito-app .x-body .xito-tx-pattern.xito-responsory-line {
        display: grid !important;
        grid-template-columns: 2.5em minmax(0, 1fr) !important;
        grid-auto-flow: row !important;
        column-gap: 10px !important;
        align-items: start !important;
        padding: 0 !important;
        text-indent: 0 !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .xito-app .x-body .xito-tx-pattern.xito-responsory-line > .xito-prefix-col {
        grid-column: 1 !important;
        min-width: 0 !important;
        white-space: nowrap !important;
    }

    .xito-app .x-body .xito-tx-pattern.xito-responsory-line > .xito-text-col {
        display: block !important;
        grid-column: 2 !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-wrap: anywhere !important;
    }

}

/* Toàn màn hình: ẩn Header theme (Flatsome) và icon góp ý plugin khác. */
body.is-xito-fullscreen header,
body.is-xito-fullscreen #header,
body.is-xito-fullscreen .header,
body.is-xito-fullscreen .site-header,
body.is-xito-fullscreen .header-wrapper,
body.is-xito-fullscreen .header-main,
body.is-xito-fullscreen .header-top,
body.is-xito-fullscreen #masthead,
body.is-xito-fullscreen #top-bar,
body.is-xito-fullscreen #wpadminbar,
body.is-xito-fullscreen [class*="feedback"],
body.is-xito-fullscreen [id*="feedback"],
body.is-xito-fullscreen [class*="gopy"],
body.is-xito-fullscreen [class*="gop-y"],
body.is-xito-fullscreen [id*="gopy"],
body.is-xito-fullscreen [id*="gop-y"],
body.is-xito-fullscreen #btn-contact,
body.is-xito-fullscreen .btn-contact,
body.is-xito-fullscreen [class*="userback"],
body.is-xito-fullscreen [id*="userback"] {
    display: none !important;
}
body.is-xito-fullscreen #wrapper,
body.is-xito-fullscreen #main,
body.is-xito-fullscreen .page-wrapper {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
body.is-xito-fullscreen .xito-app .xito-main-wrapper,
body.is-xito-fullscreen .xito-app .xito-liturgy-wrapper {
    margin-top: 0 !important;
    padding-top: 0;
    min-height: 100vh;
}
body.is-xito-fullscreen .xito-app .xito-header {
    display: none !important;
}

#xito-exit-fs-btn {
    display: none;
    position: fixed;
    top: calc(20px + env(safe-area-inset-top, 0px));
    right: calc(20px + env(safe-area-inset-right, 0px));
    z-index: 999999;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    box-sizing: border-box;
    background: rgba(122, 17, 13, 0.85);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}
body.is-xito-fullscreen #xito-exit-fs-btn {
    display: flex !important;
}
#xito-exit-fs-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}
#xito-exit-fs-btn:hover,
#xito-exit-fs-btn:focus-visible,
#xito-exit-fs-btn:active {
    transform: scale(1.1);
    filter: brightness(1.12);
    box-shadow: 0 0 12px var(--liturgical-color, rgba(122, 17, 13, 0.65));
    outline: none;
}

@media (max-width: 768px) {
    #xito-exit-fs-btn {
        width: 32px !important;
        height: 32px !important;
        top: auto !important;
        right: auto !important;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
        left: 20px !important;
        z-index: 2147483647 !important;
        align-items: center;
        justify-content: center;
    }

    body.is-xito-fullscreen #xito-exit-fs-btn {
        display: flex !important;
    }

    #xito-exit-fs-btn svg {
        width: 16px !important;
        height: 16px !important;
        display: block;
        margin: 0;
    }
}


/* Trang Bài Đọc Thánh Lễ trong shell WebApp Giờ Kinh */
.xito-header-icon.is-active,
.xito-header-icon[aria-current="page"] {
    background: rgba(255, 255, 255, 0.18);
}
body.xito-mass-readings-page .prayer-menu-container,
body.xito-mass-readings-page .xito-bottom-prayer-nav {
    display: none !important;
}
body.xito-mass-readings-page .xito-app {
    min-height: 100vh;
}
/* Giữ header đỏ; is-xito-fullscreen mặc định ẩn nó — mở lại trên trang Bài Đọc. */
body.xito-mass-readings-page.is-xito-fullscreen .xito-app .xito-header {
    display: block !important;
}
body.xito-mass-readings-page.is-xito-fullscreen .xito-app .xito-main-wrapper,
body.xito-mass-readings-page.is-xito-fullscreen .xito-app .xito-liturgy-wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.xito-mass-readings-app .x-body,
.xito-mass-readings-app .x-panel,
.xito-mass-readings-app .x-box {
    overflow: visible !important;
}

/* Canh đều 2 lề bài đọc / Tin Mừng — thắng CSS theme và .x-body */
.xito-app .x-body #xito-reading-content,
.xito-app .x-body #xito-reading-content .xito-reading,
.xito-app .x-body #xito-reading-content .mslot__body,
.xito-app .x-body #xito-reading-content .mslot__body p,
.xito-app .x-body #xito-reading-content .mslot__lead,
.xito-app .x-body #xito-reading-content .leading,
.xito-app .x-body #xito-reading-content .poem {
    text-align: justify !important;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    hyphens: auto;
    word-break: break-word;
}
.xito-app .x-body #xito-reading-content .xito-reading-header-row,
.xito-app .x-body #xito-reading-content .xito-rh-title,
.xito-app .x-body #xito-reading-content .xito-rh-citation {
    text-align: left !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
}
.xito-app .x-body #xito-reading-content .xito-rh-title {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}
.xito-app .x-body #xito-reading-content .xito-rh-citation {
    text-align: right !important;
    white-space: normal !important;
}
.xito-mass-readings-app .xito-webapp {
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 100px;
    padding-bottom: 3rem;
}
@media (max-width: 767px) {
    .xito-mass-readings-app .xito-webapp {
        padding-top: 80px;
    }
}
