/* ============================================================
 *  Discover › Shorts 페이지
 *  시안: magazine-sub.html (1920px 절대 좌표 → max-width 1480 변환)
 *  - 영상 영역: 와이드 다크 BG (815) + 세로 영상 (467) + 좌우 거터 액션 아이콘
 *  - 우측: 댓글 패널 (554)
 *  - 하단: 쇼츠 미등록 시 캐릭터 + 안내 문구
 *  - 모바일: stage 1열 stack, 거터 액션 영상 위에 floating
 * ============================================================ */

.discover-shorts-detail-page .dsc-nav-tab.is-active.dsc-nav-tab--shorts {
    background: #ff7c0a !important;
    border-color: #ff7c0a !important;
    color: #fff !important;
}

/* 스크롤바 오실레이션 방지 — 영상 BG(aspect-ratio)가 뷰포트 폭에 연동되어
 * 스크롤바 표시/숨김으로 폭이 변하면 페이지 높이가 변해 다시 스크롤바가 토글되는
 * 무한 루프(부르르 떨림)를 차단. 본 CSS 는 쇼츠 상세 전용이라 html 직접 지정.
 * scrollbar-gutter 미지원 브라우저는 overflow-y: scroll 로 폴백. */
html { scrollbar-gutter: stable; overflow-y: scroll; overflow-anchor: none; }
.discover-shorts-detail-page { overflow-anchor: none; }
/* aspect-ratio + grid stretch 조합에서 sub-pixel 반올림 차이로 페이지 총 높이가
 * 1px 안팎으로 흔들리는 현상을 차단. stage 레이아웃을 contain 으로 격리.
 * 단, 모바일에선 .dsc-sd-comments 가 position:fixed 로 viewport 에 anchor 되어야 하는데
 * CSS contain: layout 이 fixed positioned 자손의 containing block 을 가두는 spec 때문에
 * stage 박스 안에서만 fixed 가 동작 → 하단 잘림. 모바일에선 contain 해제. */
.discover-shorts-detail-page .dsc-sd-stage { contain: layout style; }
.discover-shorts-detail-page .dsc-sd-video-bg { contain: layout style paint; }
.discover-shorts-detail-page .dsc-sd-comments { contain: layout style; }
@media (max-width: 1023px) {
    .discover-shorts-detail-page .dsc-sd-stage,
    .discover-shorts-detail-page .dsc-sd-comments { contain: none; }
}
/* 헤더 sticky 토글 오실레이션 차단 — header.php 가 scrollTop>=1 일 때 헤더 네비를
 * position:fixed 로 전환하며 ~78px 가 flow 에서 빠짐. 임계값(78px) 만 살짝 넘기는
 * 정도로 buffer 만 확보. 헤더 위쪽 영역(~150px) + 푸터가 함께 페이지 높이를 만들어
 * 주므로 main 자체는 viewport 보다 작아도 됨. 자연 콘텐츠가 길면 본 룰은 효과 없음. */
.discover-shorts-detail-page .dsc-sd-main { min-height: calc(100vh - 50px); }

.dsc-sd-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 62px 24px 80px;
}
@media (max-width: 1023px) {
    .dsc-sd-main { padding: 16px 16px 60px; }
}

/* -------- 정렬 + 검색 바 (시안 sort + search) -------- */
.dsc-sf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0 24px;
    gap: 16px;
}
.dsc-sf-toolbar__left {
    display: flex;
    align-items: center;
    gap: 22px;
}
.dsc-sf-toolbar .dsc-sort-item {
    font-size: 17px;
    font-weight: 600;
    color: #959595;
    cursor: pointer;
}
.dsc-sf-toolbar .dsc-sort-item.is-active { color: #000; font-weight: 700; }
.dsc-sf-toolbar .dsc-search-bar {
    width: 370px;
    height: 51px;
    border: 1px solid #e8e8e8;
    border-radius: 100px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 10px;
}
.dsc-sf-toolbar .dsc-search-bar input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #000;
}
.dsc-sf-toolbar .dsc-search-bar input::placeholder { color: #959595; }
.dsc-sf-toolbar .dsc-search-bar img { width: 24px; height: 24px; cursor: pointer; flex-shrink: 0; }
@media (max-width: 1023px) {
    /* 시안 모바일 검색바 (magazine-shorts-mobile.html):
     *  width 268 / height 50 / radius 100 / border #e8e8e8 / padding 0 20
     *  input font 18 / placeholder #959595 / 검색 아이콘 30x30 우측
     * → 시안 사이즈 그대로 적용 (실 디바이스 360 에선 폭 자동 축소되도록 max-width). */
    .dsc-sf-toolbar { margin: 14px 0 16px; gap: 10px; }
    .dsc-sf-toolbar__left { gap: 14px; }
    .dsc-sf-toolbar .dsc-sort-item { font-size: 14px; font-weight: 600; }
    .dsc-sf-toolbar .dsc-sort-item.is-active { font-weight: 700; }
    .dsc-sf-toolbar .dsc-search-bar {
        width: 35%;             /* 사용자 요청: 검색바가 화면 폭의 35% 기본 */
        flex: 0 0 auto;
        min-width: 170px;       /* placeholder "Search shorts" 들어갈 최소 폭 보장 */
        max-width: 268px;       /* 큰 모바일/태블릿에선 시안 268 까지만 */
        height: 50px;
        padding: 0 14px;
        border-radius: 100px;
        border: 1px solid #e8e8e8;
        gap: 6px;
        justify-content: space-between;     /* input 좌 / 아이콘 우 명시 */
    }
    /* discover.css 의 .discover-page .dsc-search-bar input { display:none } 영향 차단.
     * 쇼츠 상세 페이지 wrapper 는 .discover-page + .discover-shorts-detail-page 둘 다 적용되므로
     * specificity 를 높여 input 노출 + flex:1 보장. font-size 14 — 모바일 placeholder
     * "Search shorts" 잘림 방지 (16 은 좁은 폭에서 잘림). 리스트 페이지와 동일 값. */
    .discover-shorts-detail-page .dsc-sf-toolbar .dsc-search-bar input {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        font-size: 14px;
        background: transparent;
        border: 0;
        outline: none;
        color: #000;
    }
    .discover-shorts-detail-page .dsc-sf-toolbar .dsc-search-bar input::placeholder { color: #959595; }
    .dsc-sf-toolbar .dsc-search-bar img,
    .dsc-sf-toolbar .dsc-search-bar .dsc-search-bar__icon {
        width: 26px;
        height: 26px;
        flex-shrink: 0;             /* 우측 고정 — 줄어들지 않음 */
    }
}

/* -------- Stage: 영상(다크 BG + 세로 영상) + 댓글 -------- */
/*  시안 비율: 815 : 554 ≈ 1.47 : 1
 *  거터(좌우) 너비 비율: 174 : 174 (시안의 video x=435 - bg x=261 = 174,
 *                                  bg right=1076 - video right=902 = 174)
 *  거터 안쪽에 60x60 원형 아이콘 정렬 */
.dsc-sd-stage {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(620px, 815fr) minmax(420px, 554fr);
    gap: 30px;
    align-items: stretch;
}
@media (max-width: 1023px) {
    .dsc-sd-stage { grid-template-columns: 1fr; gap: 24px; align-items: start; }
}

/* -------- 영상 영역 -------- */
.dsc-sd-video-wrap {
    position: relative;
    width: 100%;
}

/* 와이드 다크 BG (영상 + 좌우 거터) */
.dsc-sd-video-bg {
    position: relative;
    width: 100%;
    /* 시안 815x830 → aspect 815/830 ≈ 0.982 */
    aspect-ratio: 815 / 830;
    background: #040404;
    border-radius: 10px;
    overflow: hidden;
}

/* 중앙 세로 영상 (시안 467/830 ≈ 0.5627 of bg width = video width)
 * 거터 174/815 ≈ 0.2135 */
.dsc-sd-video {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 21.35%;        /* 174/815 */
    width: 57.30%;       /* 467/815 */
    background: #0a0a0a;
    overflow: hidden;
    cursor: pointer;
    will-change: transform, opacity;
    /* 재생/일시정지 클릭 시 모바일 더블탭 zoom, 텍스트 선택, tap highlight, long-press 메뉴 모두 차단.
     * touch-action:none → 영상 위 swipe 시 브라우저 기본 페이지 스크롤도 차단 (swipe 는 JS bindSwipe 가 처리). */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: none;
}
/* 쇼츠 전환 슬라이드 (YouTube Shorts 스타일) — JS 가 클래스 토글 */
.dsc-sd-video.is-slide-out-up   { transition: transform .25s cubic-bezier(.22,.61,.36,1), opacity .25s ease; transform: translate3d(0,-105%,0); opacity: 0; }
.dsc-sd-video.is-slide-out-down { transition: transform .25s cubic-bezier(.22,.61,.36,1), opacity .25s ease; transform: translate3d(0, 105%,0); opacity: 0; }
.dsc-sd-video.is-prep-up        { transition: none; transform: translate3d(0, 105%,0); opacity: 0; }
.dsc-sd-video.is-prep-down      { transition: none; transform: translate3d(0,-105%,0); opacity: 0; }
.dsc-sd-video.is-slide-in       { transition: transform .25s cubic-bezier(.22,.61,.36,1), opacity .25s ease; transform: translate3d(0,0,0); opacity: 1; }
.dsc-sd-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.dsc-sd-video__gradient-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 14.5%;       /* 120/830 */
    background: linear-gradient(to bottom, rgba(0,0,0,.5), transparent);
    pointer-events: none;
}
.dsc-sd-video__gradient-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 33.7%;       /* 280/830 */
    background: linear-gradient(to top, rgba(0,0,0,.85), transparent);
    pointer-events: none;
}

/* prev/next (영상 좌측 거터 안쪽, 수직 스택) */
.dsc-sd-nav {
    position: absolute;
    z-index: 4;
    width: 60px;
    height: 60px;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .15s, transform .12s;
    padding: 0;
}
.dsc-sd-nav:hover .dsc-sd-nav__svg path { opacity: .85; }
.dsc-sd-nav:active { transform: scale(.94); }
.dsc-sd-nav img { width: 60px; height: 60px; }
.dsc-sd-nav__svg {
    width: 60px;
    height: 60px;
    display: block;
}
.dsc-sd-nav__svg path { transition: opacity .15s; }
/* prev 는 chevron 을 위로 — 동일 SVG 를 180° 회전 (배경 circle 은 대칭이라 영향 X) */
.dsc-sd-nav--prev .dsc-sd-nav__svg { transform: rotate(180deg); }
/* 이동할 영상이 없을 때 — chevron path 만 fade (배경 circle 은 0.15 그대로 유지) */
.dsc-sd-nav.is-disabled {
    cursor: not-allowed;
    pointer-events: none;
}
.dsc-sd-nav.is-disabled .dsc-sd-nav__svg path { opacity: 0.15; }
/* 시안: 좌측 거터 하단에 prev/next 수직 스택 (bg 기준 bottom ~10.6% / ~2.3%) */
.dsc-sd-nav--prev { left: 6.6%; bottom: 10.6%; }
.dsc-sd-nav--next { left: 6.6%; bottom: 2.3%; }
@media (max-width: 1023px) {
    .dsc-sd-nav { display: none; }
}

/* 중앙 재생 오버레이 (시안: orange play 95x95) */
.dsc-sd-play-overlay {
    position: absolute;
    z-index: 3;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 95px; height: 95px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.dsc-sd-play-overlay img,
.dsc-sd-play-overlay__svg { width: 95px; height: 95px; display: block; }
@media (max-width: 559px) {
    .dsc-sd-play-overlay { width: 72px; height: 72px; }
    .dsc-sd-play-overlay img,
    .dsc-sd-play-overlay__svg { width: 72px; height: 72px; }
}

/* 사운드 토글 (단일 버튼 — 우상단 거터) */
.dsc-sd-sound-btn {
    position: absolute;
    z-index: 4;
    right: 6.6%;
    top: 2.4%;          /* 20/830 */
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    padding: 0;
}
.dsc-sd-sound-btn:hover { background: rgba(255,255,255,.12); }
.dsc-sd-sound-btn img,
.dsc-sd-sound-btn__svg { width: 60px; height: 60px; display: block; }
/* 사운드 토글 — 기본은 사운드 ON, .is-muted 일 때 mute 아이콘 */
.dsc-sd-sound-btn .dsc-sd-sound-btn__svg--off { display: none; }
.dsc-sd-sound-btn.is-muted .dsc-sd-sound-btn__svg--on  { display: none; }
.dsc-sd-sound-btn.is-muted .dsc-sd-sound-btn__svg--off { display: block; }

/* 영상 정보 (제목 + 설명 — 영상 위에 white 텍스트) */
.dsc-sd-info {
    position: absolute;
    z-index: 2;
    left: 6%;
    right: 6%;
    bottom: 5.4%;       /* progress bar 위 */
    color: #fff;
}
.dsc-sd-info__title-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 6px;
}
/* common.css `*:not(.nocss b) { font-weight: normal }` (specificity 0,0,1,1) 가
 * `.dsc-sd-info__title { font-weight: 700 }` (0,0,1,0) 을 덮어쓰므로
 * `.discover-shorts-detail-page` 접두로 (0,0,2,0) 를 만들어 우선순위 확보 */
.discover-shorts-detail-page .dsc-sd-info__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
    flex: 1;
    min-width: 0;
}
.dsc-sd-info.is-expanded .dsc-sd-info__title {
    -webkit-line-clamp: unset;
    display: block;
}
.dsc-sd-info__expand {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s;
}
.dsc-sd-info__expand-svg { display: block; width: 17px; height: 9px; }
.dsc-sd-info.is-expanded .dsc-sd-info__expand { transform: rotate(180deg); }
.dsc-sd-info__desc {
    font-size: 15px;
    margin: 0;
    line-height: 1.5;
    opacity: .85;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.dsc-sd-info.is-expanded .dsc-sd-info__desc {
    -webkit-line-clamp: unset;
    display: block;
}

/* 진행 바 (시안 orange #ff7c0a / 높이 2px) */
.dsc-sd-progress {
    position: absolute;
    z-index: 2;
    left: 0; right: 0;
    bottom: 0;
    height: 2px;
    background: rgba(255,255,255,.3);
}
.dsc-sd-progress__fill {
    height: 100%;
    background: #ff7c0a;
    width: 0%;
    transition: width .12s linear;
}

/* 사이드 액션 (영상 우측 거터 안쪽, 수직 스택 — heart / share)
 * 좌측 prev/next 와 동일한 bottom 라인에 정렬 (시안 bottom ~2.3%) */
.dsc-sd-actions {
    position: absolute;
    z-index: 4;
    right: 6.6%;
    bottom: 2.3%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* 시안: PNG 아이콘 자체가 60x60 (원형 외곽 + 내부 글리프 포함) — 배경/테두리 없이 그대로 노출 */
.dsc-sd-action {
    width: 60px;
    height: 60px;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity .15s, transform .12s;
}
.dsc-sd-action:hover { opacity: .85; }
.dsc-sd-action:active { transform: scale(.94); }
.dsc-sd-action img,
.dsc-sd-action__svg { width: 60px; height: 60px; display: block; }
/* 좋아요 토글 — 기본 OFF (외곽선 하트), .is-active 시 ON (오렌지 채움) */
.dsc-sd-action--like .dsc-sd-action__svg--on { display: none; }
.dsc-sd-action--like.is-active .dsc-sd-action__svg--off { display: none; }
.dsc-sd-action--like.is-active .dsc-sd-action__svg--on  { display: block; }

/* 모바일 전용 액션 (chat 버튼 등) — PC 에선 숨김 */
.discover-shorts-detail-page .dsc-sd-action--mobile-only { display: none; }
@media (max-width: 1023px) {
    .discover-shorts-detail-page .dsc-sd-action--mobile-only { display: flex; }
}

@media (max-width: 559px) {
    .dsc-sd-actions { gap: 8px; right: 12px; bottom: 60px; }
    .dsc-sd-action { width: 48px; height: 48px; }
    .dsc-sd-action img,
    .dsc-sd-action__svg { width: 48px; height: 48px; }
    .dsc-sd-sound-btn { right: 12px; top: 12px; width: 44px; height: 44px; }
    .dsc-sd-sound-btn img,
    .dsc-sd-sound-btn__svg { width: 44px; height: 44px; }
}

/* 모바일 시안 매칭 — 영상/버튼 분리:
 *  - 어두운 BG 제거 (background transparent), 영상 자체만 좌측 정렬
 *  - 우측 약 60px 공간에 액션 아이콘들 floating (영상 외부, 영상에 가깝게)
 *  - 재생 버튼 오렌지 → 회색 반투명 (시안 회색 ▶)
 *  - 우측 아이콘 색상 시안 매칭 — 원형 배경 흰 반투명, 아이콘 stroke/fill 검정 */
@media (max-width: 1023px) {
    .discover-shorts-detail-page .dsc-sd-video-bg {
        background: transparent;
        border-radius: 0;
        overflow: visible;
        aspect-ratio: auto;
        height: auto;
    }
    .discover-shorts-detail-page .dsc-sd-video {
        position: relative;
        top: auto;
        bottom: auto;
        left: 0;
        width: calc(100% - 60px);   /* 영상 폭 = 화면 폭 - 우측 아이콘 영역(60px) */
        aspect-ratio: 9 / 16;
        border-radius: 10px;
        background: #0a0a0a;
    }
    /* 우측 거터 아이콘 — 영상 외부 우측. 모바일 전 구간 (1023↓) 아이콘 사이즈 48 로 통일해
     * 태블릿(768~1023) 구간에서도 영상(폭 calc(100%-60px))과 아이콘이 겹치지 않게.
     * 48 + right:6 = 54 → 우측 60px 영역 안에 들어감 (영상과 6px 여백). */
    .discover-shorts-detail-page .dsc-sd-action { width: 48px; height: 48px; }
    .discover-shorts-detail-page .dsc-sd-action img,
    .discover-shorts-detail-page .dsc-sd-action__svg { width: 48px; height: 48px; }
    .discover-shorts-detail-page .dsc-sd-sound-btn { width: 44px; height: 44px; }
    .discover-shorts-detail-page .dsc-sd-sound-btn img,
    .discover-shorts-detail-page .dsc-sd-sound-btn__svg { width: 44px; height: 44px; }
    .discover-shorts-detail-page .dsc-sd-actions {
        right: 6px;
        bottom: 12px;
        flex-direction: column;
        gap: 10px;
    }
    .discover-shorts-detail-page .dsc-sd-sound-btn {
        right: 8px;
        top: 8px;
    }
    /* 재생 버튼 — 모바일 회색 반투명 (시안 매칭) */
    .discover-shorts-detail-page .dsc-sd-play-overlay__svg circle { fill: rgba(0, 0, 0, 0.45); }
    /* 우측 아이콘 원형 배경 — 흰 반투명 (시안: 흰 배경 위 회색 원형 + 검정 아이콘) */
    .discover-shorts-detail-page .dsc-sd-action__svg > circle:first-child,
    .discover-shorts-detail-page .dsc-sd-sound-btn__svg > circle:first-child { fill: rgba(0, 0, 0, 0.12); }
    /* 아이콘 stroke/fill — 흰색 → 검정 (시안: 흰 배경 위 검정 아이콘) */
    .discover-shorts-detail-page .dsc-sd-sound-btn__svg path { stroke: #000; }
    .discover-shorts-detail-page .dsc-sd-action--like .dsc-sd-action__svg--off path { fill: #000; stroke: #000; }
    .discover-shorts-detail-page .dsc-sd-action--share .dsc-sd-action__svg path { fill: #000; }
    /* like ON (오렌지 채움 하트) 은 그대로 유지 — 활성 상태 인디케이터 색 보존 */
}

/* -------- 댓글 패널 (시안 554x828, radius 10, border) -------- */
/* PC: stage grid stretch 로 영상 BG 와 동일 높이. 모바일: 자연 높이 */
.dsc-sd-comments {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
/* 모바일 댓글 모달 backdrop + 닫기 버튼 — 모바일 미디어쿼리에서만 활성 (PC 영향 없음) */
.discover-shorts-detail-page .dsc-sd-comments-backdrop { display: none; }
/* 모달 열림 시 body scroll lock — html 에 overflow-y:scroll 이 있어 overflow:hidden 만으론
 * 부족 (모바일 Safari 등). JS 가 현재 scrollY 를 body.top 인라인 스타일에 박고 클래스 부여 →
 * position:fixed 로 페이지를 시각적으로 그 위치에 고정 → 배경 스크롤 완전 차단.
 * 닫을 때 JS 가 클래스 제거 + window.scrollTo 로 원위치 복원. */
body.dsc-sd-body-lock {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}
.discover-shorts-detail-page .dsc-sd-comments__close {
    display: none;          /* PC: 닫기 버튼 숨김 */
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #959595;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.discover-shorts-detail-page .dsc-sd-comments__close:hover { color: #000; }

@media (max-width: 1023px) {
    /* 시안: chat 버튼 클릭 시 댓글이 화면 하단에서 슬라이드 업 (60% 높이 모달).
     * 평소엔 display:none 으로 완전 숨김. JS 가 inline style 로 display:flex 적용 후
     * RAF 로 .is-open 토글 → transform 트랜지션 작동. 닫을 땐 .is-open 제거 후
     * setTimeout 으로 트랜지션 끝나면 display 다시 제거. */
    .discover-shorts-detail-page .dsc-sd-comments {
        position: fixed;
        left: 0;
        right: 0;
        /* bottom 을 viewport 하단에 anchor — height 가 어떻게 계산되든 하단은 항상 visible
         * viewport 끝에 붙음 (갤럭시 S25 chrome 잘림 차단). height 로 박스 크기만 결정,
         * top 은 auto 로 두고 bottom 에서 위로 height 만큼 올라가는 식. */
        bottom: 0;
        top: auto;
        height: 60vh;
        z-index: 1001;
        border: 0;
        border-top: 1px solid #e8e8e8;
        border-radius: 16px 16px 0 0;
        min-height: 0;
        box-shadow: 0 -8px 24px rgba(0,0,0,.15);
        transform: translateY(100%);
        will-change: transform;
        transition: transform .25s ease;
        display: none;          /* 평소엔 명시적 숨김 — fixed 위치도 차지하지 않음 */
        flex-direction: column;
        overflow: hidden;       /* 입력영역(absolute bottom:0) 이 모달 박스 밖으로 새지 않게 */
    }
    .discover-shorts-detail-page .dsc-sd-comments.is-open {
        transform: translateY(0);
    }
    .discover-shorts-detail-page .dsc-sd-comments-backdrop {
        display: none;          /* 사용자 요청: 댓글 모달 열때 뒤에 딤드 처리 안 함 */
        position: fixed;
        inset: 0;
        background: transparent;
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }
    .discover-shorts-detail-page .dsc-sd-comments-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }
    .discover-shorts-detail-page .dsc-sd-comments__close { display: inline-flex; align-items: center; justify-content: center; }
    /* 댓글 header padding 모바일 — 모달 상단 영역 차지 비율 줄임.
     * source order 상 base rule 이 뒤에 있어 specificity 같으면 덮어써지므로
     * .discover-shorts-detail-page 접두로 specificity 올려 확실히 우선 적용. */
    .discover-shorts-detail-page .dsc-sd-comments__header {
        padding: 10px 20px 10px;
        flex-shrink: 0;
    }
    .discover-shorts-detail-page .dsc-sd-comments__title { font-size: 18px; }
    .dsc-sd-comments__count { font-size: 15px; }
    /* 모달 자식 flex 보장 — 댓글 리스트가 남은 공간 차지 + 자체 스크롤. 하단 잘림 방지. */
    .discover-shorts-detail-page .dsc-sd-comments__list,
    .discover-shorts-detail-page .dsc-sd-comments__empty {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }
    /* 입력 영역 — 일반 flex item 으로 모달 하단에 자연스럽게 배치.
     * (absolute 사용 시 padding 으로 자리 비우는 방식이 empty 중앙정렬을 어긋나게 해서
     *  static flex item 으로 단순화. modal 자체가 flex column 이라 자동으로 맨 아래 위치.)
     * safe-area-inset-bottom 으로 iOS 제스처 바 영역까지 padding 확장. */
    .discover-shorts-detail-page .dsc-sd-input {
        position: static;
        background: #fff;
        border-top: 1px solid #e8e8e8;
        padding: 12px 16px 14px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        flex-shrink: 0;
    }
    /* 댓글 없을 때 — flex column 으로 message 수직/수평 중앙정렬.
     * input 이 이제 flex item 이라 empty 영역이 정확히 header~input 사이만 차지 →
     * padding 보정 없이 자연스러운 중앙. */
    .discover-shorts-detail-page .dsc-sd-comments__empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    /* body scroll lock 처리는 JS 에서 — overflow:hidden 토글 */
}

.dsc-sd-comments__header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 16px 24px 14px;
    border-bottom: 1px solid #e8e8e8;
}
/* 동일 트랩 회피용 specificity 보강 — `.discover-shorts-detail-page` 접두 */
.discover-shorts-detail-page .dsc-sd-comments__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #000;
}
.dsc-sd-comments__count {
    font-size: 18px;
    color: #1b1c1b;
    font-weight: 400;
}

.dsc-sd-comments__list {
    flex: 1;
    /* overflow-y: auto 대신 scroll — 콘텐츠가 1px 안팎에서 오가며
     * 내부 스크롤바가 표시/숨김 토글되는 것을 방지 */
    overflow-y: scroll;
    overflow-anchor: none;
    list-style: none;
    margin: 0;
    padding: 18px 28px 8px;
    display: flex;
    flex-direction: column;
}
.dsc-sd-comments__list::-webkit-scrollbar { width: 4px; }
.dsc-sd-comments__list::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 2px; }
.dsc-sd-comments__list::-webkit-scrollbar-track { background: transparent; }

.dsc-sd-comments__empty {
    flex: 1;
    text-align: center;
    color: #959595;
    padding: 22px 30px;
    font-size: 18px;
    line-height: 1.5;
    white-space: pre-line;
}
.discover-shorts-detail-page .dsc-sd-comments__more {
    border: 0;
    background: transparent;
    color: #ff7c0a;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 12px 0;
    align-self: center;
}

/* 댓글 카드 (시안: 점선 separator 로 구분) */
.dsc-sd-cmt {
    position: relative;
    padding: 16px 0;
    border-bottom: 1px dashed #e3e3e3;
}
.dsc-sd-cmt:last-child { border-bottom: 0; }
.discover-shorts-detail-page .dsc-sd-cmt__user {
    font-size: 18px;
    font-weight: 600;
    color: #0d0d0d;
    margin-bottom: 6px;
    padding-right: 30px;
}
.dsc-sd-cmt__text {
    font-size: 16px;
    color: #000;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    margin-bottom: 8px;
}
.dsc-sd-cmt__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.dsc-sd-cmt__meta-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.dsc-sd-cmt__time {
    font-size: 14px;
    color: #959595;
}
.dsc-sd-cmt__reply-btn {
    background: none;
    border: 0;
    color: #6b6b6b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}
.dsc-sd-cmt__reply-btn:hover { color: #0a0a0a; }
.dsc-sd-cmt__like {
    background: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #959595;
    font-size: 14px;
    padding: 0;
}
/* path 좌표가 viewBox 좌상단을 살짝 넘어가 좌측이 잘리는 현상 방지 */
.dsc-sd-cmt__like svg { width: 16px; height: 16px; overflow: visible; }
.dsc-sd-cmt__like.is-liked { color: #ff1b1b; }
.dsc-sd-cmt__like.is-liked svg { fill: #ff1b1b; stroke: #ff1b1b; }

.dsc-sd-cmt__more {
    position: absolute;
    right: 0;
    top: 16px;
    width: 24px;
    height: 24px;
    background: none;
    border: 0;
    cursor: pointer;
    color: #959595;
    font-size: 18px;
    letter-spacing: 2px;
    line-height: 1;
    padding: 0;
}
.dsc-sd-cmt__delete {
    background: none;
    border: 0;
    color: #ff1b1b;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

/* 답글 토글 */
.dsc-sd-cmt__replies-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 0;
    color: #959595;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0 0;
    width: 100%;
}
.dsc-sd-cmt__replies-toggle .dsc-sd-cmt__replies-line {
    display: inline-block;
    width: 20px;
    height: 0;
    border-top: 1px solid #959595;
}
.dsc-sd-cmt__replies-toggle .dsc-sd-cmt__replies-line--dashed {
    flex: 1;
    border-top: 1px dashed #e3e3e3;
}
/* 대댓글 토글 화살표 — inline SVG (Material Symbols Rounded keyboard_arrow_down path).
 *  접힘 기본: 아래 방향. 펼침(.is-open): rotate(180deg) 로 위 방향.
 *  폰트 로드 의존 없음 — 모든 디바이스/브라우저에서 동일 렌더 보장. */
.dsc-sd-cmt__replies-toggle .dsc-sd-cmt__replies-arrow {
    width: 18px;
    height: 18px;
    color: #959595;
    flex-shrink: 0;
    transition: transform .15s;
}
.dsc-sd-cmt__replies-toggle.is-open .dsc-sd-cmt__replies-arrow {
    transform: rotate(180deg);
}

/* 답글 영역 */
.dsc-sd-replies {
    list-style: none;
    margin: 12px 0 0;
    padding: 0 0 0 28px;
    display: none;
    flex-direction: column;
    gap: 14px;
}
.dsc-sd-replies.is-open { display: flex; }
.dsc-sd-reply {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dsc-sd-reply__head {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dsc-sd-reply__line {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.discover-shorts-detail-page .dsc-sd-reply__user {
    font-size: 16px;
    font-weight: 600;
    color: #0d0d0d;
}
.dsc-sd-reply__text {
    font-size: 14px;
    color: #000;
    line-height: 1.5;
    padding-left: 28px;
}
.dsc-sd-reply__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 28px;
}

/* -------- 입력창 (시안: 회색 배경 + 입력창 안 아바타 + send 버튼) -------- */
.dsc-sd-input {
    background: #f5f5f5;
    border-radius: 0 0 10px 10px;
    padding: 18px 20px;
    flex-shrink: 0;
}
.dsc-sd-input__row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dsc-sd-input__wrap {
    flex: 1;
    position: relative;
}
.dsc-sd-input__wrap input {
    width: 100%;
    height: 53px;
    border-radius: 500px;
    border: 1px solid #e3e3e3;
    background: #fff;
    padding: 0 55px 0 20px;
    font-size: 16px;
    color: #000;
    outline: none;
}
.dsc-sd-input__wrap input::placeholder { color: #959595; }
/* 답글 작성 모드 — 입력 영역 강조 (오렌지 보더) */
.dsc-sd-input__wrap.is-replying input { border: 2px solid #FF9800; }
.dsc-sd-input__emoji {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 22px;
    padding: 0;
    line-height: 1;
}
.dsc-sd-input__send {
    width: 49px;
    height: 49px;
    border: 0;
    border-radius: 50%;
    background: #36cf00;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}
.dsc-sd-input__send img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
.dsc-sd-input__send-svg { width: 22px; height: 22px; display: block; }
.dsc-sd-input__foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    font-size: 12px;
    color: #959595;
}

/* -------- 빈 상태 (쇼츠 미등록) — 시안: 캐릭터(좌) + 텍스트(우) 가로 배치 -------- */
.dsc-sd-no-shorts {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    gap: 60px;
}
.dsc-sd-no-shorts__char {
    width: 250px;
    height: auto;
    max-width: 40vw;
    flex-shrink: 0;
}
.dsc-sd-no-shorts__text {
    font-family: 'SUIT Variable', 'SUIT', 'Pretendard Variable', 'Pretendard', sans-serif;
    font-size: 29px;
    font-weight: 400;
    color: #000;
    line-height: 1.4;
    letter-spacing: -0.87px;
    white-space: pre-line;
    text-align: left;
}
@media (max-width: 1023px) {
    .dsc-sd-no-shorts { gap: 40px; padding: 60px 20px; }
    .dsc-sd-no-shorts__char { width: 200px; }
    .dsc-sd-no-shorts__text { font-size: 22px; }
}
@media (max-width: 559px) {
    /* 모바일은 세로 stack 으로 폴백 (좁은 화면에서 가로 배치 부적합) */
    .dsc-sd-no-shorts { flex-direction: column; gap: 24px; text-align: center; }
    .dsc-sd-no-shorts__char { width: 180px; }
    .dsc-sd-no-shorts__text { font-size: 18px; text-align: center; }
}

/* -------- 이모지 모달 -------- */
.dsc-emoji-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dsc-emoji-modal__mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
}
.dsc-emoji-modal__box {
    position: relative;
    width: 92%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.dsc-emoji-modal__close {
    position: absolute;
    right: 12px; top: 12px;
    width: 28px; height: 28px;
    background: none;
    border: 0;
    font-size: 22px;
    cursor: pointer;
    color: #555;
}
.dsc-emoji-modal__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
}
.dsc-emoji-modal__grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 320px;
    overflow-y: auto;
}
.dsc-emoji-btn {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1.2;
    padding: 6px 4px;
    cursor: pointer;
    border-radius: 6px;
    transition: background .12s;
}
.dsc-emoji-btn:hover { background: #f5f5f5; }
@media (max-width: 559px) {
    .dsc-emoji-modal__grid { grid-template-columns: repeat(6, 1fr); }
}

/* -------- 토스트 모달 (링크 복사 등 알림 공용) — discover_detail 와 동일 시안
 *  중앙 화이트 박스 + 메시지 + 검정 OK 버튼 -------- */
.dsc-toast-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dsc-toast-modal__mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
}
.dsc-toast-modal__box {
    position: relative;
    width: 92%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 48px 28px 28px;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
    text-align: center;
    box-sizing: border-box;
}
.dsc-toast-modal__msg {
    margin: 0 0 40px;
    font-size: 16px;
    color: #000;
    line-height: 1.5;
    letter-spacing: -0.48px;
    word-break: keep-all;
}
.dsc-toast-modal__btn {
    display: block;
    width: 100%;
    max-width: none;
    height: 52px;
    background: #000;
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.48px;
    cursor: pointer;
    transition: background .15s;
}
.dsc-toast-modal__btn:hover { background: #333; }
@media (max-width: 559px) {
    .dsc-toast-modal__box { padding: 36px 20px 20px; max-width: 320px; }
    .dsc-toast-modal__msg { font-size: 15px; margin-bottom: 28px; }
    .dsc-toast-modal__btn { height: 46px; font-size: 15px; }
}
