.speech-player {
    --speech-accent: #2563eb;
    --speech-track: #dbe3ef;
    --speech-text: #172033;
    --speech-muted: #64748b;
    color: var(--speech-text);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 24px;
}
.speech-player [hidden] { display: none !important; }
.speech-player__heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}
.speech-player__heading svg { color: var(--speech-accent); flex: none; }
.speech-player__controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 78px;
    align-items: center;
    gap: 24px;
}
.speech-player button { cursor: pointer; font: inherit; }
.speech-player button:disabled,
.speech-player select:disabled { cursor: default; opacity: .45; }
.speech-player button:focus-visible,
.speech-player select:focus-visible,
.speech-player input:focus-visible {
    outline: 3px solid var(--speech-accent);
    outline-offset: 4px;
}
.speech-player__play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex: none;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #2563eb;
    box-shadow: 0 3px 8px rgb(37 99 235 / 18%);
}
.speech-player__play:hover:not(:disabled) { background: #1d4ed8; }
.speech-player__timeline {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.speech-player__time {
    flex: none;
    color: var(--speech-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.speech-player__range {
    --progress: 0%;
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
    width: 100%;
    height: 44px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}
.speech-player__range:disabled { cursor: default; opacity: .55; }
.speech-player__range::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 10px;
    background: linear-gradient(to right, var(--speech-accent) var(--progress), var(--speech-track) var(--progress));
}
.speech-player__range::-moz-range-track {
    height: 5px;
    border-radius: 10px;
    background: linear-gradient(to right, var(--speech-accent) var(--progress), var(--speech-track) var(--progress));
}
.speech-player__range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    margin-top: -4px;
    border: 0;
    border-radius: 50%;
    background: var(--speech-accent);
}
.speech-player__range::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 0;
    border-radius: 50%;
    background: var(--speech-accent);
}
.speech-player__speed { position: relative; }
.speech-player__speed label {
    display: block;
    color: var(--speech-muted);
    font-size: 10px;
    line-height: 1.2;
}
.speech-player__speed select {
    width: 100%;
    min-height: 44px;
    padding: 0 3px;
    border: 0;
    border-radius: 6px;
    color: var(--speech-text);
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.speech-player__speed option { color: #172033; background: #fff; }
.speech-player__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.dark .speech-player {
    --speech-accent: #60a5fa;
    --speech-track: #3b485c;
    --speech-text: #e2e8f0;
    --speech-muted: #a6b4c8;
    background: #182233;
    border-color: #334155;
}
@media (max-width: 640px) {
    .speech-player {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 70px;
        align-items: center;
        column-gap: 10px;
        padding: 10px 12px;
        border-radius: 12px;
    }
    .speech-player__heading {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        margin: 0;
        font-size: 13px;
        line-height: 1.35;
    }
    .speech-player__heading svg { display: none; }
    .speech-player__controls { display: contents; }
    .speech-player__play {
        grid-column: 1;
        grid-row: 1;
        width: 44px;
        height: 44px;
    }
    .speech-player__play svg { width: 22px; height: 22px; }
    .speech-player__timeline { grid-column: 1 / -1; grid-row: 2; gap: 8px; }
    .speech-player__speed { grid-column: 3; grid-row: 1; }
    .speech-player__speed label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .speech-player__speed select { font-size: 16px; }
}
@media print { #article-speech { display: none !important; } }
