/* Shared Apple Glass Subtitle Customization Modal (Web & Android TV D-Pad) */
.dva-subm-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 2147483250;
    background: rgba(5, 7, 12, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    color: #f5f6fa;
    box-sizing: border-box;
}

.dva-subm-overlay.dva-subm-hidden {
    display: none !important;
}

.dva-subm-overlay *,
.dva-subm-overlay *::before,
.dva-subm-overlay *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent !important;
}

.dva-subm-overlay *:focus {
    outline: none !important;
}

.dva-subm-card {
    width: 100%;
    max-width: 560px;
    max-height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(32px) saturate(150%);
    -webkit-backdrop-filter: blur(32px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 40px;
    padding: 26px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

body.dva-playing-perf .dva-subm-overlay,
.dvacast-low-power .dva-subm-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(5, 7, 12, 0.84);
}

body.dva-playing-perf .dva-subm-card,
.dvacast-low-power .dva-subm-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(12, 14, 22, 0.94);
}

.dva-subm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.dva-subm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.dva-subm-title {
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dva-subm-subtitle {
    font-size: 12px;
    color: #b0b8c8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dva-subm-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dva-subm-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dva-subm-icon-btn:hover,
.dva-subm-icon-btn.dva-subm-tv-focus {
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
    transform: scale(1.06);
}

.dva-subm-pill-btn {
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.09);
    color: #f5f6fa;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dva-subm-pill-btn:hover,
.dva-subm-pill-btn.dva-subm-tv-focus {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.dva-subm-body {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px;
    flex: 1 1 auto;
}

.dva-subm-body::-webkit-scrollbar {
    width: 6px;
}

.dva-subm-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
}

.dva-subm-lang-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.dva-subm-lang-btn {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    color: #e4e8f2;
    font-size: 13.5px;
    font-weight: 600;
    padding: 0 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.dva-subm-rev-btn {
    flex: 0 0 46px;
    width: 46px;
    height: 44px;
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    color: #e4e8f2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.dva-subm-lang-btn.is-active,
.dva-subm-rev-btn.is-active {
    background: linear-gradient(135deg, #e50914 0%, #d50055 100%);
    color: #ffffff;
}

.dva-subm-lang-btn:hover,
.dva-subm-rev-btn:hover,
.dva-subm-lang-btn.dva-subm-tv-focus,
.dva-subm-rev-btn.dva-subm-tv-focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.58);
    transform: translateY(-1px);
}

.dva-subm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.dva-subm-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 15px 10px;
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.07);
    color: #f5f6fa;
    cursor: pointer;
    text-align: center;
    min-height: 92px;
    transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.dva-subm-tile:hover,
.dva-subm-tile.dva-subm-tv-focus {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.58);
    transform: translateY(-2px);
}

.dva-subm-tile.is-active {
    background: rgba(213, 0, 85, 0.34);
}

.dva-subm-tile-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.dva-subm-tile-lbl {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.dva-subm-tile-val {
    font-size: 11px;
    color: #b0b8c8;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dva-subm-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.55);
    flex-shrink: 0;
}

.dva-subm-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.dva-subm-list-scroll {
    max-height: 310px;
    overflow-y: auto;
    padding-right: 4px;
}

.dva-subm-list-scroll::-webkit-scrollbar {
    width: 6px;
}

.dva-subm-list-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
}

.dva-subm-opt-btn {
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    color: #f5f6fa;
    font-size: 14.5px;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.16s ease, box-shadow 0.16s ease;
}

.dva-subm-opt-btn:hover,
.dva-subm-opt-btn.dva-subm-tv-focus {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.58);
}

.dva-subm-opt-btn.is-active {
    background: linear-gradient(135deg, #e50914 0%, #d50055 100%);
    color: #ffffff;
}

.dva-subm-color-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 6px 2px;
}

.dva-subm-color-btn {
    height: 62px;
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 7px;
    font-size: 11.5px;
    font-weight: 700;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.dva-subm-color-btn:hover,
.dva-subm-color-btn.dva-subm-tv-focus {
    transform: scale(1.04);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.72);
}

.dva-subm-color-btn.is-active {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px #d50055;
}

.dva-subm-outline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dva-subm-ctrl-card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.dva-subm-ctrl-card.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.dva-subm-ctrl-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.dva-subm-ctrl-val {
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    padding: 3px 10px;
    border-radius: 999px;
}

.dva-subm-stepper-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dva-subm-step-btn {
    min-width: 44px;
    height: 36px;
    padding: 0 10px;
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.dva-subm-step-btn:hover,
.dva-subm-step-btn.dva-subm-tv-focus {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.dva-subm-range {
    flex: 1;
    min-width: 0;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    cursor: pointer;
}

.dva-subm-range.dva-subm-tv-focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}

.dva-subm-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #d50055;
    cursor: pointer;
}

.dva-subm-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.07);
}

.dva-subm-switch {
    position: relative;
    width: 48px;
    height: 27px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s ease, box-shadow 0.18s ease;
}

.dva-subm-switch[aria-checked="true"] {
    background: linear-gradient(135deg, #e50914 0%, #d50055 100%);
    border-color: rgba(255, 255, 255, 0.45);
}

.dva-subm-switch.dva-subm-tv-focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.dva-subm-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.18s ease;
}

.dva-subm-switch[aria-checked="true"] .dva-subm-switch-knob {
    transform: translateX(21px);
}

.dva-subm-note {
    font-size: 12px;
    color: #b0b8c8;
    text-align: center;
    margin-top: 10px;
    line-height: 1.45;
}

.dva-subm-search-wrap {
    margin-bottom: 12px;
}

.dva-subm-search-input {
    width: 100%;
    height: 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 0 16px;
    font-size: 13.5px;
}

.dva-subm-search-input:focus {
    border-color: rgba(255, 255, 255, 0.55);
}

.dva-subm-confirm-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.dva-subm-confirm-btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.16s ease, box-shadow 0.16s ease;
}

.dva-subm-confirm-btn.is-danger {
    background: linear-gradient(135deg, #e50914 0%, #d50055 100%);
}

.dva-subm-confirm-btn:hover,
.dva-subm-confirm-btn.dva-subm-tv-focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.65);
}

@media (max-width: 520px) {
    .dva-subm-card {
        padding: 20px 18px;
        border-radius: 28px;
    }
    .dva-subm-grid {
        gap: 8px;
    }
    .dva-subm-tile {
        padding: 12px 6px;
        min-height: 82px;
        border-radius: 20px;
    }
}
