/* Yahosti Voice player — themeable via CSS custom properties */
.yhv-player {
    --yhv-color-primary: #1a73e8;
    --yhv-color-bg: #fafafa;
    --yhv-color-fg: #333;
    --yhv-color-border: #e3e3e3;
    --yhv-color-muted: #777;
    --yhv-radius: 8px;

    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--yhv-color-border);
    border-radius: var(--yhv-radius);
    background: var(--yhv-color-bg);
    color: var(--yhv-color-fg);
    font-family: inherit;
    line-height: 1.6;
}

.yhv-player[dir="rtl"] { text-align: right; }

.yhv-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 8px;
}
.yhv-player-title { color: var(--yhv-color-fg); }

.yhv-player audio {
    width: 100%;
    display: block;
}

.yhv-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}
.yhv-btn {
    background: transparent;
    border: 1px solid var(--yhv-color-border);
    border-radius: 4px;
    padding: 4px 10px;
    color: var(--yhv-color-fg);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.yhv-btn:hover {
    background: var(--yhv-color-primary);
    border-color: var(--yhv-color-primary);
    color: #fff;
}
.yhv-speed {
    border: 1px solid var(--yhv-color-border);
    border-radius: 4px;
    padding: 4px 6px;
    background: transparent;
    color: var(--yhv-color-fg);
}

/* Waveform */
.yhv-waveform { margin-top: 10px; min-height: 48px; }

/* Chapters */
.yhv-chapters {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--yhv-color-border);
    padding-top: 8px;
}
.yhv-chapters li { margin: 2px 0; }
.yhv-chapter {
    display: flex;
    width: 100%;
    background: transparent;
    border: 0;
    text-align: inherit;
    padding: 4px 0;
    color: var(--yhv-color-fg);
    cursor: pointer;
    font: inherit;
    justify-content: space-between;
}
.yhv-chapter:hover { color: var(--yhv-color-primary); }
.yhv-chapter-time { color: var(--yhv-color-muted); font-variant-numeric: tabular-nums; }

/* Transcript / Karaoke */
.yhv-transcript {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--yhv-color-border);
    max-height: 240px;
    overflow-y: auto;
    line-height: 1.9;
    font-size: 15px;
}
.yhv-word { transition: background .12s; cursor: pointer; padding: 0 1px; border-radius: 3px; }
.yhv-word.yhv-active {
    background: var(--yhv-color-primary);
    color: #fff;
}

/* Dark theme — explicit class wins over media query */
@media (prefers-color-scheme: dark) {
    .yhv-player:not(.yhv-light) {
        --yhv-color-bg: #1f1f1f;
        --yhv-color-fg: #ddd;
        --yhv-color-border: #333;
        --yhv-color-muted: #999;
    }
}
.yhv-player.yhv-dark {
    --yhv-color-bg: #1f1f1f;
    --yhv-color-fg: #ddd;
    --yhv-color-border: #333;
    --yhv-color-muted: #999;
}
.yhv-theme-toggle {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 480px) {
    .yhv-controls { gap: 4px; }
    .yhv-btn { padding: 4px 8px; font-size: 12px; }
}
