@import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap);
:root {
    --main-bg-color: hsl(220, 20%, 97%);
    --stream-bg-color: hsl(220, 15%, 88%);
    --shell-bg-color: hsl(0, 0%, 0%);
    --text-shadow-color: hsl(218, 67%, 92%);
    --header-bg-color: hsl(0, 0%, 100%);
    --controls-bg-color: hsla(220, 20%, 95%, 0.92);
    --control-buttons-bg-color: hsl(220, 15%, 96%);
    --text-color: hsl(220, 20%, 18%);
    --text-color-light: hsl(220, 10%, 55%);
    --link-color: hsl(218, 85%, 45%);
    --link-color-light: hsl(218, 85%, 70%);
    --link-color_visited: hsl(271, 68%, 35%);
    --link-color_visited-light: hsl(271, 68%, 68%);
    --svg-checkbox-bg-color: hsl(172, 80%, 38%);
    --svg-button-fill: hsl(220, 20%, 40%);
    --kill-button-hover-color: hsl(4, 90%, 50%);
    --url-color: hsl(0, 0%, 55%);
    --button-text-color: hsl(218, 80%, 48%);
    --button-border-color: hsl(220, 10%, 78%);
    --progress-background-color: hsla(225, 100%, 50%, 0.15);
    --progress-background-error-color: hsla(0, 100%, 50%, 0.15);
    --font-size: 14px;
    --control-btn-size: 3rem;
    --control-sidebar-width: 3.6rem;
    --border-radius: 12px;
    --shadow: 0 4px 24px hsla(220, 30%, 10%, 0.12);
    --shadow-sm: 0 2px 8px hsla(220, 30%, 10%, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --main-bg-color: hsl(222, 20%, 11%);
        --stream-bg-color: hsl(222, 18%, 16%);
        --shell-bg-color: hsl(0, 0%, 0%);
        --text-shadow-color: hsl(218, 17%, 20%);
        --header-bg-color: hsl(222, 18%, 16%);
        --controls-bg-color: hsla(222, 22%, 14%, 0.92);
        --control-buttons-bg-color: hsl(222, 18%, 16%);
        --text-color: hsl(220, 15%, 88%);
        --text-color-light: hsl(220, 10%, 58%);
        --link-color: hsl(218, 70%, 68%);
        --link-color-light: hsl(218, 55%, 52%);
        --link-color_visited: hsl(267, 45%, 60%);
        --link-color_visited-light: hsl(267, 35%, 42%);
        --svg-checkbox-bg-color: hsl(172, 75%, 35%);
        --svg-button-fill: hsl(220, 15%, 82%);
        --kill-button-hover-color: hsl(4, 80%, 55%);
        --url-color: hsl(0, 0%, 55%);
        --device-list-stripe-color: hsl(222, 18%, 13%);
        --device-list-default-color: hsl(222, 20%, 11%);
        --button-text-color: hsl(218, 70%, 72%);
        --button-border-color: hsl(222, 12%, 32%);
        --progress-background-color: hsla(225, 100%, 50%, 0.15);
        --progress-background-error-color: hsla(0, 100%, 50%, 0.15);
        --shadow: 0 4px 24px hsla(0, 0%, 0%, 0.4);
        --shadow-sm: 0 2px 8px hsla(0, 0%, 0%, 0.25);
    }
}

/* ========= Base ========= */
html {
    font-size: var(--font-size);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--link-color-light);
}

a:visited {
    color: var(--link-color_visited);
}

body {
    color: var(--text-color);
    background-color: var(--main-bg-color);
    margin: 0;
    min-height: 100vh;
    width: 100%;
    overflow: auto;
    /* Disable text selection & callout on touch */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    /* Disable rubber-band scroll on iOS */
    overscroll-behavior: none;
}

body.shell {
    background-color: var(--shell-bg-color);
}

body.stream {
    background-color: var(--stream-bg-color);
}

.terminal-container {
    width: 100%;
    height: 100%;
    padding: 5px;
}

:focus {
    outline: none;
}

.keyboard-text-bridge {
    position: fixed;
    left: -1000px;
    top: -1000px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    resize: none;
    border: 0;
    padding: 0;
}

.flex-center {
    display: flex;
    align-items: center;
}

.wait {
    cursor: wait;
}

/* ========= Device View ========= */
.device-view {
    z-index: 1;
    position: relative;
    width: 100%;
    /* เหลือพื้นที่ให้ nav-bar ด้านล่าง 56px */
    height: calc(100vh - 56px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    background-color: #000;
}

.video-layer {
    position: relative;
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 56px);
    width: auto;
    height: calc(100vh - 56px);
    object-fit: contain;
}

.touch-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    touch-action: none;
}

.video-layer {
    z-index: 0;
}

.touch-layer {
    z-index: 1;
    touch-action: none;
}

.video {
    position: relative;
    width: 100%;
    height: calc(100vh - 56px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    background-color: transparent;
}

.native-webrtc-viewer {
    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: var(--stream-fit-width, 100vw);
    height: var(--stream-fit-height, 100dvh);
    max-width: 100vw;
    max-height: 100dvh;
    transform: translate(-50%, -50%);
    border: 0;
    z-index: 5;
    background: #000;
    transition: none !important;
    transform-origin: center center;
}

.cloud-phone-view.native-webrtc-active .video {
    opacity: 0;
    pointer-events: none;
}

.cloud-phone-view.native-webrtc-active .stream-loading-state {
    display: none;
}

/* ========= Android-style Bottom Navigation Bar ========= */
.android-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    background: hsla(222, 25%, 8%, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid hsla(218, 40%, 30%, 0.3);
    box-shadow: 0 -4px 24px hsla(0,0%,0%,0.5);
    user-select: none;
    padding: 0 12px;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* iPhone notch support */
}

.android-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: hsla(220, 10%, 80%, 0.85);
    font-size: 10px;
    font-family: inherit;
    transition: color 0.15s, transform 0.1s, background 0.15s;
    border-radius: 12px;
    padding: 6px 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.android-nav-btn:hover {
    background: hsla(218, 60%, 40%, 0.25);
    color: white;
}

.android-nav-btn:active {
    transform: scale(0.88);
    background: hsla(218, 60%, 40%, 0.4);
}

.android-nav-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ========= Control Sidebar (single button) ========= */
.control-buttons-list {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    top: auto;
    transform: none;
    z-index: 10;
    width: auto;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    gap: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-height: unset;
    overflow: visible;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    user-select: none;
}

/* Drag handle — hidden now (single floating btn has no drag) */
.control-drag-handle { display: none; }

.control-button {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: 52px;
    height: 52px;
    border: 1.5px solid hsla(218, 60%, 60%, 0.35);
    border-radius: 50%;
    opacity: 0.9;
    background: hsla(222, 25%, 12%, 0.88);
    box-shadow: 0 4px 20px hsla(0, 0%, 0%, 0.45), 0 0 0 1px hsla(220, 60%, 60%, 0.06);
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 52px;
    min-height: 52px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.control-button:hover {
    opacity: 1;
    background: hsla(218, 60%, 40%, 0.45);
    border-color: hsla(218, 70%, 65%, 0.6);
    box-shadow: 0 6px 24px hsla(218, 70%, 50%, 0.3), 0 0 0 1px hsla(218, 70%, 60%, 0.1);
    transform: scale(1.06);
}

.control-button:active {
    opacity: 1;
    transform: scale(0.94);
}

/* Active/toggled state for Menu button */
.control-button--active {
    background: hsla(218, 70%, 45%, 0.55) !important;
    border-color: hsla(218, 80%, 65%, 0.7) !important;
    box-shadow: 0 4px 20px hsla(218, 70%, 50%, 0.4), 0 0 0 1px hsla(218, 70%, 60%, 0.15) !important;
    opacity: 1 !important;
}

.control-button > svg {
    fill: hsla(220, 10%, 92%, 0.92);
    width: 1.4rem;
    height: 1.4rem;
    pointer-events: auto;
}
.control-button--active > svg { fill: white; }

/* Checkbox controls */
.control-wrapper>input[type=checkbox] {
    display: none;
}

.control-wrapper>label {
    display: inline-block;
    cursor: pointer;
}

.control-wrapper>input[type=checkbox].two-images:checked+label>svg.image-on {
    display: block;
}

.control-wrapper>input[type=checkbox].two-images:not(:checked)+label>svg.image-on {
    display: none;
}

.control-wrapper>input[type=checkbox].two-images:checked+label>svg.image-off {
    display: none;
}

.control-wrapper>input[type=checkbox].two-images:not(:checked)+label>svg.image-off {
    display: block;
}

.control-wrapper>input[type=checkbox]:checked+label>svg {
    fill: var(--svg-checkbox-bg-color);
}

/* ========= Touch Screen Canvas ========= */
canvas {
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ========= Responsive (mobile/tablet portrait) ========= */
@media (max-width: 600px) {
    :root {
        --control-btn-size: 2.5rem;
        --control-sidebar-width: 3.2rem;
        --font-size: 13px;
    }

    .control-buttons-list {
        right: 0.5rem;
        border-radius: 12px;
        padding: 0.35rem 0;
    }
}

/* ========= Cloud phone stream layout ========= */
body.stream {
    background: #2f2f2f;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

.cloud-phone-view {
    --android-nav-reserved-space: 0px;
    --stream-aspect: 1.7778;
    --stream-fit-width: min(100vw, calc(100dvh * var(--stream-aspect, 1.7778)));
    --stream-fit-height: min(100dvh, calc(100vw / var(--stream-aspect, 1.7778)));
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    background: #2f2f2f;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    /* ห้ามหมุนจอเอง — ปล่อยให้ browser ควบคุม */
}

.cloud-phone-view .video {
    width: 100vw !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    contain: layout paint;
    line-height: 0;
    aspect-ratio: auto;
    min-width: 0;
    min-height: 0;
    transition: none !important;
    --stream-fit-width: min(100vw, calc(100dvh * var(--stream-aspect, 1.7778)));
    --stream-fit-height: min(100dvh, calc(100vw / var(--stream-aspect, 1.7778)));
}

.cloud-phone-view .video:not(.stream-layout-ready) {
    --stream-aspect: 0.5625;
}

.cloud-phone-view .video > .video-layer,
.cloud-phone-view .video > canvas.video-layer,
.cloud-phone-view .video > video.video-layer {
    width: var(--stream-fit-width) !important;
    height: var(--stream-fit-height) !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    display: block;
    flex: 0 0 auto;
    background: #000;
    border-radius: 0;
    object-fit: contain;
    image-rendering: auto;
    filter: contrast(1.04) saturate(1.03);
    backface-visibility: hidden;
    transform: none !important;
    transform-origin: center center !important;
    transition: none !important;
    will-change: contents;
}

.cloud-phone-view .video:not(.stream-layout-ready) > .video-layer,
.cloud-phone-view .video:not(.stream-layout-ready) > canvas.video-layer,
.cloud-phone-view .video:not(.stream-layout-ready) > video.video-layer,
.cloud-phone-view .video:not(.stream-layout-ready) > .touch-layer {
    opacity: 0;
}

.cloud-phone-view.low-bandwidth-sharp .video > .video-layer,
.cloud-phone-view.low-bandwidth-sharp .video > canvas.video-layer,
.cloud-phone-view.low-bandwidth-sharp .video > video.video-layer {
    filter: contrast(1.08) saturate(1.04) brightness(1.01);
}

.cloud-phone-view .touch-layer {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: var(--stream-fit-width) !important;
    height: var(--stream-fit-height) !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    object-fit: contain;
    transform: translate(-50%, -50%) !important;
    transform-origin: center center !important;
    transition: none !important;
}

.cloud-exit-btn {
    position: fixed;
    top: 50%;
    left: max(10px, env(safe-area-inset-left));
    right: auto;
    transform: translateY(-50%);
    z-index: 120;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 15, 0.34);
    color: white;
    cursor: pointer;
    opacity: 0.36;
    transition: opacity 140ms ease, background 140ms ease;
}

.cloud-exit-btn:hover,
.cloud-exit-btn:focus-visible {
    background: rgba(15, 15, 15, 0.82);
    opacity: 1;
}

.cloud-exit-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* portrait: nav bar อยู่ล่าง (default) */
.cloud-phone-view .android-nav-bar {
    position: fixed;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 50%;
    right: auto;
    top: auto;
    transform: translateX(-50%);
    width: min(200px, calc(100vw - 80px));
    height: 36px;
    z-index: 120;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 15, 15, 0.34);
    box-shadow: none;
    opacity: 0.32;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: opacity 140ms ease, background 140ms ease;
}

.cloud-phone-view .android-nav-bar:hover,
.cloud-phone-view .android-nav-bar:focus-within {
    background: rgba(15, 15, 15, 0.82);
    opacity: 1;
}

.cloud-phone-view .android-nav-btn {
    width: 54px;
    height: 34px;
    flex: 0 0 auto;
    padding: 0;
    border-radius: 999px;
    color: white;
    background: transparent;
}

.cloud-phone-view .android-nav-btn span {
    display: none;
}

.cloud-phone-view .android-nav-btn svg {
    display: none;
}

/* portrait: Back=1st, Home=2nd, Recents=3rd (ซ้ายไปขวา) */
.cloud-phone-view .android-nav-btn:nth-child(1) {
    order: 1;
}

.cloud-phone-view .android-nav-btn:nth-child(2) {
    order: 2;
}

.cloud-phone-view .android-nav-btn:nth-child(3) {
    order: 3;
}

.cloud-phone-view .android-nav-btn::before {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    background: white;
}

.cloud-phone-view .android-nav-btn:nth-child(3)::before {
    border-radius: 5px;
}

.cloud-phone-view .android-nav-btn:nth-child(2)::before {
    border-radius: 50%;
}

.cloud-phone-view .android-nav-btn:nth-child(1)::before {
    width: 0;
    height: 0;
    background: transparent;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid white;
    border-radius: 4px;
}

.cloud-phone-view .android-nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.cloud-phone-view .android-nav-btn:focus,
.cloud-phone-view .android-nav-btn:focus-visible {
    outline: none;
}

.cloud-phone-view .android-nav-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.06);
}

.cloud-phone-view .control-buttons-list {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    bottom: auto;
    z-index: 130;
    opacity: 0.12;
    transition: opacity 140ms ease;
}

.cloud-phone-view .control-buttons-list:hover,
.cloud-phone-view .control-buttons-list:focus-within,
.cloud-phone-view.overlays-active .control-buttons-list {
    opacity: 1;
}

.cloud-phone-view .control-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    border: 0;
    background: rgba(38, 38, 38, 0.62);
    box-shadow: none;
}

.cloud-phone-view .stream-auto-hud {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 118;
    max-width: calc(100vw - 132px);
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(15, 15, 15, 0.42);
    color: rgba(255, 255, 255, 0.86);
    font: 600 11px/1.25 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cloud-phone-view .stream-auto-hud.is-warning {
    background: rgba(30, 24, 12, 0.54);
    color: rgba(255, 238, 196, 0.94);
}

.cloud-phone-view .stream-auto-hud.is-hidden,
.cloud-phone-view .stream-diagnostics.is-hidden {
    display: none;
}

.cloud-phone-view .stream-info-toggle {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    top: max(8px, env(safe-area-inset-top));
    z-index: 121;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(15, 15, 15, 0.22);
    color: rgba(255, 255, 255, 0.74);
    opacity: 0.12;
    cursor: pointer;
    transition: opacity 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cloud-phone-view .stream-info-toggle:hover,
.cloud-phone-view .stream-info-toggle:focus-visible,
.cloud-phone-view .stream-info-toggle.active,
.cloud-phone-view.overlays-active .stream-info-toggle {
    opacity: 0.92;
    background: rgba(15, 15, 15, 0.72);
    color: #fff;
}

.cloud-phone-view .stream-info-toggle:active {
    transform: scale(0.96);
}

.cloud-phone-view .stream-info-toggle svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.cloud-phone-view .stream-quality-select {
    position: fixed;
    left: max(50px, calc(env(safe-area-inset-left) + 50px));
    top: max(8px, env(safe-area-inset-top));
    z-index: 121;
    height: 34px;
    max-width: 108px;
    padding: 0 28px 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(15, 15, 15, 0.28);
    color: rgba(255, 255, 255, 0.86);
    font: 700 12px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    outline: none;
    opacity: 0.14;
    cursor: pointer;
    transition: opacity 140ms ease, background 140ms ease, color 140ms ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cloud-phone-view .stream-quality-select:hover,
.cloud-phone-view .stream-quality-select:focus,
.cloud-phone-view.overlays-active .stream-quality-select {
    opacity: 0.96;
    background: rgba(15, 15, 15, 0.78);
    color: #fff;
}

.cloud-phone-view .stream-loading-state {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 119;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: min(360px, calc(100vw - 36px));
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(12, 12, 14, 0.72);
    color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
    font: 700 13px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: left;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 1;
    transition: opacity 220ms ease, transform 220ms ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.cloud-phone-view .stream-loading-state.is-hidden {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.98);
}

.cloud-phone-view .stream-loading-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-top-color: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    animation: stream-loading-spin 760ms linear infinite;
}

@keyframes stream-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.cloud-phone-view .stream-diagnostics {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 117;
    max-width: min(260px, calc(100vw - 96px));
    padding: 7px 9px;
    border-radius: 10px;
    background: rgba(15, 15, 15, 0.34);
    color: rgba(255, 255, 255, 0.84);
    font: 600 10px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    opacity: 0.2;
    pointer-events: auto;
    transition: opacity 140ms ease, background 140ms ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cloud-phone-view .stream-diagnostics:hover {
    opacity: 0.94;
    background: rgba(15, 15, 15, 0.78);
}

/* landscape: video เต็มจอ + nav bar อยู่ขวา */
@media (orientation: landscape) {
    .cloud-phone-view .video,
    .cloud-phone-view .video > .video-layer,
    .cloud-phone-view .video > canvas.video-layer,
    .cloud-phone-view .video > video.video-layer {
        width: var(--stream-fit-width);
        height: var(--stream-fit-height);
        max-width: 100vw;
        max-height: 100dvh;
    }

    /* landscape: nav bar ย้ายไปขวา แนวตั้ง */
    .cloud-phone-view .android-nav-bar {
        top: 50%;
        right: max(8px, env(safe-area-inset-right));
        left: auto;
        bottom: auto;
        transform: translateY(-50%);
        width: 40px;
        height: min(196px, calc(100dvh - 80px));
        flex-direction: column;
        padding: 8px 0;
        border-radius: 18px;
    }

    .cloud-phone-view .android-nav-btn {
        width: 38px;
        height: 52px;
        border-radius: 14px;
    }

    /* landscape: Back, Home, Recents เรียงบนลงล่าง */
    .cloud-phone-view .android-nav-btn:nth-child(1) {
        order: 1;
    }
    .cloud-phone-view .android-nav-btn:nth-child(2) {
        order: 2;
    }
    .cloud-phone-view .android-nav-btn:nth-child(3) {
        order: 3;
    }
}

@media (max-width: 1180px) {
    .cloud-phone-view .control-button {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
    }

    .cloud-exit-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 900px), (pointer: coarse) {
    .cloud-phone-view {
        padding: 0;
    }

    .cloud-phone-view .video,
    .cloud-phone-view .video > .video-layer,
    .cloud-phone-view .video > canvas.video-layer,
    .cloud-phone-view .video > video.video-layer {
        max-width: 100vw;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .cloud-phone-view .android-nav-bar {
        width: 40px;
        height: min(196px, calc(100dvh - 112px));
        right: max(8px, env(safe-area-inset-right));
        border-radius: 16px;
        padding: 12px 0;
    }

    .cloud-exit-btn {
        left: max(8px, env(safe-area-inset-left));
    }

    .cloud-phone-view .stream-auto-hud {
        max-width: calc(100vw - 96px);
        font-size: 10px;
    }

}

@media (orientation: portrait) and (max-width: 900px) {
    .cloud-phone-view {
        --android-nav-reserved-space: calc(48px + env(safe-area-inset-bottom, 0px));
        --stream-fit-height: min(
            calc(100dvh - var(--android-nav-reserved-space)),
            calc(100vw / var(--stream-aspect, 1.7778))
        );
        --stream-fit-width: min(
            100vw,
            calc((100dvh - var(--android-nav-reserved-space)) * var(--stream-aspect, 1.7778))
        );
        align-items: flex-start;
    }

    /* portrait mobile: video เว้นที่ nav bar ด้านล่าง */
    .cloud-phone-view .video {
        height: calc(100dvh - var(--android-nav-reserved-space)) !important;
        max-height: calc(100dvh - var(--android-nav-reserved-space)) !important;
        --stream-fit-height: min(
            calc(100dvh - var(--android-nav-reserved-space)),
            calc(100vw / var(--stream-aspect, 1.7778))
        );
        --stream-fit-width: min(
            100vw,
            calc((100dvh - var(--android-nav-reserved-space)) * var(--stream-aspect, 1.7778))
        );
    }

    .cloud-phone-view .native-webrtc-viewer {
        height: calc(100dvh - var(--android-nav-reserved-space)) !important;
        width: var(--stream-fit-width, 100vw) !important;
        max-height: calc(100dvh - var(--android-nav-reserved-space)) !important;
    }

    .cloud-phone-view .video > .video-layer,
    .cloud-phone-view .video > canvas.video-layer,
    .cloud-phone-view .video > video.video-layer {
        width: var(--stream-fit-width) !important;
        height: var(--stream-fit-height) !important;
        max-height: calc(100dvh - var(--android-nav-reserved-space)) !important;
    }

    .cloud-phone-view .touch-layer {
        width: var(--stream-fit-width) !important;
        height: var(--stream-fit-height) !important;
        max-height: calc(100dvh - var(--android-nav-reserved-space)) !important;
    }

    .cloud-phone-view .android-nav-bar {
        bottom: env(safe-area-inset-bottom, 0px);
        left: 50%;
        right: auto;
        top: auto;
        transform: translateX(-50%);
        width: min(200px, calc(100vw - 80px));
        height: 36px;
        flex-direction: row;
        padding: 0 8px;
        border-radius: 999px;
        background: rgba(15, 15, 15, 0.42);
        opacity: 0.42;
    }

    .cloud-phone-view .android-nav-btn {
        width: 54px;
        height: 34px;
        border-radius: 999px;
    }

    .cloud-phone-view .android-nav-btn::before {
        transform: scale(0.62);
    }

    .cloud-phone-view .android-nav-bar:hover,
    .cloud-phone-view .android-nav-bar:focus-within {
        background: rgba(15, 15, 15, 0.52);
        opacity: 0.58;
    }

    .cloud-phone-view .android-nav-btn:hover,
    .cloud-phone-view .android-nav-btn:focus,
    .cloud-phone-view .android-nav-btn:focus-visible,
    .cloud-phone-view .android-nav-btn:active {
        background: transparent;
    }

    .cloud-phone-view .android-nav-btn:nth-child(1) { order: 1; }
    .cloud-phone-view .android-nav-btn:nth-child(2) { order: 2; }
    .cloud-phone-view .android-nav-btn:nth-child(3) { order: 3; }

    .cloud-exit-btn {
        top: max(8px, env(safe-area-inset-top));
        bottom: auto;
        transform: translateY(0);
        width: 30px;
        height: 30px;
    }

    .cloud-phone-view .control-buttons-list {
        top: max(8px, env(safe-area-inset-top));
        right: max(8px, env(safe-area-inset-right));
    }

    .cloud-phone-view .stream-diagnostics {
        bottom: calc(var(--android-nav-reserved-space) + 4px);
    }
}

@media (orientation: landscape) and (max-height: 560px) {
    .cloud-phone-view .android-nav-bar {
        width: 46px;
        height: min(220px, calc(100dvh - 24px));
        right: max(6px, env(safe-area-inset-right));
        padding: 8px 0;
    }

    .cloud-phone-view .android-nav-btn {
        width: 42px;
        height: 58px;
    }

    .cloud-phone-view .android-nav-btn::before {
        transform: scale(0.82);
    }

    .cloud-exit-btn,
    .cloud-phone-view .control-button {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
    }
}

/* ══════════════════════════════════════════════════════════════════
   More Box — Premium Dark-theme Panel
   ══════════════════════════════════════════════════════════════════ */

/* ── Container ──────────────────────────────────────────────────── */
.more-box {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    max-width: calc(100vw - 32px);
    max-height: 85vh;
    border-radius: 14px;
    background: rgba(18, 19, 22, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 24px 64px hsla(0, 0%, 0%, 0.55),
        0 0 0 1px hsla(220, 60%, 60%, 0.06),
        inset 0 1px 0 hsla(220, 60%, 80%, 0.05);
    z-index: 160;
    overflow: hidden;
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    animation: mb-pop-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mb-pop-in {
    from { opacity: 0; transform: translate(-50%, -48%) scale(0.94); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ── Header ─────────────────────────────────────────────────────── */
.more-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0.875rem 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.045);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: grab;
    user-select: none;
    gap: 0.5rem;
    flex-shrink: 0;
}

.more-box-header:active { cursor: grabbing; }

.more-box-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    letter-spacing: 0.01em;
}

.more-box-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    background: hsla(220, 20%, 50%, 0.12);
    color: hsla(220, 10%, 70%, 0.8);
    border-radius: 7px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}
.more-box-close-btn:hover {
    background: hsla(0, 70%, 55%, 0.25);
    color: hsl(0, 80%, 70%);
}

/* ── Scrollable Body ─────────────────────────────────────────────── */
.more-box-body {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(85vh - 52px);
    padding: 0.6rem 0 0.9rem;
    scrollbar-width: thin;
    scrollbar-color: hsla(220, 20%, 50%, 0.3) transparent;
}
.more-box-body::-webkit-scrollbar { width: 4px; }
.more-box-body::-webkit-scrollbar-thumb {
    background: hsla(220, 20%, 50%, 0.3);
    border-radius: 2px;
}

/* ── Sections ────────────────────────────────────────────────────── */
.mb-section {
    padding: 0.62rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.mb-section:last-child { border-bottom: none; }

.mb-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.56);
    margin-bottom: 0.65rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid hsla(220, 20%, 50%, 0.1);
}

.mb-section-icon,
.mb-device-icon,
.mb-action-btn .mb-svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    line-height: 0;
}

.mb-svg-icon {
    display: block;
    flex: 0 0 auto;
}

/* ── Device Button Grid ─────────────────────────────────────────── */
.mb-btn-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.mb-btn-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mb-device-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.6rem 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.055);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    color: rgba(255, 255, 255, 0.9);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.mb-device-btn:hover {
    background: rgba(43, 148, 255, 0.18);
    border-color: rgba(88, 166, 255, 0.45);
}
.mb-device-btn:active {
    transform: scale(0.93);
    background: rgba(43, 148, 255, 0.28);
}

.mb-device-icon {
    color: rgba(160, 207, 255, 0.96);
}
.mb-device-label {
    font-size: 0.64rem;
    color: rgba(255, 255, 255, 0.68);
    text-align: center;
    line-height: 1.2;
}

/* ── Action Buttons ─────────────────────────────────────────────── */
.mb-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.065);
    color: rgba(255, 255, 255, 0.88);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    margin-top: 0.4rem;
}
.mb-action-btn:hover {
    background: rgba(43, 148, 255, 0.18);
    border-color: rgba(88, 166, 255, 0.45);
    color: rgb(181, 219, 255);
}
.mb-action-btn:active { transform: scale(0.97); }

.mb-action-btn--primary {
    background: rgba(43, 148, 255, 0.28);
    border-color: rgba(88, 166, 255, 0.52);
    color: rgb(205, 231, 255);
}
.mb-action-btn--primary:hover {
    background: rgba(43, 148, 255, 0.38);
}

.mb-action-btn--danger {
    background: rgba(214, 64, 69, 0.18);
    border-color: rgba(255, 116, 122, 0.35);
    color: rgb(255, 178, 182);
    width: 100%;
    justify-content: center;
}
.mb-action-btn--danger:hover {
    background: hsla(0, 70%, 45%, 0.4);
    border-color: hsla(0, 80%, 60%, 0.5);
}

.mb-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.mb-hidden-file {
    display: none;
}

.mb-upload-status {
    min-height: 1.6rem;
    margin: 0.35rem 0 0.2rem;
    padding: 0.42rem 0.55rem;
    border: 1px solid rgba(116, 211, 155, 0.22);
    border-radius: 8px;
    background: rgba(82, 196, 127, 0.08);
    color: rgba(196, 245, 214, 0.92);
    font-size: 0.72rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.mb-upload-status.is-error {
    border-color: rgba(255, 116, 122, 0.32);
    background: rgba(214, 64, 69, 0.1);
    color: rgb(255, 190, 194);
}

.mb-import-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.mb-import-row .mb-action-btn {
    margin-top: 0;
}

/* ── Toggle (Checkbox) Rows ─────────────────────────────────────── */
.mb-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0;
}

.mb-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 38px;
    height: 21px;
    background: hsla(220, 20%, 30%, 0.8);
    border: 1px solid hsla(220, 20%, 50%, 0.2);
    border-radius: 100px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}
.mb-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 15px;
    height: 15px;
    background: hsla(220, 10%, 70%, 0.8);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.mb-toggle:checked {
    background: hsla(172, 75%, 35%, 0.9);
    border-color: hsla(172, 75%, 45%, 0.5);
}
.mb-toggle:checked::after {
    transform: translateX(17px);
    background: white;
}

.mb-toggle-label {
    font-size: 0.8rem;
    color: hsla(220, 10%, 80%, 0.85);
    cursor: pointer;
    user-select: none;
}

/* ── Textarea ────────────────────────────────────────────────────── */
.mb-textarea {
    width: 100%;
    min-height: 64px;
    max-height: 120px;
    resize: vertical;
    background: hsla(222, 25%, 10%, 0.8);
    border: 1px solid hsla(220, 20%, 50%, 0.18);
    border-radius: 10px;
    color: hsla(220, 10%, 88%, 0.9);
    font-size: 0.82rem;
    padding: 0.5rem 0.65rem;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
    margin-top: 0.35rem;
}
.mb-textarea:focus {
    outline: none;
    border-color: hsla(218, 70%, 60%, 0.45);
}
.mb-textarea::placeholder { color: hsla(220, 10%, 55%, 0.6); }

/* ── Field Grid (Video Settings) ─────────────────────────────────── */
.mb-field-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.mb-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.mb-field-label {
    font-size: 0.75rem;
    color: hsla(220, 10%, 65%, 0.8);
    flex: 1;
    min-width: 0;
}

.mb-field-input {
    width: 110px;
    flex-shrink: 0;
    padding: 0.3rem 0.5rem;
    background: hsla(222, 25%, 10%, 0.8);
    border: 1px solid hsla(220, 20%, 50%, 0.18);
    border-radius: 8px;
    color: hsla(220, 10%, 88%, 0.9);
    font-size: 0.8rem;
    font-family: 'Inter', monospace;
    text-align: right;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.mb-field-input:focus {
    outline: none;
    border-color: hsla(218, 70%, 60%, 0.45);
}
.mb-field-input::-webkit-inner-spin-button { opacity: 0.5; }

/* ── Danger Section ─────────────────────────────────────────────── */
.mb-section--danger {
    padding-top: 0.75rem;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 400px) {
    .more-box { width: calc(100vw - 24px); }
    .mb-btn-grid { grid-template-columns: repeat(3, 1fr); gap: 0.3rem; }
}

:root {
    --block-top-padding: 0.5rem;
    --block-bottom-padding: 0.5rem;
    --button-top-padding: 0.2rem;
    --button-bottom-padding: 0.2rem;
    --header-height: 3rem;
    --footer-height: 1.55rem;
}

.dialog-background {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 3;
}

.dialog-container {
    font-family: monospace;
    width: 75%;
    max-width: 30rem;
    min-width: 20rem;
    background-color: var(--main-bg-color);
    /*border-radius: 0.3rem;*/
    overflow: hidden;
}

.dialog-container.ready {
    height: 100%;
    min-height: 100%;
}

.dialog-container button,
.dialog-container select,
.dialog-container input {
    font-family: monospace;
}

.dialog-container button {
    font-size: var(--font-size);
}

.dialog-container select {
    text-overflow: ellipsis;
}

.dialog-block {}

.dialog-header {
    background-color: var(--header-bg-color);
    height: var(--header-height);
    overflow: hidden;
    display: flex;
    align-items: center;
    width: auto;
    position: initial;
}

.dialog-header span.dialog-title {
    display: inline-block;
    padding: 0 0.5rem;
}

.dialog-body {
    padding: var(--block-top-padding) 0.5rem var(--block-bottom-padding);
    background-color: var(--control-buttons-bg-color);
    overflow: auto;
}

.dialog-body.hidden {
    height: 0;
    padding: 0;
}

.dialog-body.visible {
    height: calc(100% - 2 * var(--block-top-padding) - 2 * var(--block-bottom-padding) - var(--header-height) - var(--footer-height));
}

.dialog-footer {
    /*display: flex;*/
    /*flex-direction: row-reverse;*/
    padding: var(--block-top-padding) 0.5rem var(--block-bottom-padding);
    background-color: var(--stream-bg-color);
    height: var(--footer-height);
    overflow: hidden;
}

.dialog-footer span.subtitle {
    font-weight: lighter;
    line-height: var(--footer-height);
    float: left;
}

.dialog-footer button {
    padding: var(--button-top-padding) 0.5rem var(--button-bottom-padding);
    margin: 0 0 0 0.5rem;
    border-radius: 0.3rem;
    /*background-color: var(--main-bg-color);*/
    color: var(--button-text-color);
    border: 1px solid var(--button-border-color);
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0);
    height: var(--footer-height);
    float: right;
}

.dialog-footer button:disabled {
    cursor: not-allowed;
    color: var(--text-color-light);
}

.controls .label {
    grid-column: labels;
}

.controls .input {
    grid-column: controls;
    box-sizing: border-box;
    margin: 0;
    /*height: 2.75ex;*/
}

.controls .button {
    grid-column: controls;
}

.controls {
    display: grid;
    grid-template-columns: [labels] 35% [controls] 65%;
    padding: 1rem;
    grid-gap: 0.2rem;
    align-items: center;
}
:root {
    --device-page-bg: #eef2f6;
    --device-panel-bg: rgba(255, 255, 255, 0.86);
    --device-panel-strong: #ffffff;
    --device-line: rgba(15, 23, 42, 0.1);
    --device-muted: #64748b;
    --device-strong: #111827;
    --device-accent: #0f766e;
    --device-accent-strong: #0d9488;
    --device-danger: #ef4444;
    --device-shadow: 0 18px 52px rgba(15, 23, 42, 0.12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --device-page-bg: #101418;
        --device-panel-bg: rgba(20, 24, 31, 0.9);
        --device-panel-strong: #171c24;
        --device-line: rgba(226, 232, 240, 0.1);
        --device-muted: #94a3b8;
        --device-strong: #f8fafc;
        --device-accent: #2dd4bf;
        --device-accent-strong: #5eead4;
        --device-danger: #fb7185;
        --device-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
    }
}

body.list {
    min-height: 100vh;
    width: auto;
    overflow: auto;
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.16), transparent 32rem),
        linear-gradient(135deg, var(--device-page-bg), var(--main-bg-color));
}

#devices {
    width: min(1180px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 0 44px;
    overflow: visible;
}

body.stream #devices {
    background-color: var(--device-list-default-color);
    opacity: .8;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

body.list #device_list_menu {
    display: none;
}

#device_list_menu {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 4;
}

.device-list-hero {
    min-height: 132px;
    padding: 24px;
    border: 1px solid var(--device-line);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--device-panel-bg);
    box-shadow: var(--device-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.device-list-kicker {
    margin-bottom: 8px;
    color: var(--device-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.device-list-hero h1 {
    margin: 0;
    color: var(--device-strong);
    font-size: 34px;
    line-height: 1.06;
    font-weight: 800;
}

.device-list-hero p {
    max-width: 580px;
    margin: 10px 0 0;
    color: var(--device-muted);
    font-size: 15px;
    line-height: 1.6;
}

.device-list-side {
    min-width: 160px;
    display: grid;
    gap: 10px;
    justify-items: stretch;
}

.device-health-link {
    min-height: 38px;
    border: 1px solid color-mix(in srgb, var(--device-accent) 42%, var(--device-line));
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: color-mix(in srgb, var(--device-accent) 10%, var(--device-panel-strong));
    color: var(--device-accent);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
}

.device-health-link:hover {
    border-color: var(--device-accent);
    background: color-mix(in srgb, var(--device-accent) 16%, var(--device-panel-strong));
    color: var(--device-accent-strong);
}

.device-health-link svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
}

.device-list-summary {
    min-width: 132px;
    padding: 18px;
    border: 1px solid var(--device-line);
    border-radius: 8px;
    display: grid;
    justify-items: center;
    background: var(--device-panel-strong);
}

.device-list-summary span {
    color: var(--device-accent);
    font-size: 38px;
    line-height: 1;
    font-weight: 900;
}

.device-list-summary small {
    margin-top: 6px;
    color: var(--device-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.device-empty-state {
    margin-top: 18px;
    padding: 24px;
    border: 1px dashed var(--device-line);
    border-radius: 8px;
    display: grid;
    gap: 7px;
    background: rgba(255, 255, 255, 0.42);
    color: var(--device-muted);
    text-align: center;
}

.device-empty-state strong {
    color: var(--device-strong);
    font-size: 16px;
}

.adb-connect-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--device-line);
    border-radius: 8px;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(130px, 180px) minmax(220px, 1.3fr) auto;
    align-items: end;
    gap: 12px;
    background: var(--device-panel-bg);
    box-shadow: 0 10px 34px rgba(15, 23, 42, 0.08);
}

.adb-connect-copy {
    display: grid;
    gap: 4px;
}

.adb-connect-copy strong {
    color: var(--device-strong);
    font-size: 14px;
    font-weight: 800;
}

.adb-connect-copy span,
.adb-connect-status {
    color: var(--device-muted);
    font-size: 12px;
    line-height: 1.35;
}

.adb-connect-panel label {
    display: grid;
    gap: 6px;
    color: var(--device-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.adb-connect-panel input {
    width: 100%;
    height: 36px;
    box-sizing: border-box;
    border: 1px solid var(--device-line);
    border-radius: 8px;
    padding: 0 11px;
    background: var(--device-panel-strong);
    color: var(--device-strong);
    font: 700 13px/1 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    outline: none;
}

.adb-connect-panel input:focus {
    border-color: color-mix(in srgb, var(--device-accent) 62%, var(--device-line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--device-accent) 14%, transparent);
}

.adb-connect-panel button {
    height: 36px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--device-accent);
    color: #fff;
    font: 800 12px/1 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    cursor: pointer;
}

.adb-connect-panel button:hover {
    background: var(--device-accent-strong);
}

.adb-connect-panel button:disabled {
    cursor: wait;
    opacity: 0.58;
}

.adb-connect-status {
    grid-column: 1 / -1;
}

#devices .device-list {
    position: relative;
    width: 100%;
    margin-top: 18px;
    display: grid;
    gap: 16px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--font-size);
}

#devices .tracker-name {
    margin: 0 0 10px;
    padding: 0 4px;
    color: var(--device-muted);
    font-size: 13px;
    font-weight: 700;
}

#devices .device-list div.device {
    position: relative;
    padding: 18px;
    border: 1px solid var(--device-line);
    border-radius: 8px;
    background: var(--device-panel-bg);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

#devices .device-list div.device:hover {
    border-color: rgba(13, 148, 136, 0.35);
    box-shadow: var(--device-shadow);
    transform: translateY(-1px);
}

#devices .device-header {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 10px 14px;
}

#devices .device-header div {
    min-width: 0;
}

#devices .device-name {
    color: var(--device-strong);
    font-size: 18px;
    line-height: 1.25;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#devices .device-serial {
    grid-column: 1 / 2;
    color: var(--device-muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#devices .device-info-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#devices .device-active-app {
    width: fit-content;
    max-width: 100%;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid var(--device-line);
    border-radius: 7px;
    display: inline-grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 7px;
    align-items: center;
    background: var(--device-panel-strong);
}

#devices .device-active-app.has-app {
    border-color: rgba(13, 148, 136, 0.28);
    background: rgba(13, 148, 136, 0.08);
}

#devices .active-app-label {
    color: var(--device-accent);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#devices .active-app-name {
    min-width: 0;
    color: var(--device-strong);
    font-size: 12px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#devices .active-app-package {
    grid-column: 1 / -1;
    max-width: 260px;
    color: var(--device-muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#devices .device-version {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    color: var(--device-muted);
    font-size: 11px;
    font-weight: 600;
}

#devices .device-version .release-version,
#devices .device-version .sdk-version {
    min-width: auto;
    padding: 2px 8px;
    border: 1px solid var(--device-line);
    border-radius: 4px;
    background: var(--device-panel-strong);
    white-space: nowrap;
}

#devices .device-metrics {
    display: inline-flex;
    align-items: stretch;
    gap: 6px;
}

#devices .device-metric {
    min-width: 72px;
    padding: 8px 10px;
    border: 1px solid var(--device-line);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--device-panel-strong);
    transition: all 0.2s ease;
}

#devices .device-metric.good .metric-value {
    color: var(--device-accent);
}

#devices .device-metric.warn .metric-value {
    color: #b45309;
}

#devices .device-metric.bad .metric-value {
    color: var(--device-danger);
}

#devices .metric-label {
    color: var(--device-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

#devices .metric-value {
    color: var(--device-strong);
    font-size: 14px;
    line-height: 1.2;
    font-weight: 900;
}

#devices .metric-detail {
    color: var(--device-muted);
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
    opacity: 0.8;
}

#devices .device-metric.good {
    border-color: rgba(13, 148, 136, 0.28);
    background: rgba(13, 148, 136, 0.08);
}

#devices .device-metric.warn {
    border-color: rgba(245, 158, 11, 0.32);
    background: rgba(245, 158, 11, 0.1);
}

#devices .device-metric.bad {
    border-color: rgba(239, 68, 68, 0.34);
    background: rgba(239, 68, 68, 0.1);
}

#devices .device-metric.unknown {
    opacity: 0.72;
}

#devices .device-state {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background-color: var(--device-danger);
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.12);
}

#devices .device.active .device-state {
    background-color: var(--device-accent);
    box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.16);
}

#devices .services {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

#devices .device-list div.desc-block {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
}

#devices .device-list div.desc-block.hidden {
    display: none !important;
}

#devices .device-list div.desc-block.stream,
#devices .device-list div.desc-block.server_pid,
#devices .device-list div.desc-block.net_interface {
    border: 1px solid var(--device-line);
    border-radius: 8px;
    overflow: hidden;
    white-space: nowrap;
    background: var(--device-panel-strong);
}

#devices .device-list div.desc-block.stream a,
#devices .device-list div.desc-block.stream button,
#devices .device-list div.desc-block a.link-stream {
    min-height: 38px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: var(--device-accent);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

#devices .device-list div.desc-block.stream a:hover,
#devices .device-list div.desc-block.stream button:hover,
#devices .device-list div.desc-block a.link-stream:hover {
    background: var(--device-accent-strong);
    color: #ffffff;
}

#devices .device-list div.device select {
    height: 38px;
    min-width: 172px;
    padding: 0 34px 0 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background-color: transparent;
    color: var(--device-strong);
    font: inherit;
    font-weight: 700;
}

#devices .device-list div.desc-block button {
    height: 38px;
    min-width: 38px;
    border: 0;
    border-right: 1px solid var(--device-line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: transparent;
    color: var(--device-muted);
    fill: currentColor;
}

#devices .device-list div.desc-block button > span {
    padding: 0 10px 0 0;
    font-weight: 800;
}

#devices .device-list div.desc-block button > svg {
    width: 16px;
    height: 16px;
}

#devices .device-list div.desc-block button > svg > path {
    fill: currentColor;
}

#devices .device-list div.device div.desc-block .action-button.active {
    cursor: pointer;
}

#devices .device-list .device.active div.desc-block .action-button:hover {
    color: var(--device-danger);
}

#devices .device-list .device.not-active {
    opacity: 0.66;
}

#devices .device-list .device.not-active a {
    background: transparent;
    color: var(--device-muted);
    border: 1px solid var(--device-line);
}

#devices .device-list .device.not-active select,
#devices .device-list .device.not-active button {
    color: var(--text-color-light);
}

@media (max-width: 760px) {
    #devices {
        width: min(100% - 20px, 1180px);
        padding: 10px 0 28px;
    }

    .device-list-hero {
        min-height: auto;
        padding: 18px;
        align-items: stretch;
        flex-direction: column;
    }

    .device-list-hero h1 {
        font-size: 28px;
    }

    .device-list-side {
        min-width: 0;
    }

    .device-health-link {
        justify-content: center;
    }

    .device-list-summary {
        min-width: 0;
        grid-template-columns: auto 1fr;
        justify-items: start;
        align-items: end;
        gap: 10px;
    }

    .device-list-summary small {
        margin-top: 0;
        padding-bottom: 4px;
    }

    .adb-connect-panel {
        grid-template-columns: 1fr;
    }

    #devices .device-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    #devices .device-version,
    #devices .device-metrics {
        grid-column: 1 / -1;
    }

    #devices .device-metrics {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    #devices .device-metric {
        min-width: 0;
    }

    #devices .services,
    #devices .device-list div.desc-block,
    #devices .device-list div.desc-block.stream,
    #devices .device-list div.desc-block.net_interface,
    #devices .device-list div.desc-block.server_pid,
    #devices .device-list div.desc-block.stream a,
    #devices .device-list div.desc-block a.link-stream,
    #devices .device-list div.device select {
        width: 100%;
    }

    #devices .device-list div.desc-block a.link-stream {
        box-sizing: border-box;
    }
}

@media (max-width: 460px) {
    #devices .device-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */

/**
 *  Default styles for xterm.js
 */

.xterm {
    cursor: text;
    position: relative;
    user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

.xterm.focus,
.xterm:focus {
    outline: none;
}

.xterm .xterm-helpers {
    position: absolute;
    top: 0;
    /**
     * The z-index of the helpers must be higher than the canvases in order for
     * IMEs to appear on top.
     */
    z-index: 5;
}

.xterm .xterm-helper-textarea {
    padding: 0;
    border: 0;
    margin: 0;
    /* Move textarea out of the screen to the far left, so that the cursor is not visible */
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    width: 0;
    height: 0;
    z-index: -5;
    /** Prevent wrapping so the IME appears against the textarea at the correct position */
    white-space: nowrap;
    overflow: hidden;
    resize: none;
}

.xterm .composition-view {
    /* TODO: Composition position got messed up somewhere */
    background: #000;
    color: #FFF;
    display: none;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}

.xterm .composition-view.active {
    display: block;
}

.xterm .xterm-viewport {
    /* On OS X this is required in order for the scroll bar to appear fully opaque */
    background-color: #000;
    overflow-y: scroll;
    cursor: default;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
}

.xterm .xterm-screen {
    position: relative;
}

.xterm .xterm-screen canvas {
    position: absolute;
    left: 0;
    top: 0;
}

.xterm .xterm-scroll-area {
    visibility: hidden;
}

.xterm-char-measure-element {
    display: inline-block;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: -9999em;
    line-height: normal;
}

.xterm.enable-mouse-events {
    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
    cursor: default;
}

.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
    cursor: pointer;
}

.xterm.column-select.focus {
    /* Column selection mode */
    cursor: crosshair;
}

.xterm .xterm-accessibility,
.xterm .xterm-message {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: transparent;
}

.xterm .live-region {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.xterm-dim {
    opacity: 0.5;
}

.xterm-underline {
    text-decoration: underline;
}

.xterm-strikethrough {
    text-decoration: line-through;
}

.xterm-screen .xterm-decoration-container .xterm-decoration {
	z-index: 6;
	position: absolute;
}

.xterm-decoration-overview-ruler {
    z-index: 7;
    position: absolute;
    top: 0;
    right: 0;
    pointer-events: none;
}

.xterm-decoration-top {
    z-index: 2;
    position: relative;
}


body.devtools {
    font-family: Ubuntu, Arial, sans-serif;
    font-size: 13px;
}

body.devtools .device {
    padding: 20px;
}

body.devtools .device-header {
    -webkit-box-align: baseline;
    -webkit-box-orient: horizontal;
    display: -webkit-box;
    margin: 10px 0 0;
    padding: 2px 0;
}

body.devtools .device-name {
    font-size: 150%;
}

body.devtools .device-serial {
    color: var(--url-color);
    font-size: 80%;
    margin-left: 6px;
}

body.devtools .browser-header {
    align-items: center;
    display: flex;
    flex-flow: row wrap;
    min-height: 33px;
    padding-top: 10px;
}

body.devtools .browser-header > .browser-name {
    font-size: 110%;
    font-weight: bold;
}

body.devtools div.list {
    margin-top: 5px;
}

body.devtools div.list > .row {
    padding: 6px 0;
    position: relative;
}

body.devtools .properties-box {
    display: flex;
}

body.devtools .properties-box > img {
    flex-shrink: 0;
    height: 23px;
    padding-left: 2px;
    padding-right: 5px;
    vertical-align: top;
    width: 23px;
}

body.devtools .subrow-box {
    display: inline-block;
    vertical-align: top;
}

body.devtools .subrow {
    display: flex;
    flex-flow: row wrap;
}

body.devtools .subrow > div {
    margin-right: 0.5em;
}

.body.devtools url {
    color: var(--url-color);
    max-width: 200px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

body.devtools .action {
    color: var(--link-color);
    cursor: pointer;
    margin-right: 15px;
}

body.devtools .action.disabled {
    color: var(--url-color);
    cursor: not-allowed;
}

body.devtools a.action {
    text-decoration: none;
}

body.devtools a.action.copy {
    cursor: copy;
}

body.devtools .browser-header .action {
    margin-left: 10px;
}

body.devtools .open > input {
    border: 1px solid #aaa;
    height: 17px;
    line-height: 17px;
    margin-left: 20px;
    padding: 0 2px;
}

body.devtools .tooltip {
    z-index: 1;
    position: absolute;
    padding: 2px;
    color: var(--controls-bg-color);
    background-color: var(--text-color);
}

body.file-listing {
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.file-listing h1 {
    border-bottom: 1px solid var(--button-border-color);
    margin-bottom: 10px;
    padding-bottom: 10px;
    white-space: nowrap;
}

.file-listing tr:hover {
    background-color: var(--controls-bg-color);
}

.file-listing .quick-link-box {
    display: inline-block;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.file-listing .quick-link-box.hidden {
    display: none;
}

.file-listing a.icon {
    -webkit-padding-start: 1.5em;
    -moz-padding-start: 1.5em;
    text-decoration: none;
    user-select: auto;
}

.file-listing a.icon:hover {
    text-decoration: underline;
}

.file-listing a.link {
    background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAACAElEQVQ4y4WSzUsVYRjFf897RwUz+wK7LiSIyKCoyEUXDFzcqYhq0R+R4J/gMqilf0VC7VwUuBUxobJumyLTvjDIG0TcO96J7sw8T4t3Rp0kfDYH3o/DOc85Qj4LCwvGPpOmKfPz88zMzEhxFux+cGV8HARE/H2BqopzjpWVV4RhSPNH02YfzkqJwMwwDDHxKIKZR+ccAEmSMDExQZZldLY6Njc3J64gUNVtEswTFsTFdDodFhcXCYKAqakp9ijAjOK5AJbbKJSEYZ3N75t0u10+rK2VCVSVX+0elpfe8mxpHTCvCgM1btw8S71+hupwFYD3q6sAlCw4gXp4jno4ShA4nJNclf43mW0FWZbhHLTbHVZefgUxkiQlTf+QqZKmqd9NvuAsy/ZaqFSMx4+W2fjW5HccY5bgKg7BSNNunpLfjarutfCm8ZEXz9+xFbVRSxg8dIDr1y7m3Sii9lgQBLtb1ni9TqUiiBh9vT1MT9/hePUw/f29iI/KJ4N4S//GqKpUnJd4dzJkaGgQy5Rbt8fY2Pi50wnZ6ce2hVarxfkLJzDg6JEBxi6dBDNEfD9GRo5hlqswo9VqlQmiKKJWO83l2ilU1W9ZduIy9R+LwkVRVLYQxzFOYHLyKp8/NWk0vjA6OszAwT7MBFXfiaKjcRyXCaIo4v6De6WSPHnKvvMXLQgqHcJs3fIAAAAASUVORK5CYII=) left top no-repeat;
}
.file-listing a.file {
    background : url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMAAAAAAABupgeRAAABHUlEQVR42o2RMW7DIBiF3498iHRJD5JKHurL+CRVBp+i2T16tTynF2gO0KSb5ZrBBl4HHDBuK/WXACH4eO9/CAAAbdvijzLGNE1TVZXfZuHg6XCAQESAZXbOKaXO57eiKG6ft9PrKQIkCQqFoIiQFBGlFIB5nvM8t9aOX2Nd18oDzjnPgCDpn/BH4zh2XZdlWVmWiUK4IgCBoFMUz9eP6zRN75cLgEQhcmTQIbl72O0f9865qLAAsURAAgKBJKEtgLXWvyjLuFsThCSstb8rBCaAQhDYWgIZ7myM+TUBjDHrHlZcbMYYk34cN0YSLcgS+wL0fe9TXDMbY33fR2AYBvyQ8L0Gk8MwREBrTfKe4TpTzwhArXWi8HI84h/1DfwI5mhxJamFAAAAAElFTkSuQmCC) left top no-repeat;
}

.file-listing a.dir {
    background : url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAd5JREFUeNqMU79rFUEQ/vbuodFEEkzAImBpkUabFP4ldpaJhZXYm/RiZWsv/hkWFglBUyTIgyAIIfgIRjHv3r39MePM7N3LcbxAFvZ2b2bn22/mm3XMjF+HL3YW7q28YSIw8mBKoBihhhgCsoORot9d3/ywg3YowMXwNde/PzGnk2vn6PitrT+/PGeNaecg4+qNY3D43vy16A5wDDd4Aqg/ngmrjl/GoN0U5V1QquHQG3q+TPDVhVwyBffcmQGJmSVfyZk7R3SngI4JKfwDJ2+05zIg8gbiereTZRHhJ5KCMOwDFLjhoBTn2g0ghagfKeIYJDPFyibJVBtTREwq60SpYvh5++PpwatHsxSm9QRLSQpEVSd7/TYJUb49TX7gztpjjEffnoVw66+Ytovs14Yp7HaKmUXeX9rKUoMoLNW3srqI5fWn8JejrVkK0QcrkFLOgS39yoKUQe292WJ1guUHG8K2o8K00oO1BTvXoW4yasclUTgZYJY9aFNfAThX5CZRmczAV52oAPoupHhWRIUUAOoyUIlYVaAa/VbLbyiZUiyFbjQFNwiZQSGl4IDy9sO5Wrty0QLKhdZPxmgGcDo8ejn+c/6eiK9poz15Kw7Dr/vN/z6W7q++091/AQYA5mZ8GYJ9K0AAAAAASUVORK5CYII=) left top no-repeat;
}

.file-listing a.up {
    background : url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNpsU0toU0EUPfPysx/tTxuDH9SCWhUDooIbd7oRUUTMouqi2iIoCO6lceHWhegy4EJFinWjrlQUpVm0IIoFpVDEIthm0dpikpf3ZuZ6Z94nrXhhMjM3c8895977BBHB2PznK8WPtDgyWH5q77cPH8PpdXuhpQT4ifR9u5sfJb1bmw6VivahATDrxcRZ2njfoaMv+2j7mLDn93MPiNRMvGbL18L9IpF8h9/TN+EYkMffSiOXJ5+hkD+PdqcLpICWHOHc2CC+LEyA/K+cKQMnlQHJX8wqYG3MAJy88Wa4OLDvEqAEOpJd0LxHIMdHBziowSwVlF8D6QaicK01krw/JynwcKoEwZczewroTvZirlKJs5CqQ5CG8pb57FnJUA0LYCXMX5fibd+p8LWDDemcPZbzQyjvH+Ki1TlIciElA7ghwLKV4kRZstt2sANWRjYTAGzuP2hXZFpJ/GsxgGJ0ox1aoFWsDXyyxqCs26+ydmagFN/rRjymJ1898bzGzmQE0HCZpmk5A0RFIv8Pn0WYPsiu6t/Rsj6PauVTwffTSzGAGZhUG2F06hEc9ibS7OPMNp6ErYFlKavo7MkhmTqCxZ/jwzGA9Hx82H2BZSw1NTN9Gx8ycHkajU/7M+jInsDC7DiaEmo1bNl1AMr9ASFgqVu9MCTIzoGUimXVAnnaN0PdBBDCCYbEtMk6wkpQwIG0sn0PQIUF4GsTwLSIFKNqF6DVrQq+IWVrQDxAYQC/1SsYOI4pOxKZrfifiUSbDUisif7XlpGIPufXd/uvdvZm760M0no1FZcnrzUdjw7au3vu/BVgAFLXeuTxhTXVAAAAAElFTkSuQmCC) left top no-repeat;
}

.file-listing a.push {
    color: var(--text-color);
}

.file-listing .listing {
    margin: 8px;
}

.file-listing .foreground {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    z-index: 1000;
    background-color: var(--controls-bg-color);
}

.file-listing .foreground-message {
    flex: auto;
    font-size: 30px;
    color: #999;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px;
    pointer-events: none;
}

.file-listing .foreground-message.drop-target-message {
    border: 4px dashed #ddd;
}

.file-listing .entry-name {
    position: relative;
}

.file-listing .background-progress {
    position: absolute;
    left: 0;
    top: 0;
    background-color: var(--progress-background-color);
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    border-spacing: 0;
}

.file-listing .background-progress.error {
    background-color: var(--progress-background-error-color);
}

