* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #f3f5f8;
    color: #17202a;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    min-height: 100vh;
    padding: 20px;
}

.viewer {
    min-width: 0;
}

.viewer__image-frame {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: calc(100vh - 40px);
    min-height: 520px;
    overflow: hidden;
    border: 1px solid #d9dee7;
    border-radius: 6px;
    background: #0e141b;
}

.viewer__image {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.viewer__image.is-visible {
    display: block;
}

.viewer__empty {
    max-width: 520px;
    padding: 24px;
    text-align: center;
    color: #dfe6ef;
}

.viewer__empty-title {
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 700;
}

.viewer__empty-text {
    font-size: 15px;
    line-height: 1.7;
}

.viewer__empty.is-hidden {
    display: none;
}

.result-panel {
    align-self: start;
    min-height: 320px;
    padding: 18px;
    border: 1px solid #d9dee7;
    border-radius: 6px;
    background: #ffffff;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #4d5b6a;
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9aa6b2;
}

.status-dot.is-online {
    background: #1f9d55;
}

.status-dot.is-error {
    background: #d33f49;
}

.result-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.result-list div {
    padding-bottom: 12px;
    border-bottom: 1px solid #edf0f4;
}

.result-list dt {
    margin-bottom: 4px;
    color: #667485;
    font-size: 12px;
}

.result-list dd {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.message {
    margin: 18px 0 0;
    color: #4d5b6a;
    font-size: 14px;
    line-height: 1.6;
}

.stream-box {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 10;
    display: none;
    width: min(420px, calc(100vw - 40px));
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    background: #05070a;
    box-shadow: 0 14px 36px rgba(9, 18, 30, 0.35);
}

.stream-box.is-visible {
    display: block;
}

.stream-box__bar {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.stream-box__target,
.stream-box__target video,
.stream-box__target iframe,
.stream-box__target img {
    width: 100%;
    height: 100%;
}

.stream-box__target video,
.stream-box__target iframe,
.stream-box__target img {
    display: block;
    border: 0;
    object-fit: cover;
}

.stream-box__placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 16px;
    color: #ffffff;
    text-align: center;
    font-size: 14px;
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .viewer__image-frame {
        height: 62vh;
        min-height: 360px;
    }

    .stream-box {
        left: 12px;
        bottom: 12px;
        width: min(360px, calc(100vw - 24px));
    }
}
