.cn-articles-query .cn-entry-date {
    display: flex;
    align-items: center;
    min-height: 28px;
}

.cn-entry-has-audio {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.cn-audio-listen {
    display: inline-flex;
    align-items: center;

    & a, & button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 28px;
        min-width: 62px;
        padding: 0 4px;
        border: 0;
        border-radius: 4px;
        background: transparent;
        color: #333;
        font: inherit;
        font-size: 12px;
        line-height: 1.5;
        text-decoration: none;
        cursor: pointer;
    }

    & svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }

    & a:hover, & button:hover, & button[aria-pressed="true"] {
        background: #f1f1f1;
        color: #0d0d0d;
    }

    & a:focus-visible, & button:focus-visible {
        outline: 2px solid #007afb;
        outline-offset: 3px;
    }

    &.is-enhanced > a {
        display: none;
    }
}

.cn-article-recording {
    margin: 0 0 48px !important;
    padding: 24px;
    border: 1px solid #e7e7e7;
    border-radius: 16px;
    background: #f7f7f7;

    & > p {
        margin: 0 0 14px;
        font-size: 16px;
        font-weight: 600;
    }

    & audio { width: 100%; }
    & figcaption { font-size: 13px; }
    &.is-enhanced > :not(.cn-audio-view) { display: none; }
}

.cn-audio-view {
    --cn-audio-ink: #111;
    --cn-audio-muted: #666;
    --cn-audio-track: #d6d6d6;
    color: var(--cn-audio-ink);
    font-family: inherit;

    & button, & summary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: inherit;
        cursor: pointer;
    }
    & button:focus-visible, & summary:focus-visible, & input:focus-visible {
        outline: 2px solid #007afb;
        outline-offset: 4px;
    }
    & .cn-audio-toggle { background: #111; color: #fff; }
    & .cn-audio-row { display: flex; align-items: center; gap: 16px; }
    & .cn-audio-copy { flex: 1; min-width: 0; }
    & .cn-audio-label { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; }
    & .cn-audio-subtitle { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--cn-audio-muted); }
    & .cn-audio-progress { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
    & .cn-audio-time { flex-shrink: 0; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--cn-audio-muted); white-space: nowrap; }
    & input[type="range"] {
        --progress: 0%;
        appearance: none;
        min-width: 0;
        width: 100%;
        height: 24px;
        padding: 0;
        margin: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        cursor: pointer;
        accent-color: var(--cn-audio-ink);
    }
    & input[type="range"]::-webkit-slider-runnable-track {
        height: 3px;
        border-radius: 4px;
        background: linear-gradient(to right, var(--cn-audio-ink) var(--progress), var(--cn-audio-track) var(--progress));
    }
    & input[type="range"]::-webkit-slider-thumb {
        appearance: none;
        width: 10px;
        height: 10px;
        margin-top: -3.5px;
        border: 0;
        border-radius: 50%;
        background: var(--cn-audio-ink);
    }
    & input[type="range"]::-moz-range-track { height: 3px; background: var(--cn-audio-track); }
    & input[type="range"]::-moz-range-progress { height: 3px; background: var(--cn-audio-ink); }
    & input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 0; background: var(--cn-audio-ink); }
    & .cn-audio-volume { position: relative; flex-shrink: 0; }
    & .cn-audio-volume summary { list-style: none; }
    & .cn-audio-volume summary::-webkit-details-marker { display: none; }
    & .cn-audio-volume-panel {
        position: absolute;
        right: 0;
        bottom: calc(100% + 12px);
        display: flex;
        align-items: center;
        gap: 8px;
        width: 160px;
        padding: 10px 12px;
        border: 1px solid #444;
        border-radius: 12px;
        background: #111;
        color: #fff;
        --cn-audio-ink: #fff;
        --cn-audio-track: #555;
        box-shadow: 0 8px 30px #0002;
        z-index: 2;
    }
    & .cn-audio-volume-panel button { width: 32px; height: 32px; }
}

.cn-audio-dock {
    --cn-audio-ink: #fff;
    --cn-audio-muted: #bdbdbd;
    --cn-audio-track: #555;
    position: fixed;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 10010;
    box-sizing: border-box;
    width: min(580px, calc(100% - 32px));
    padding: 14px 16px 12px;
    border: 1px solid #333;
    border-radius: 18px;
    background: #111;
    color: #fff;
    box-shadow: 0 12px 48px #0003;

    &[hidden] { display: none; }
    & .cn-audio-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: 13px; font-weight: 500; text-decoration: none; }
    & .cn-audio-toggle { background: #fff; color: #111; }
    & .cn-audio-row { gap: 10px; }
    & .cn-audio-progress { margin-top: 8px; gap: 10px; }
    & .cn-audio-subtitle { margin-top: 2px; font-size: 11px; }
    & .cn-audio-close { width: 28px; height: 28px; color: #bbb; }
}

body.cn-audio-active { padding-bottom: 150px; }
.cn-audio-live { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cn-article-recording .cn-audio-view p.cn-audio-label { margin: 0; }
.cn-article-recording .cn-audio-view p.cn-audio-subtitle { margin: 4px 0 0; }
@media (max-width: 480px) {
    .cn-article-recording { padding: 18px; margin-bottom: 32px !important; }
    .cn-audio-view .cn-audio-row { gap: 10px; }
    .cn-audio-view .cn-audio-label { font-size: 14px; }
    .cn-audio-dock { padding: 12px; }
    .cn-audio-dock .cn-audio-label { font-size: 12px; }
}
