/* Accessibility voice reader — local Web Speech UI */

.vr-root {
    position: fixed;
    left: calc(1.1rem + env(safe-area-inset-left, 0px));
    bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
    z-index: 1040;
    font-family: var(--font-ui, "Noto Sans", system-ui, sans-serif);
    color: var(--deep-black, #000);
    pointer-events: none;
}

.vr-fab,
.vr-panel {
    pointer-events: auto;
}

.vr-fab {
    width: 3.15rem;
    height: 3.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: var(--palette-purple, #64348A);
    color: var(--deep-white, #fff);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    line-height: 1;
    touch-action: manipulation;
}

.vr-fab:hover,
.vr-fab:focus-visible {
    background: #532a73;
}

.vr-fab:focus-visible,
.vr-panel button:focus-visible,
.vr-panel select:focus-visible {
    outline: 3px solid var(--palette-yellow, #F4A62A);
    outline-offset: 2px;
}

.vr-fab-icon {
    font-size: 1.25rem;
    pointer-events: none;
}

.vr-fab.is-active {
    box-shadow: 0 0 0 3px var(--deep-white, #fff), 0 0 0 6px var(--palette-purple, #64348A);
}

.vr-panel {
    position: absolute;
    left: 0;
    bottom: 3.7rem;
    width: min(21.5rem, calc(100vw - 2.2rem));
    background: var(--page-bg, #f5f5f0);
    border: 1px solid #d8d4cc;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    padding: 0.95rem 1rem 1rem;
}

.vr-panel[hidden] {
    display: none !important;
}

.vr-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.vr-title {
    font-family: var(--font-heading, "Bebas Neue", sans-serif);
    font-size: 1.45rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.15;
    margin: 0;
    color: var(--deep-black, #000);
}

.vr-close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border: 0;
    background: transparent;
    color: var(--deep-black, #000);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.vr-close:hover {
    color: var(--palette-purple, #64348A);
}

.vr-status {
    min-height: 1.35rem;
    margin: 0 0 0.7rem;
    font-size: 0.88rem;
    line-height: 1.4;
    color: #333;
}

.vr-status.is-error {
    color: var(--palette-red, #BE1E3C);
}

.vr-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.vr-btn {
    border: 1px solid var(--palette-purple, #64348A);
    background: var(--deep-white, #fff);
    color: var(--palette-purple, #64348A);
    font-family: var(--font-ui, "Noto Sans", sans-serif);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.55rem 0.4rem;
    min-height: 2.75rem;
    cursor: pointer;
    touch-action: manipulation;
}

.vr-btn-primary {
    background: var(--palette-purple, #64348A);
    color: var(--deep-white, #fff);
}

.vr-btn:hover:not(:disabled) {
    background: #532a73;
    border-color: #532a73;
    color: var(--deep-white, #fff);
}

.vr-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.vr-field {
    display: block;
    margin-bottom: 0.55rem;
}

.vr-field:last-child {
    margin-bottom: 0;
}

.vr-field span {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.28rem;
    color: var(--deep-black, #000);
}

.vr-field select {
    width: 100%;
    border: 1px solid #c9c4ba;
    background: var(--deep-white, #fff);
    color: var(--deep-black, #000);
    font-family: var(--font-ui, "Noto Sans", sans-serif);
    font-size: 0.92rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0;
}

@media (max-width: 575.98px) {
    .vr-root {
        left: calc(0.75rem + env(safe-area-inset-left, 0px));
        bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .vr-fab {
        width: 2.85rem;
        height: 2.85rem;
    }

    .vr-panel {
        bottom: 3.4rem;
        width: min(20.5rem, calc(100vw - 1.5rem));
        padding: 0.8rem 0.85rem 0.9rem;
    }

    .vr-title {
        font-size: 1.28rem;
    }

    .vr-btn {
        font-size: 0.86rem;
        padding: 0.48rem 0.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vr-fab,
    .vr-btn,
    .vr-panel {
        transition: none !important;
    }
}
