/* pkist 뷰 — 내용 읽어주기 (TTS) */
.view-in { position: relative; }
.pkist-tts-bar {
    position: absolute;
    top: 4px;
    right: 8px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.section-icon.pkist-tts-below {
    padding-top: 34px;
    box-sizing: border-box;
}
.pkist-tts-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #4a5568;
    cursor: pointer;
    line-height: 1;
}
.pkist-tts-icon-btn i { font-size: 14px; }
.pkist-tts-icon-btn:hover {
    background: #eef2f6;
    color: #1a365d;
}
.pkist-tts-icon-btn.is-playing,
.pkist-tts-bar.is-playing #pkist-tts-toggle {
    color: #2563eb;
}
.pkist-tts-icon-btn.is-playing:hover,
.pkist-tts-bar.is-playing #pkist-tts-toggle:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.pkist-cmt-tts-bar {
    display: inline-flex;
    float: right;
    align-items: center;
    gap: 0;
    margin: -2px 0 0 8px;
}
.pkist-cmt-tts-bar .pkist-tts-icon-btn {
    width: 22px;
    height: 22px;
}
.pkist-cmt-tts-bar .pkist-tts-icon-btn i { font-size: 12px; }
.comment-media .media-heading {
    overflow: hidden;
}

.pkist-tts-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(17, 24, 39, .45);
}
.pkist-tts-overlay.is-open { display: block; }

.pkist-tts-popup {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,.22);
    color: #111827;
    font-size: 13px;
}
.pkist-tts-popup * { box-sizing: border-box; }

.pkist-tts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 14px 14px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
}
.pkist-tts-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}
.pkist-tts-close {
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}
.pkist-tts-close:hover { color: #111827; }

.pkist-tts-body { padding: 12px 14px 16px; }

.pkist-tts-status {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    white-space: pre-wrap;
    line-height: 1.45;
    font-size: 12px;
}

.pkist-tts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}
.pkist-tts-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 500;
}

.pkist-tts-btn {
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    min-height: 34px;
    color: #fff;
    background: #111827;
    cursor: pointer;
    font-size: 12px;
}
.pkist-tts-btn:disabled { opacity: .45; cursor: not-allowed; }
.pkist-tts-btn.secondary { background: #e5e7eb; color: #111827; }
.pkist-tts-btn.blue { background: #2563eb; }
.pkist-tts-btn.danger { background: #dc2626; }

.pkist-tts-sec {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}
.pkist-tts-sec h4 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
}

.pkist-tts-progress {
    padding: 10px;
    border-radius: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}
.pkist-tts-progress .meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
    color: #4b5563;
}
.pkist-tts-progress input[type=range] { width: 100%; }
.pkist-tts-current {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    min-height: 52px;
    max-height: 110px;
    overflow: auto;
    line-height: 1.55;
    font-size: 13px;
}

.pkist-tts-popup select,
.pkist-tts-popup input[type=number] {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
}
.pkist-tts-popup select { min-width: 180px; max-width: 100%; }
.pkist-tts-popup input[type=range] { vertical-align: middle; }
.pkist-tts-hint {
    margin-top: 8px;
    color: #6b7280;
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 560px) {
    .pkist-tts-bar {
        top: 2px;
        right: 4px;
    }
    .pkist-tts-popup select { min-width: 0; width: 100%; }
}

::highlight(pkist-tts-start) {
    background-color: #ffe08a;
    color: #111;
}
.pkist-tts-from-here {
    box-shadow: inset 3px 0 0 #e0a100;
    background: #fff8e1;
}

.view-wrap.pkist-tts-pick-on .content-style p,
.view-wrap.pkist-tts-pick-on .view-content p,
.view-wrap.pkist-tts-pick-on .media-content p {
    cursor: pointer;
}
