.public-read-aloud {
    display: grid;
    gap: .25rem;
    margin-block-start: .625rem;
    min-width: 0;
}

.public-read-aloud > button {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .375rem .75rem;
    border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
    border-radius: .5rem;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
}

.public-read-aloud > button:hover,
.public-read-aloud > button[aria-pressed="true"] {
    background: color-mix(in srgb, currentColor 9%, transparent);
}

.public-read-aloud > button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.public-read-aloud svg {
    width: 1.15rem;
    height: 1.15rem;
    flex: none;
}

.public-read-aloud__status {
    font-size: .75rem;
}

.public-read-aloud__status:empty {
    height: 0;
    margin-block-start: -.25rem;
}

.public-read-aloud--floating {
    position: fixed;
    z-index: 40;
    inset-inline-start: max(.75rem, env(safe-area-inset-left));
    inset-block-end: max(.75rem, env(safe-area-inset-bottom));
    justify-items: start;
    margin: 0;
    color: #18334a;
}

.public-read-aloud--floating > button {
    box-shadow: 0 4px 14px rgb(16 33 49 / 18%);
    background: #fff;
    border-radius: 50%;
    padding: 0;
}

.public-read-aloud--floating > button:hover,
.public-read-aloud--floating > button[aria-pressed="true"] {
    background: #eaf1f8;
}

.public-read-aloud--floating > button > span {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
}

.public-read-aloud--floating .public-read-aloud__status:not(:empty) {
    grid-row: 1;
    padding: .25rem .5rem;
    border-radius: .375rem;
    background: #fff;
}

.public-read-aloud-context {
    position: fixed;
    z-index: 2147483647;
    min-height: 44px;
    max-width: calc(100vw - 16px);
    padding: .6rem .85rem;
    border: 1px solid #c2cedc;
    border-radius: .5rem;
    background: #fff;
    color: #142b52;
    font: inherit;
    font-size: .875rem;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
    box-shadow: 0 .25rem 1rem rgb(20 43 82 / 20%);
}

.public-read-aloud-context:hover,
.public-read-aloud-context:focus-visible {
    background: #eaf1f8;
    outline: 2px solid #275482;
    outline-offset: 2px;
}

@media print {
    .public-read-aloud, .public-read-aloud-context { display: none; }
}

@media (max-width: 639px) {
    .public-read-aloud-ecourse-panel[role="dialog"] {
        position: fixed;
        left: .75rem;
        right: auto;
        width: min(18rem, calc(100vw - 1.5rem));
        max-height: calc(100dvh - 8rem);
        overflow-y: auto;
    }
}
