/* Hướng dẫn trực quan có giọng đọc (guide-tour.js). Lớp phủ nằm trên modal Bootstrap (1055) và menu. */
.sgt-launch {
    position: relative;
}

.sgt-launch.is-new::after {
    content: "";
    position: absolute;
    top: 0.35rem;
    right: -0.15rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--senpos-green, #6fc423);
    box-shadow: 0 0 0 0 rgba(111, 196, 35, 0.6);
    animation: sgt-pulse 1.8s infinite;
}

@keyframes sgt-pulse {
    0% { box-shadow: 0 0 0 0 rgba(111, 196, 35, 0.6); }
    70% { box-shadow: 0 0 0 0.6rem rgba(111, 196, 35, 0); }
    100% { box-shadow: 0 0 0 0 rgba(111, 196, 35, 0); }
}

.sgt-blocker {
    position: fixed;
    inset: 0;
    z-index: 2040;
    background: transparent;
}

.sgt-blocker.is-dim {
    background: rgba(15, 23, 42, 0.55);
}

.sgt-spot {
    position: fixed;
    z-index: 2041;
    border-radius: 10px;
    /* 100vmax đủ phủ cả màn hình từ bất kỳ vị trí nào; bóng 9999px vượt giới hạn texture GPU và bị bỏ qua khi vẽ. */
    box-shadow: 0 0 0 3px rgba(19, 156, 216, 0.95), 0 0 0 100vmax rgba(15, 23, 42, 0.55);
    pointer-events: none;
    transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
}

.sgt-pop {
    position: fixed;
    z-index: 2042;
    width: 390px;
    max-width: calc(100vw - 24px);
    padding: 1rem 1.1rem 0.85rem;
    border-radius: 12px;
    background: #fff;
    color: var(--senpos-ink, #182433);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.35);
    transition: top 0.25s ease, left 0.25s ease;
}

.sgt-pop-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    color: var(--tblr-secondary, #667382);
}

.sgt-pop-chapter {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--senpos-blue-dark, #0f88bd);
}

.sgt-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
    cursor: pointer;
}

.sgt-icon-btn:hover,
.sgt-icon-btn:focus-visible {
    background: rgba(19, 156, 216, 0.12);
    color: var(--senpos-blue-dark, #0f88bd);
}

.sgt-pop-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.sgt-pop-text {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    line-height: 1.55;
}

.sgt-audio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    font-size: 0.78rem;
    color: var(--tblr-secondary, #667382);
}

.sgt-audio .sgt-icon-btn {
    width: 2.1rem;
    height: 2.1rem;
    background: rgba(19, 156, 216, 0.12);
    color: var(--senpos-blue-dark, #0f88bd);
}

.sgt-bar {
    flex: 1;
    height: 4px;
    overflow: hidden;
    border-radius: 2px;
    background: #e6ebf1;
}

.sgt-bar > span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--senpos-blue, #139cd8);
}

.sgt-audio-note {
    white-space: nowrap;
}

.sgt-audio.is-blocked .sgt-audio-note {
    color: #b54708;
    font-weight: 600;
}

.sgt-pop-foot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sgt-pop-progress {
    flex: 1;
    text-align: center;
    font-size: 0.78rem;
    color: var(--tblr-secondary, #667382);
}

.sgt-pop.is-center {
    width: 440px;
}

/* Lời nhắc nghe hướng dẫn trên trang đăng nhập (data-guide-nudge), guide-tour.js bỏ thuộc tính hidden khi cần nhắc. */
.sgt-nudge {
    display: block;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--senpos-blue, #139cd8);
}

.sgt-nudge[hidden] {
    display: none;
}

.sgt-nudge-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: var(--senpos-ink, #182433);
}

.sgt-nudge-title .ti {
    font-size: 1.15rem;
    color: var(--senpos-blue-dark, #0f88bd);
}

.sgt-nudge-text {
    margin: 0.25rem 0 0.6rem;
    font-size: 0.85rem;
    color: var(--tblr-secondary, #667382);
}

.sgt-nudge-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.sgt-nudge-actions .form-check-label {
    color: var(--tblr-secondary, #667382);
}

/* Hình minh họa trong khung chú thích (tools/guide-tour/figures): màn hình nằm ngoài trang đang mở, vẽ giản lược. */
.sgt-pop-fig {
    margin: 0.2rem 0 0.75rem;
    font-size: 0.8rem;
    line-height: 1.45;
}

.sgt-fig-screen {
    overflow: hidden;
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: 10px;
    background: #f8fafc;
}

.sgt-fig-bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-bottom: 1px solid var(--tblr-border-color, #e6e7e9);
    background: #eef2f6;
    font-size: 0.72rem;
    color: var(--tblr-secondary, #667382);
}

.sgt-fig-body {
    padding: 0.65rem 0.75rem;
}

.sgt-fig-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sgt-fig-grow {
    flex: 1;
    min-width: 0;
}

.sgt-fig-strong {
    font-weight: 700;
}

.sgt-fig-muted {
    color: var(--tblr-secondary, #667382);
}

.sgt-fig-qr {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #fff;
    font-size: 2.6rem;
    color: var(--senpos-ink, #182433);
}

.sgt-fig-btn {
    display: inline-block;
    flex: none;
    margin-top: 0.4rem;
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
    background: var(--senpos-blue, #139cd8);
    font-weight: 600;
    color: #fff;
}

.sgt-fig-row > .sgt-fig-btn {
    margin-top: 0;
}

.sgt-fig-alert {
    margin-top: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-left: 3px solid var(--senpos-blue, #139cd8);
    border-radius: 6px;
    background: #e8f4fb;
}

.sgt-fig-alert mark {
    padding: 0 0.2rem;
    border-radius: 3px;
    background: #fff3bf;
}

.sgt-fig-badge {
    padding: 0 0.35rem;
    border-radius: 4px;
    background: #fff4e5;
    font-weight: 600;
    color: #b54708;
}

.sgt-fig-avatar {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: #e8f4fb;
    font-size: 1.1rem;
    color: var(--senpos-blue-dark, #0f88bd);
}

.sgt-fig-note {
    margin-top: 0.3rem;
    font-size: 0.72rem;
    font-style: italic;
    color: var(--tblr-secondary, #667382);
}

.sgt-fig-flow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: sgt-flow;
}

.sgt-fig-flow li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.55rem 0.25rem 0.45rem;
    border-radius: 8px;
    background: #eef6fc;
    font-size: 0.72rem;
    line-height: 1.3;
    text-align: center;
    counter-increment: sgt-flow;
}

.sgt-fig-flow li::before {
    content: counter(sgt-flow);
    position: absolute;
    top: 0.2rem;
    left: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--senpos-blue-dark, #0f88bd);
}

.sgt-fig-flow i {
    font-size: 1.35rem;
    color: var(--senpos-blue-dark, #0f88bd);
}

/* Bảng chọn chương */
.sgt-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2043;
    background: rgba(15, 23, 42, 0.45);
}

.sgt-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2044;
    display: flex;
    flex-direction: column;
    width: 440px;
    max-width: 100vw;
    background: #fff;
    color: var(--senpos-ink, #182433);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.25);
}

.sgt-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.1rem 1.1rem 0.9rem;
    border-bottom: 1px solid var(--tblr-border-color, #e6e7e9);
}

.sgt-panel-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.sgt-panel-head p {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--tblr-secondary, #667382);
}

.sgt-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.1rem 1.25rem;
}

.sgt-start {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.sgt-start .btn {
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
}

.sgt-start .btn small {
    display: block;
    font-weight: 400;
    opacity: 0.8;
}

.sgt-prefs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    align-items: center;
    padding: 0.7rem 0.8rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    background: #f3f6fa;
    font-size: 0.85rem;
}

.sgt-prefs label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    cursor: pointer;
}

.sgt-prefs select {
    width: auto;
    padding: 0.15rem 1.8rem 0.15rem 0.5rem;
    font-size: 0.85rem;
}

.sgt-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 1rem 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tblr-secondary, #667382);
}

.sgt-group-play {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--senpos-blue-dark, #0f88bd);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.sgt-group-play:hover,
.sgt-group-play:focus-visible {
    background: rgba(19, 156, 216, 0.12);
}

.sgt-chapter {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
}

.sgt-chapter:hover,
.sgt-chapter:focus-visible {
    background: rgba(19, 156, 216, 0.1);
}

.sgt-chapter.is-here {
    background: rgba(19, 156, 216, 0.14);
    font-weight: 600;
}

.sgt-chapter-name {
    flex: 1;
    min-width: 0;
}

.sgt-chapter-meta {
    font-size: 0.75rem;
    color: var(--tblr-secondary, #667382);
    white-space: nowrap;
}

.sgt-chapter .ti-circle-check {
    color: var(--senpos-green, #6fc423);
}

.sgt-panel-foot {
    padding: 0.75rem 1.1rem;
    border-top: 1px solid var(--tblr-border-color, #e6e7e9);
    font-size: 0.78rem;
    color: var(--tblr-secondary, #667382);
}

body.sgt-active {
    overscroll-behavior: contain;
}

@media (max-width: 575.98px) {
    .sgt-pop,
    .sgt-pop.is-center {
        width: auto;
    }

    .sgt-panel {
        width: 100vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sgt-spot,
    .sgt-pop {
        transition: none;
    }

    .sgt-launch.is-new::after {
        animation: none;
    }
}
