.video-study-wrap {
    font-family: 'Gowun Dodum', sans-serif;
    width: 100%;
    max-width: 1600px;
    background-color: #e6d6c7;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    gap: 16px;
    min-height: 100vh;
    box-sizing: border-box;
}

:root {
    --subtitle-item-gap: 8px;
}

.video-study-card,
.video-list-card {
    background: #fff;
    border: 1px solid #e8ebf2;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(16, 24, 40, 0.05);
}

.video-study-title {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.25;
    color: #1f2937;

}

.video-study-desc {
    margin: 0 0 16px;
    color: #4b5563;
    font-size: 15px;
}

.video-input-group {
    display: grid;
    gap: 10px;
}

.video-input-label {
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.video-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    background: #fbf9f7;
    box-sizing: border-box;
}

.video-input::placeholder {
    color: #b2a99e;
    /* placeholder 글자색 */
}

.video-btn {
    justify-self: end;
    border: 0;
    border-radius: 10px;
    background: #d36c4f;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    opacity: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.video-list-title {
    margin: 0;
    font-size: 20px;
    color: #111827;
}

.video-list {
    margin: 0;
    padding: 0;
    list-style: none;

}

.video-list-empty {
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    color: #6b7280;
    background: #fafafa;
}

.video-note {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    text-align: right;
}

.video-job-item {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fbf9f7;
    margin-bottom: 10px;
}

.video-job-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.video-job-bottom-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 12px;
}

.video-job-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.video-job-no {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
}

.video-job-title {
    font-size: 16px;
    color: #111827;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1.35;
    word-break: break-word;
}

.video-job-meta {
    font-size: 13px;
    color: #6b7280;
}

.job-error {
    margin-top: 6px;
    color: #b91c1c;
    font-size: 13px;
}

.video-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: #647893;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    padding: 8px 12px;
}

.video-inline-btn.danger {
    background: #dc2626;
}

.yt-player {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    margin-bottom: 12px;
}

.yt-player iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--video-ar, 16 / 9);
}

/* ── 자막 헤더 (타이틀 + 재생 버튼) ── */
.subtitle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    flex-wrap: nowrap;
    /* 줄바꿈 방지 */
}

.subtitle-sync-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

.sync-btn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 4px;
    cursor: pointer;
}

.sync-btn:hover {
    background: #e2e8f0;
}

.sync-offset-label {
    min-width: 30px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #1d4ed8;
}

.player-btns {
    display: flex;
    gap: 6px;
}

.player-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: #495256;
    cursor: pointer;
    padding: 0;
    transition: background 0.12s, border-color 0.12s, transform 0.10s;
}

.player-btn:hover {
    background: #95a0a7;

}

.player-btn:active {
    transform: scale(0.90);
    background: #dbeafe;
}

.player-btn img {
    width: 14px;
    height: 14px;
    display: block;
    pointer-events: none;
}

/* ── 자막 아이템 (3-column: 아이콘 | 시간 | 텍스트) ── */
.subtitle-item {
    display: grid;
    grid-template-columns: 26px 54px 1fr;
    gap: 6px;
    align-items: start;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: var(--subtitle-item-gap);
    cursor: pointer;
    background: #fff;
}

.subtitle-item.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.subtitle-item.ghost {
    opacity: 0.22;
}

/* 아이콘 없는 빈 칼럼 */
.subtitle-icon-col {
    width: 22px;
    height: 22px;
}

/* ── 아이콘 별도 박스 ── */
.subtitle-group-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #f9fafb;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, transform 0.10s, box-shadow 0.12s;
}

/* 같은 그룹 아이콘 hover → 노란색 */
.subtitle-group-btn.group-hover {
    background: #ffd666;
    border-color: #f0b429;
    box-shadow: 0 1px 4px rgba(240, 180, 41, 0.25);
}

/* 클릭 후 눌림 효과 */
.subtitle-group-btn.group-active {
    transform: scale(0.85);
    background: #ffca28;
    border-color: #e6a817;
}

.subtitle-icon {
    width: 14px;
    height: 14px;
    display: block;
    pointer-events: none;
}

.subtitle-time {
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
}

.subtitle-text {
    color: #111827;
    font-size: 14px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.video-player-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
    align-items: start;
}

.video-player-left .video-study-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.video-player-title {
    font-weight: 700;
}

.video-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.video-player-header .video-study-title {
    margin-bottom: 0;
}

.video-player-header-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.vp-header-btn {
    font-family: 'Ubuntu', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #24425f;
    color: #f6dc8d;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

.vp-header-btn:hover {
    background: #95a0a7;
    border-color: #424243;
}

.vp-header-btn:active {
    transform: scale(0.95);
}

.video-player-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.video-player-right .video-list-title {
    flex: 0 0 auto;
}

.video-list-limit-hint {
    font-size: 13px;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 8px;
    vertical-align: middle;
}

.video-job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.video-job-date {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
    flex-shrink: 0;
}

.subtitle-scroll {
    min-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

@media (min-width:951px) {
    .video-study-wrap {
        width: 90%;
    }
}

@media (max-width: 950px) {
    .video-study-wrap {
        padding: 12px 10px;
    }

    .video-player-layout {
        grid-template-columns: 1fr;
    }

    .yt-player {
        max-width: 100%;
    }

    .subtitle-scroll {
        min-height: 220px;
    }

    .subtitle-sync-controls {
        order: 3;
        width: 100%;
        justify-content: flex-end;
        margin-left: auto;
    }
}

/* ── 삭제 기능 ── */
.video-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.video-btn.danger {
    background-color: #d36c4f;
    color: white;
}

.video-btn.danger:hover {
    background-color: #d36c4f;
}

.video-btn.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.video-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

.video-check {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.video-job-main {
    min-width: 0;
}

@media (max-width: 950px) {
    .video-job-item {
        gap: 10px;
    }

    .video-job-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .video-job-title {
        width: 100%;
        font-size: 15px;
    }

    .video-job-bottom-row {
        grid-template-columns: 52px 1fr auto;
        gap: 10px;
    }

    .video-job-action {
        grid-column: 3;
        justify-self: end;
        margin-top: 0;
    }
}

/* ── 번역 모달 ── */
.trans-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}

.trans-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    width: 90%;
    max-width: 420px;
    overflow: hidden;
    animation: transModalIn 0.18s ease-out;
}

@keyframes transModalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.trans-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid #e5e7eb;
}

.trans-modal-label {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.trans-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.trans-modal-close:hover {
    color: #111827;
}

.trans-modal-body {
    padding: 16px 18px 20px;
    color: #1f2937;
}

.trans-section-label {
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}

.trans-section-text {
    font-size: 15px;
    line-height: 1.6;
    color: #1f2937;
}

.trans-en {
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.trans-ko {
    font-family: 'Gowun Dodum', 'Noto Sans KR', sans-serif;
}

.trans-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 12px 0;
}

/* ── 문장학습 모달 헤더 오른쪽 (어휘찾기 + 닫기) ── */
.trans-modal-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vocab-open-btn {
    background: #424243;
    color: #f6dc8d;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s;
}

.vocab-open-btn:hover {
    background: #555657;
}

/* ── 어휘 찾기 모달 ── */
.vocab-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9100;
}

.vocab-modal {
    background: #424243;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: transModalIn 0.18s ease-out;
}

.vocab-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid #555;
}

.vocab-modal-label {
    font-size: 15px;
    font-weight: 700;
    color: #f6dc8d;
}

.vocab-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.vocab-modal-close:hover {
    color: #fff;
}

.vocab-modal-body {
    padding: 14px 18px 18px;
    overflow-y: auto;
    flex: 1;
}

.vocab-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.vocab-list {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
}

.vocab-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vocab-row:last-child {
    border-bottom: none;
}

.vocab-en {
    color: #f6dc8d;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    flex-shrink: 0;
}

.vocab-kr {
    color: #dfe6eb;
    font-size: 13px;
    text-align: right;
    font-family: 'Gowun Dodum', 'Noto Sans KR', sans-serif;
}

.vocab-divider {
    border: none;
    border-top: 1px solid #555;
    margin: 10px 0;
}

.vocab-empty {
    color: #9ca3af;
    font-size: 13px;
    padding: 4px 0;
}

.vocab-en-sentence {
    color: #f6dc8d;
    font-size: 14px;
    line-height: 1.5;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    padding-bottom: 2px;
}

.vocab-loading {
    color: #dfe6eb;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* ── 아이콘 세로 스택 (그룹 아이콘 + 문장 번역 아이콘) ── */
.subtitle-icon-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* ── 문장 번역 아이콘 버튼 (자막 목록 내) ── */
.subtitle-trans-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #f9fafb;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.12s, border-color 0.12s, transform 0.10s;
}

.subtitle-trans-btn:hover {
    background: #c8e6c9;
    border-color: #66bb6a;
}

.subtitle-trans-btn:active {
    transform: scale(0.85);
    background: #a5d6a7;
}

.subtitle-trans-btn img {
    width: 14px;
    height: 14px;
    display: block;
    pointer-events: none;
}

/* ── 문장 번역 모달 ── */
.sentence-trans-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9200;
}

.sentence-trans-modal {
    background: #4c5a64;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    width: 90%;
    max-width: 380px;
    overflow: hidden;
    animation: transModalIn 0.18s ease-out;
}

.sentence-trans-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sentence-trans-label {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.sentence-trans-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #fff;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.sentence-trans-close:hover {
    color: #ccc;
}

.sentence-trans-body {
    padding: 16px 18px 20px;
}

.sentence-trans-en {
    color: #ffebb5;
    font-size: 15px;
    line-height: 1.6;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.sentence-trans-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 12px 0;
}

.sentence-trans-ko {
    color: #fbf9f7;
    font-size: 15px;
    line-height: 1.6;
    font-family: 'Gowun Dodum', 'Noto Sans KR', sans-serif;
}

.sentence-trans-loading {
    color: #ccc;
    font-size: 14px;
    text-align: center;
    padding: 10px 0;
}