:root {
    --pp-bg: #07111f;
    --pp-panel: rgba(15, 28, 49, .78);
    --pp-panel-strong: rgba(21, 39, 66, .94);
    --pp-border: rgba(127, 211, 255, .20);
    --pp-border-hot: rgba(61, 226, 198, .42);
    --pp-text: #eef7ff;
    --pp-muted: #9fb5ca;
    --pp-cyan: #42d9ff;
    --pp-mint: #32e6b0;
    --pp-blue: #2f6bff;
    --pp-amber: #f4c362;
    --pp-red: #ff5d6c;
    --pp-shadow: 0 28px 80px rgba(0, 0, 0, .34);
}

html,
body.pp-web {
    min-height: 100%;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 18% 12%, rgba(47, 107, 255, .25), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(50, 230, 176, .18), transparent 30%),
        radial-gradient(circle at 62% 88%, rgba(244, 195, 98, .08), transparent 26%),
        linear-gradient(135deg, #07111f 0%, #0b1629 44%, #061018 100%);
    color: var(--pp-text);
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    letter-spacing: 0;
}

body.pp-web::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(66, 217, 255, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(66, 217, 255, .055) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .82), transparent);
}

#ppParticleCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    opacity: .88;
}

.pp-login-shell,
#login-form-container,
#main-window,
.debug-stuff,
.pp-footer {
    position: relative;
    z-index: 1;
}

.pp-disclaimer-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background:
        radial-gradient(circle at 50% 30%, rgba(66, 217, 255, .18), transparent 32%),
        rgba(3, 8, 18, .84);
    backdrop-filter: blur(18px);
}

.pp-disclaimer-overlay.pp-hidden {
    display: none;
}

.pp-disclaimer-card {
    width: min(720px, 100%);
    padding: 28px;
    border-radius: 8px;
    border: 1px solid rgba(127, 211, 255, .22);
    background:
        linear-gradient(145deg, rgba(21, 39, 66, .98), rgba(8, 18, 33, .98)),
        var(--pp-panel-strong);
    box-shadow: 0 36px 100px rgba(0, 0, 0, .54);
}

.pp-disclaimer-card h2 {
    margin: 0 0 14px;
    font-size: 34px;
    font-weight: 800;
}

.pp-disclaimer-card p {
    margin: 0;
    color: var(--pp-muted);
    line-height: 1.8;
}

.pp-disclaimer-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 8px;
    border: 1px solid rgba(66, 217, 255, .30);
    color: var(--pp-mint);
    background:
        radial-gradient(circle at 35% 20%, rgba(50, 230, 176, .28), transparent 55%),
        rgba(66, 217, 255, .10);
}

.pp-disclaimer-icon svg,
.pp-inline-icon svg,
.pp-field-icon svg,
.pp-brand-mark svg,
.pp-hero-status svg,
.pp-list-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pp-disclaimer-icon svg {
    width: 32px;
    height: 32px;
}

.pp-disclaimer-list {
    display: grid;
    gap: 12px;
    margin: 22px 0;
}

.pp-disclaimer-list > div {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(127, 211, 255, .14);
    background: rgba(255, 255, 255, .045);
    color: #d9eaff;
    line-height: 1.6;
}

.pp-list-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--pp-cyan);
    background: rgba(66, 217, 255, .10);
}

.pp-confirm-action {
    width: 100%;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--pp-blue), var(--pp-cyan));
    font-size: 17px;
    font-weight: 800;
    box-shadow: 0 18px 42px rgba(47, 107, 255, .34);
}

.pp-confirm-action:hover {
    filter: brightness(1.05);
}

body.pp-disclaimer-locked #login-form,
body.pp-disclaimer-locked #main-window {
    pointer-events: none;
    user-select: none;
    filter: saturate(.7);
}

#login-form-container {
    min-height: calc(100vh - 42px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 22px;
    overflow: hidden;
}

.pp-login-grid {
    width: min(1160px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .72fr);
    gap: 22px;
    align-items: stretch;
}

.pp-hero,
.pp-login-panel,
.pp-control-rail,
.pp-screen-stage,
.pp-debug-panel {
    border: 1px solid var(--pp-border);
    background: var(--pp-panel);
    box-shadow: var(--pp-shadow);
    backdrop-filter: blur(20px);
}

.pp-hero {
    position: relative;
    min-height: 560px;
    border-radius: 8px;
    padding: 34px;
    overflow: hidden;
}

.pp-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(66, 217, 255, .12), transparent 36%),
        linear-gradient(315deg, rgba(50, 230, 176, .16), transparent 34%);
    pointer-events: none;
}

.pp-brand-row,
.pp-hero-status,
.pp-endpoint-strip,
.pp-panel-header,
.pp-field,
.pp-primary-action,
.pp-policy-note {
    position: relative;
    z-index: 2;
}

.pp-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #dff8ff;
    font-weight: 700;
}

.pp-brand-mark {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--pp-cyan);
    background: rgba(66, 217, 255, .12);
    border: 1px solid rgba(66, 217, 255, .26);
}

.pp-brand-name {
    font-size: 18px;
}

.pp-hero-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.pp-hero-status span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    color: #d9fff4;
    background: rgba(50, 230, 176, .10);
    border: 1px solid rgba(50, 230, 176, .18);
    font-size: 13px;
    font-weight: 700;
}

.pp-hero-status svg {
    width: 17px;
    height: 17px;
    color: var(--pp-mint);
}

.pp-hero h1 {
    position: relative;
    z-index: 2;
    margin: 70px 0 18px;
    max-width: 620px;
    font-size: clamp(36px, 5vw, 66px);
    line-height: 1.04;
    font-weight: 800;
}

.pp-hero-copy {
    position: relative;
    z-index: 2;
    max-width: 560px;
    color: var(--pp-muted);
    font-size: 18px;
    line-height: 1.8;
}

.pp-login-panel {
    border-radius: 8px;
    padding: 32px;
    background: var(--pp-panel-strong);
}

.pp-panel-header {
    margin-bottom: 30px;
}

.pp-mini-kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--pp-cyan);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.pp-panel-header h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
}

.pp-field {
    margin-bottom: 18px;
}

.pp-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d7ecff;
    font-size: 15px;
    font-weight: 700;
}

.pp-field-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--pp-cyan);
    background: rgba(66, 217, 255, .09);
}

.pp-field-icon svg {
    width: 17px;
    height: 17px;
}

.pp-field .form-control,
.pp-chat-form .form-control {
    min-height: 56px;
    border-radius: 8px;
    border: 1px solid rgba(127, 211, 255, .18);
    background: rgba(4, 13, 27, .72);
    color: var(--pp-text);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02);
}

.pp-field .form-control:focus,
.pp-chat-form .form-control:focus {
    border-color: var(--pp-border-hot);
    box-shadow: 0 0 0 3px rgba(50, 230, 176, .14);
    background: rgba(6, 20, 38, .9);
    color: var(--pp-text);
}

.pp-field .form-control::placeholder,
.pp-chat-form .form-control::placeholder {
    color: rgba(159, 181, 202, .65);
}

.pp-primary-action,
.btn.pp-primary-action {
    width: 100%;
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--pp-blue), var(--pp-cyan));
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 18px 42px rgba(47, 107, 255, .34);
}

.pp-primary-action:hover {
    filter: brightness(1.05);
}

.pp-download-action {
    width: 100%;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    border: 1px solid rgba(50, 230, 176, .26);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(50, 230, 176, .16), rgba(66, 217, 255, .10)),
        rgba(255, 255, 255, .045);
    color: #dffff7;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
}

.pp-download-action:hover {
    color: #fff;
    text-decoration: none;
    border-color: rgba(50, 230, 176, .48);
    background:
        linear-gradient(135deg, rgba(50, 230, 176, .24), rgba(66, 217, 255, .16)),
        rgba(255, 255, 255, .07);
}

.pp-primary-action:disabled {
    cursor: not-allowed;
    opacity: .62;
    filter: grayscale(.15);
}

.pp-inline-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pp-inline-icon svg {
    width: 22px;
    height: 22px;
}

.pp-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .34);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ppSpin .85s linear infinite;
}

.pp-policy-note {
    margin: 18px 0 0;
    color: var(--pp-muted);
    line-height: 1.7;
    font-size: 13px;
}

.pp-signal-map {
    position: absolute;
    right: 30px;
    bottom: 112px;
    width: min(440px, 70%);
    height: 220px;
    opacity: .9;
}

.pp-node {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--pp-cyan);
    box-shadow: 0 0 22px rgba(66, 217, 255, .8);
    animation: ppPulse 2.4s ease-in-out infinite;
}

.pp-node-a { left: 12%; top: 18%; }
.pp-node-b { left: 48%; top: 42%; animation-delay: .4s; background: var(--pp-mint); }
.pp-node-c { right: 12%; top: 16%; animation-delay: .8s; }
.pp-node-d { right: 22%; bottom: 15%; animation-delay: 1.2s; background: var(--pp-mint); }

.pp-link {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(66, 217, 255, .72), transparent);
    transform-origin: left center;
}

.pp-link-a {
    width: 280px;
    left: 16%;
    top: 30%;
    transform: rotate(18deg);
}

.pp-link-b {
    width: 240px;
    left: 50%;
    top: 50%;
    transform: rotate(-24deg);
}

.pp-endpoint-strip {
    position: absolute;
    left: 34px;
    right: 34px;
    bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-radius: 8px;
    border: 1px solid rgba(127, 211, 255, .18);
    background: rgba(4, 13, 27, .56);
}

.pp-strip-label {
    display: block;
    margin-bottom: 4px;
    color: var(--pp-muted);
    font-size: 12px;
}

.pp-live-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--pp-mint);
    box-shadow: 0 0 0 6px rgba(50, 230, 176, .12), 0 0 22px rgba(50, 230, 176, .72);
    animation: ppBlink 1.8s ease-in-out infinite;
}

.pp-orbit {
    position: absolute;
    border: 1px solid rgba(66, 217, 255, .12);
    border-radius: 50%;
    pointer-events: none;
}

.pp-orbit-a {
    width: 360px;
    height: 360px;
    left: -120px;
    top: 12%;
    animation: ppRotate 32s linear infinite;
}

.pp-orbit-b {
    width: 520px;
    height: 520px;
    right: -180px;
    bottom: -180px;
    animation: ppRotate 44s linear infinite reverse;
}

#main-window {
    min-height: calc(100vh - 42px);
    padding: 28px;
}

.pp-main-grid {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 22px;
    min-height: calc(100vh - 98px);
}

.pp-control-rail,
.pp-screen-stage {
    border-radius: 8px;
}

.pp-control-rail {
    padding: 22px;
}

.pp-device-card {
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(127, 211, 255, .14);
}

.pp-device-card h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.35;
}

.pp-session-state {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(50, 230, 176, .10);
    color: #d9fff4;
}

.pp-control-group {
    display: grid;
    gap: 12px;
    margin: 24px 0;
}

.pp-icon-action,
.pp-secondary-action,
.pp-danger-action {
    min-height: 52px;
    border-radius: 8px;
    border: 1px solid rgba(127, 211, 255, .16);
    background: rgba(255, 255, 255, .055);
    color: var(--pp-text);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.pp-icon-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 0 15px;
    font-weight: 700;
}

.pp-action-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(66, 217, 255, .26);
    background:
        radial-gradient(circle at 30% 24%, rgba(50, 230, 176, .25), transparent 52%),
        rgba(66, 217, 255, .08);
    color: var(--pp-cyan);
}

.pp-action-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pp-icon-action:hover,
.pp-secondary-action:hover {
    transform: translateY(-1px);
    border-color: var(--pp-border-hot);
    background: rgba(66, 217, 255, .12);
}

.pp-secondary-action,
.pp-danger-action {
    width: 100%;
    margin-bottom: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.pp-danger-action {
    border-color: rgba(255, 93, 108, .28);
    color: #ffe6e9;
    background: rgba(255, 93, 108, .12);
}

.pp-danger-action .pp-action-icon {
    border-color: rgba(255, 93, 108, .36);
    color: #ff8ea0;
    background: rgba(255, 93, 108, .10);
}

.pp-danger-action:hover {
    border-color: rgba(255, 93, 108, .54);
    background: rgba(255, 93, 108, .18);
}

.pp-screen-stage {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px;
}

.pp-screen-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 6px 16px;
}

.pp-screen-toolbar strong {
    display: block;
    font-size: 22px;
}

.pp-metric-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.pp-metric-pills .badge {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
}

.pp-video-frame {
    position: relative;
    flex: 1;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(127, 211, 255, .18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent),
        #02070f;
}

#streamingRemoteVideo {
    width: min(430px, 100%);
    max-height: calc(100vh - 170px);
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 8px;
    background: #000;
    box-shadow: 0 22px 72px rgba(0, 0, 0, .56);
}

#deviceGestures {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}

#deviceGestures.pp-gesture-active {
    cursor: grabbing;
    box-shadow: inset 0 0 0 2px rgba(50, 230, 176, .45);
}

.pp-debug-panel {
    position: relative;
    z-index: 2;
    width: min(980px, calc(100% - 44px));
    margin: 0 auto 28px;
    border-radius: 8px;
    overflow: hidden;
}

.pp-debug-header,
.pp-chat-form {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid rgba(127, 211, 255, .14);
}

.pp-debug-header {
    justify-content: space-between;
}

.pp-debug-body {
    min-height: 180px;
    max-height: 320px;
    overflow: auto;
    padding: 14px;
}

.pp-chat-form {
    border-top: 1px solid rgba(127, 211, 255, .14);
    border-bottom: 0;
}

.pp-chat-form .form-control {
    min-height: 44px;
}

.pp-chat-form .btn {
    min-height: 44px;
    border-radius: 8px;
}

.pp-footer {
    padding: 13px;
    color: rgba(238, 247, 255, .62);
    text-align: center;
    font-size: 13px;
}

.pp-footer-link {
    display: inline-flex;
    margin-left: 12px;
    color: rgba(66, 217, 255, .82);
    text-decoration: none;
}

.pp-footer-link:hover {
    color: #dff8ff;
    text-decoration: none;
}

.loader.is-active {
    background:
        radial-gradient(circle at 50% 42%, rgba(66, 217, 255, .18), transparent 28%),
        rgba(3, 8, 18, .86);
    backdrop-filter: blur(10px);
}

.loader-default:after {
    border-color: rgba(66, 217, 255, .28);
    border-left-color: var(--pp-mint);
    box-shadow: 0 0 26px rgba(50, 230, 176, .34);
}

.loader[data-text]:before {
    color: var(--pp-text);
    font-weight: 700;
}

.modal-content,
.toast {
    border: 1px solid rgba(127, 211, 255, .18);
    background: rgba(11, 22, 41, .96);
    color: var(--pp-text);
    border-radius: 8px;
}

.modal-header,
.modal-footer {
    border-color: rgba(127, 211, 255, .12);
}

.bootbox .btn-primary,
.toast-success {
    background: linear-gradient(135deg, var(--pp-blue), var(--pp-cyan));
    border: 0;
}

@keyframes ppPulse {
    0%, 100% { transform: scale(1); opacity: .65; }
    50% { transform: scale(1.65); opacity: 1; }
}

@keyframes ppBlink {
    0%, 100% { opacity: .55; transform: scale(.92); }
    50% { opacity: 1; transform: scale(1.08); }
}

@keyframes ppRotate {
    to { transform: rotate(360deg); }
}

@keyframes ppSpin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .pp-node,
    .pp-live-dot,
    .pp-orbit,
    .pp-spinner {
        animation: none;
    }

    #ppParticleCanvas {
        display: none;
    }
}

@media (max-width: 920px) {
    .pp-login-grid,
    .pp-main-grid {
        grid-template-columns: 1fr;
    }

    .pp-hero {
        min-height: 420px;
    }

    .pp-control-rail {
        display: grid;
        grid-template-columns: 1fr;
    }

    #streamingRemoteVideo {
        max-height: 72vh;
    }
}

@media (max-width: 560px) {
    #login-form-container,
    #main-window {
        padding: 14px;
    }

    .pp-hero,
    .pp-login-panel,
    .pp-control-rail,
    .pp-screen-stage,
    .pp-disclaimer-card {
        padding: 18px;
    }

    .pp-hero h1 {
        margin-top: 50px;
        font-size: 34px;
    }

    .pp-hero-status {
        margin-top: 20px;
    }

    .pp-signal-map {
        opacity: .45;
    }

    .pp-screen-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

body.pp-app-mode {
    width: 100vw;
    height: var(--pp-app-vh, 100vh);
    min-height: var(--pp-app-vh, 100vh);
    overflow: hidden;
    overscroll-behavior: none;
    background: #02070f;
    touch-action: manipulation;
}

body.pp-app-mode #ppParticleCanvas,
body.pp-app-mode .pp-footer,
body.pp-app-mode .pp-orbit,
body.pp-app-mode .debug-stuff {
    display: none !important;
}

body.pp-app-mode .loader.is-active {
    min-height: var(--pp-app-vh, 100vh);
}

body.pp-app-mode #login-form-container {
    width: 100vw;
    height: var(--pp-app-vh, 100vh);
    min-height: var(--pp-app-vh, 100vh);
    padding: 14px;
    overflow: auto;
}

body.pp-app-mode .pp-login-grid {
    width: 100%;
    min-height: calc(var(--pp-app-vh, 100vh) - 28px);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.pp-app-mode .pp-hero {
    display: none;
}

body.pp-app-mode .pp-login-panel {
    width: min(420px, 100%);
    padding: 22px;
    margin: 0 auto;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(66, 217, 255, .10), rgba(6, 13, 26, .86)),
        rgba(12, 25, 46, .96);
}

body.pp-app-mode .pp-policy-note {
    margin-bottom: 0;
}

body.pp-app-mode .pp-disclaimer-overlay {
    width: 100vw;
    height: var(--pp-app-vh, 100vh);
    padding: 12px;
}

body.pp-app-mode .pp-disclaimer-card {
    width: min(420px, 100%);
    max-height: calc(var(--pp-app-vh, 100vh) - 24px);
    overflow: auto;
    padding: 18px;
}

body.pp-app-mode .pp-disclaimer-card h2 {
    font-size: 24px;
}

body.pp-app-mode .pp-disclaimer-card p,
body.pp-app-mode .pp-disclaimer-list {
    font-size: 13px;
    line-height: 1.65;
}

body.pp-app-mode #main-window {
    width: 100vw;
    height: var(--pp-app-vh, 100vh);
    min-height: var(--pp-app-vh, 100vh);
    padding: 0;
    overflow: hidden;
}

body.pp-app-mode .pp-main-grid {
    display: block;
    width: 100vw;
    height: var(--pp-app-vh, 100vh);
    min-height: var(--pp-app-vh, 100vh);
}

body.pp-app-mode .pp-screen-stage {
    width: 100vw;
    height: var(--pp-app-vh, 100vh);
    min-height: var(--pp-app-vh, 100vh);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #000;
}

body.pp-app-mode .pp-screen-toolbar {
    position: fixed;
    top: 10px;
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    z-index: 18;
    padding: 8px 10px;
    border: 1px solid rgba(127, 211, 255, .18);
    border-radius: 8px;
    background: rgba(5, 13, 26, .76);
    backdrop-filter: blur(12px);
    pointer-events: none;
}

body.pp-app-mode .pp-screen-toolbar .pp-mini-kicker {
    display: none;
}

body.pp-app-mode .pp-screen-toolbar strong {
    font-size: 15px;
    line-height: 1.2;
}

body.pp-app-mode .pp-metric-pills {
    gap: 5px;
    pointer-events: auto;
}

body.pp-app-mode .pp-metric-pills .badge {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
    border-radius: 7px;
}

body.pp-app-mode .pp-video-frame {
    width: 100vw;
    height: var(--pp-app-vh, 100vh);
    min-height: var(--pp-app-vh, 100vh);
    border: 0;
    border-radius: 0;
    background: #000;
}

body.pp-app-mode #streamingRemoteVideo {
    width: 100vw;
    height: var(--pp-app-vh, 100vh);
    max-height: none;
    border-radius: 0;
    object-fit: contain;
    box-shadow: none;
}

body.pp-app-mode #deviceGestures {
    border-radius: 0;
}

body.pp-app-mode .pp-control-rail {
    position: fixed;
    left: 10px;
    left: max(10px, env(safe-area-inset-left));
    right: 10px;
    right: max(10px, env(safe-area-inset-right));
    bottom: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(127, 211, 255, .18);
    border-radius: 8px;
    background: rgba(5, 13, 26, .82);
    backdrop-filter: blur(14px);
}

body.pp-app-mode .pp-device-card {
    display: none;
}

body.pp-app-mode .pp-control-group {
    display: contents;
    margin: 0;
}

body.pp-app-mode .pp-icon-action,
body.pp-app-mode .pp-secondary-action,
body.pp-app-mode .pp-danger-action {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
}

body.pp-app-mode .pp-icon-action > span:not(.pp-action-icon),
body.pp-app-mode .pp-secondary-action > span:not(.pp-action-icon),
body.pp-app-mode .pp-danger-action > span:not(.pp-action-icon) {
    display: none;
}

body.pp-app-mode .pp-action-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
}

@media (orientation: landscape) {
    body.pp-app-mode .pp-control-rail {
        top: 72px;
        top: max(72px, env(safe-area-inset-top));
        left: auto;
        right: 10px;
        right: max(10px, env(safe-area-inset-right));
        bottom: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: 58px;
        grid-template-columns: 1fr;
        align-content: end;
    }
}

body.pp-app-mode.pp-app-connected .pp-screen-toolbar {
    top: 6px;
    top: max(6px, env(safe-area-inset-top));
    left: 50%;
    right: auto;
    width: auto;
    max-width: calc(100vw - 24px);
    transform: translateX(-50%);
    padding: 6px;
    border-color: rgba(127, 211, 255, .16);
    background: rgba(2, 7, 15, .58);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .24);
}

body.pp-app-mode.pp-app-connected .pp-screen-toolbar > div:first-child {
    display: none;
}

body.pp-app-mode.pp-app-connected .pp-metric-pills {
    flex-wrap: nowrap;
    justify-content: center;
}

body.pp-app-mode.pp-app-connected .pp-metric-pills .badge {
    max-width: 34vw;
    min-height: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-color: rgba(27, 163, 214, .88);
}

body.pp-app-mode.pp-app-connected .pp-control-rail {
    left: 50%;
    right: auto;
    bottom: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    max-width: calc(100vw - 16px);
    display: flex;
    align-items: center;
    justify-content: center;
    grid-template-columns: none;
    gap: 6px;
    transform: translateX(-50%);
    padding: 6px;
    border-color: rgba(127, 211, 255, .14);
    background: rgba(2, 7, 15, .52);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .28);
}

body.pp-app-mode.pp-app-connected .pp-control-group {
    display: flex;
    gap: 6px;
}

body.pp-app-mode.pp-app-connected .pp-icon-action,
body.pp-app-mode.pp-app-connected .pp-secondary-action,
body.pp-app-mode.pp-app-connected .pp-danger-action {
    width: 46px;
    height: 46px;
    min-height: 46px;
    flex: 0 0 46px;
    border-radius: 8px;
    background: rgba(15, 31, 54, .78);
}

body.pp-app-mode.pp-app-connected .pp-action-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
}

body.pp-app-mode.pp-app-connected .pp-secondary-action,
body.pp-app-mode.pp-app-connected .pp-danger-action {
    margin: 0;
}

body.pp-app-mode.pp-app-connected .pp-video-frame,
body.pp-app-mode.pp-app-connected #deviceGestures {
    touch-action: none;
}

@media (orientation: landscape) {
    body.pp-app-mode.pp-app-connected .pp-control-rail {
        top: 50%;
        left: auto;
        right: 8px;
        right: max(8px, env(safe-area-inset-right));
        bottom: auto;
        width: 58px;
        max-width: none;
        flex-direction: column;
        transform: translateY(-50%);
    }

    body.pp-app-mode.pp-app-connected .pp-control-group {
        flex-direction: column;
    }
}
