:root {
    --bg-top: #f3efe4;
    --bg-bottom: #d9e8f5;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-border: rgba(22, 50, 79, 0.1);
    --text-main: #16324f;
    --text-muted: #627286;
    --accent: #cc5f2f;
    --accent-dark: #9e451e;
    --success: #1d7f57;
    --danger: #b74242;
    --shadow: 0 24px 60px rgba(22, 50, 79, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 36%),
        linear-gradient(145deg, var(--bg-top), var(--bg-bottom));
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 40px;
}

.hero-panel,
.card-block,
.status-panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.hero-panel {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    padding: 32px;
    border-radius: 32px;
}

.eyebrow,
.section-label {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 700;
}

.hero-copy h1,
.support-card h2,
.card-head h2 {
    margin: 0;
    line-height: 1.05;
}

.hero-copy h1 {
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    max-width: 10ch;
}

.lead,
.card-copy,
.auth-panel p,
.support-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin: 16px 0 0;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hero-points span,
.badge-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 600;
}

.hero-points span {
    color: var(--text-main);
    background: rgba(22, 50, 79, 0.06);
}

.support-card {
    padding: 24px;
    border-radius: 24px;
}

.support-status,
.diagnostics-box,
.status-details {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(22, 50, 79, 0.06);
    color: var(--text-main);
    line-height: 1.5;
    white-space: pre-line;
}

.status-details {
    padding: 0;
    background: transparent;
    color: var(--text-muted);
}

.support-btn {
    margin-top: 14px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.sender-combat-layout {
    display: contents;
    --sender-video-panel-width: 50%;
    --sender-resize-handle-width: 12px;
}

.sender-combat-layout.ops-mode {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, var(--sender-video-panel-width)) var(--sender-resize-handle-width) minmax(220px, 1fr);
    gap: 0;
}

.sender-combat-layout.ops-mode .viewer-card,
.sender-combat-layout.ops-mode .sender-map-card {
    grid-column: auto;
    margin: 0;
}

.sender-combat-layout.ops-mode .viewer-card,
.sender-combat-layout.ops-mode .sender-map-card {
    padding: 0;
    overflow: hidden;
}

.sender-resize-handle {
    display: none;
}

.sender-combat-layout.ops-mode .sender-resize-handle,
.sender-combat-layout:fullscreen .sender-resize-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    position: relative;
}

.sender-combat-layout.ops-mode .sender-resize-handle::before,
.sender-combat-layout:fullscreen .sender-resize-handle::before {
    content: "";
    width: 4px;
    height: min(28vh, 220px);
    border-radius: 999px;
    background: rgba(204, 95, 47, 0.72);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.sender-combat-layout.ops-mode.resizing,
.sender-combat-layout:fullscreen.resizing {
    cursor: col-resize;
    user-select: none;
}

.sender-combat-layout.ops-mode.resizing .sender-resize-handle::before,
.sender-combat-layout:fullscreen.resizing .sender-resize-handle::before {
    background: rgba(204, 95, 47, 0.96);
}

.sender-combat-layout.ops-mode .viewer-card .card-head,
.sender-combat-layout.ops-mode .viewer-card .card-copy,
.sender-combat-layout.ops-mode .sender-map-card .card-head,
.sender-combat-layout.ops-mode .sender-map-card .card-copy {
    display: none;
}

.sender-combat-layout.ops-mode .viewer-card .prominent-mode-row {
    display: none;
}

.sender-combat-layout.ops-mode .viewer-card .viewer-viewport {
    min-height: 640px;
    margin-top: 0;
    border-radius: 28px;
}

.sender-combat-layout.ops-mode .sender-map-card .map-canvas {
    min-height: 640px;
}

.sender-combat-layout.ops-mode .viewer-card .viewer-toolbar,
.sender-combat-layout.ops-mode .viewer-card .viewer-footer {
    display: none;
}

.sender-combat-layout.ops-mode .viewer-card .viewer-viewport {
    margin-top: 0;
}

.sender-combat-layout:fullscreen {
    width: 100vw;
    height: 100vh;
    padding: 18px;
    grid-template-columns: minmax(220px, var(--sender-video-panel-width)) var(--sender-resize-handle-width) minmax(220px, 1fr);
    gap: 0;
    background: #06111d;
    align-items: stretch;
}

.sender-combat-layout:fullscreen .viewer-card,
.sender-combat-layout:fullscreen .sender-map-card {
    margin: 0;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.sender-combat-layout:fullscreen .viewer-card .card-head,
.sender-combat-layout:fullscreen .viewer-card .card-copy,
.sender-combat-layout:fullscreen .sender-map-card .card-head,
.sender-combat-layout:fullscreen .sender-map-card .card-copy {
    display: none;
}

.sender-combat-layout:fullscreen .viewer-card .prominent-mode-row {
    display: none;
}

.sender-combat-layout:fullscreen .viewer-card .viewer-viewport,
.sender-combat-layout:fullscreen .sender-map-card .map-canvas {
    min-height: calc(100vh - 110px);
}

.sender-combat-layout:fullscreen .viewer-card .viewer-toolbar,
.sender-combat-layout:fullscreen .viewer-card .viewer-footer {
    display: none;
}

.sender-combat-layout:fullscreen .viewer-card .viewer-viewport {
    margin-top: 0;
}

.card-block {
    padding: 24px;
    border-radius: 28px;
}

.viewer-card {
    grid-column: 1 / -1;
}

.share-card {
    grid-column: 1 / -1;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.badge-chip {
    min-width: 138px;
}

.badge-chip.neutral {
    color: var(--text-main);
    background: rgba(22, 50, 79, 0.08);
}

.badge-chip.success {
    color: #fff;
    background: var(--success);
}

.badge-chip.warning {
    color: #fff;
    background: var(--accent);
}

.auth-panel label {
    display: block;
    margin-top: 18px;
    color: var(--text-main);
    font-weight: 600;
}

.auth-panel input {
    margin: 8px 0 0;
    padding: 14px 16px;
    width: 100%;
    border: 1px solid rgba(22, 50, 79, 0.15);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
}

.share-link-field {
    display: block;
    margin-top: 18px;
    color: var(--text-main);
    font-weight: 600;
}

.share-card input,
.receiver-slot input,
.buddy-stream-panel input {
    margin: 8px 0 0;
    padding: 14px 16px;
    width: 100%;
    border: 1px solid rgba(22, 50, 79, 0.15);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
}

.language-select {
    margin-top: 8px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(22, 50, 79, 0.15);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-main);
    outline: none;
}

.share-card input:focus,
.receiver-slot input:focus,
.buddy-stream-panel input:focus {
    outline: 2px solid rgba(204, 95, 47, 0.18);
    border-color: var(--accent);
}

.inline-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.auth-panel input:focus {
    outline: 2px solid rgba(204, 95, 47, 0.18);
    border-color: var(--accent);
}

.button-row,
.viewer-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.source-switch-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.source-switch-btn {
    min-height: 44px;
    font-weight: 700;
}

.source-switch-btn.is-active {
    background: var(--accent);
    color: #fff;
}

.prominent-mode-row {
    margin-top: 18px;
}

.prominent-mode-btn {
    min-width: 220px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.buddy-view-mode-row {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding: 6px;
    border-radius: 16px;
    background: rgba(22, 50, 79, 0.06);
}

.buddy-view-mode-btn {
    min-height: 36px;
}

.buddy-view-mode-btn.is-active {
    background: var(--accent);
    color: #fff;
}

.receiver-mode-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.receiver-mode-btn {
    width: 100%;
}

.receiver-mode-btn.mode-active {
    background: var(--accent);
    color: #fff;
}

.floating-ops-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    min-width: 220px;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 18px 42px rgba(22, 50, 79, 0.32);
}

.refresh-rate-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    min-height: 36px;
    border-radius: 14px;
    color: var(--text-main);
    background: rgba(22, 50, 79, 0.06);
}

.refresh-rate-control select {
    border: 0;
    background: transparent;
    color: var(--text-main);
    outline: none;
}

.action-btn {
    background: var(--accent);
    border-radius: 14px;
    box-shadow: none;
}

.action-btn:hover,
.action-btn:focus {
    background: var(--accent-dark);
}

.secondary-btn {
    border-radius: 14px;
    color: var(--text-main);
    background: rgba(22, 50, 79, 0.06);
}

.secondary-btn[disabled],
.action-btn[disabled] {
    opacity: 0.55;
}

.device-summary,
.viewer-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.device-summary > div,
.viewer-footer span {
    padding: 16px;
    border-radius: 18px;
    background: rgba(22, 50, 79, 0.05);
}

.summary-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.viewer-viewport {
    position: relative;
    margin-top: 20px;
    min-height: 520px;
    border-radius: 28px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(22, 50, 79, 0.92), rgba(33, 68, 105, 0.96)),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03) 12px, transparent 12px, transparent 24px);
    touch-action: none;
}

.viewer-viewport:fullscreen {
    width: 100vw;
    height: 100vh;
    margin-top: 0;
    border-radius: 0;
}

.viewport-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
    text-align: center;
}

.screen-canvas {
    position: absolute;
    top: 0;
    left: 50%;
    max-width: 100%;
    max-height: 100%;
    user-select: none;
    touch-action: none;
    cursor: grab;
    transform-origin: center center;
    will-change: transform;
    image-rendering: optimizeQuality;
}

.screen-canvas.dragging {
    cursor: grabbing;
}

.viewer-viewport:fullscreen .screen-canvas {
    max-width: 100vw;
    max-height: 100vh;
}

.viewer-card.buddy-mode-my .buddy-stream-panel {
    display: none;
}

.viewer-card.buddy-mode-buddy .own-stream-panel,
.viewer-card.buddy-mode-buddy .viewer-toolbar {
    display: none;
}

.viewer-card.buddy-mode-both .buddy-stream-panel {
    margin-top: 20px;
}

.buddy-stream-panel {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(22, 50, 79, 0.1);
    border-radius: 20px;
    background: rgba(22, 50, 79, 0.04);
}

.buddy-stream-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.buddy-stream-head h3 {
    margin: 4px 0 0;
    font-size: 1.25rem;
}

.buddy-stream-actions {
    margin-top: 14px;
}

.buddy-video-wrap {
    position: relative;
    margin-top: 16px;
    min-height: 280px;
    border-radius: 20px;
    overflow: hidden;
    background: #0c1a29;
}

.buddy-video-wrap video,
.buddy-video-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.buddy-video-wrap video {
    object-fit: contain;
    background: #0c1a29;
}

.buddy-video-wrap audio {
    display: none;
}

.buddy-video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: rgba(255, 255, 255, 0.82);
    text-align: center;
}

.buddy-video-wrap.has-video .buddy-video-placeholder {
    display: none;
}

.trusted-meta {
    margin-top: 14px;
    font-size: 0.95rem;
}

.status-panel {
    margin-top: 24px;
    padding: 22px 24px;
    border-radius: 24px;
}

.receiver-shell {
    width: min(1420px, calc(100% - 32px));
}

.receiver-live-mode .receiver-hero {
    grid-template-columns: 1fr;
    padding: 18px 22px;
}

.receiver-live-mode .receiver-hero .hero-copy {
    display: none;
}

.receiver-live-mode .receiver-auth-grid {
    margin-top: 14px;
}

.receiver-live-mode #receiverAuthCard {
    padding: 16px 20px;
}

.receiver-live-mode #receiverAuthCard .card-head {
    display: none;
}

.receiver-live-mode #receiverAuthTrusted p {
    margin-top: 0;
}

.receiver-auth-grid {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 24px;
}

.receiver-combat-layout {
    display: block;
    --receiver-map-panel-width: 260px;
    --receiver-resize-handle-width: 12px;
    --receiver-video-top-row-height: 50%;
    --receiver-video-resize-handle-height: 12px;
}

.receiver-combat-layout.ops-mode {
    display: grid;
    grid-template-columns: minmax(160px, var(--receiver-map-panel-width)) var(--receiver-resize-handle-width) minmax(0, 1fr);
    gap: 0;
    align-items: start;
    margin-top: 24px;
}

.receiver-combat-layout.ops-mode .receiver-map-section,
.receiver-combat-layout.ops-mode .receiver-grid,
.receiver-combat-layout.ops-mode .receiver-resize-handle {
    margin-top: 0;
}

.receiver-resize-handle {
    display: none;
}

.receiver-combat-layout.ops-mode .receiver-resize-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    position: relative;
}

.receiver-combat-layout.ops-mode .receiver-resize-handle::before {
    content: "";
    width: 4px;
    height: min(28vh, 220px);
    border-radius: 999px;
    background: rgba(204, 95, 47, 0.72);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.receiver-combat-layout.ops-mode.resizing {
    cursor: col-resize;
    user-select: none;
}

.receiver-combat-layout.ops-mode.resizing .receiver-resize-handle::before {
    background: rgba(204, 95, 47, 0.96);
}

.receiver-combat-layout.ops-mode .receiver-map-section .card-head,
.receiver-combat-layout.ops-mode .receiver-map-section .card-copy {
    display: none;
}

.receiver-combat-layout.ops-mode .receiver-map-section .map-card {
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.receiver-combat-layout.ops-mode .receiver-map-section,
.receiver-combat-layout.ops-mode .receiver-map-section .map-card,
.receiver-combat-layout.ops-mode .receiver-map-section .map-layout {
    height: 100%;
}

.receiver-combat-layout.ops-mode .receiver-map-section .map-layout {
    grid-template-rows: 1fr;
    align-items: stretch;
    margin-top: 0;
}

.receiver-combat-layout.ops-mode .receiver-map-section .map-side {
    max-height: none;
}

.receiver-combat-layout.ops-mode .receiver-map-section .map-canvas {
    min-height: 78vh;
    height: 100%;
    border-radius: 28px;
}

.receiver-combat-layout.ops-mode .receiver-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(0, 1fr);
    align-content: stretch;
}

.receiver-video-resize-handle {
    display: none;
}

.receiver-combat-layout.ops-mode.mode-all .receiver-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(220px, 1fr);
    gap: 14px;
}

.receiver-combat-layout.ops-mode.mode-all .receiver-slot {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.receiver-combat-layout.ops-mode.mode-all .receiver-slot .card-head,
.receiver-combat-layout.ops-mode.mode-all .receiver-slot .share-link-field,
.receiver-combat-layout.ops-mode.mode-all .receiver-slot [data-slot-input],
.receiver-combat-layout.ops-mode.mode-all .receiver-slot .button-row,
.receiver-combat-layout.ops-mode.mode-all .receiver-slot .receiver-slot-status {
    display: none;
}

.receiver-combat-layout.ops-mode.mode-all .receiver-slot .receiver-video-wrap {
    flex: 1;
    min-height: 260px;
    margin-top: 0;
}

.receiver-combat-layout.ops-mode.mode-map {
    grid-template-columns: minmax(0, 1fr);
}

.receiver-combat-layout.ops-mode.mode-map .receiver-grid {
    display: none;
}

.receiver-combat-layout.ops-mode.mode-map .receiver-resize-handle {
    display: none;
}

.receiver-combat-layout.ops-mode.mode-map .receiver-map-section,
.receiver-combat-layout.ops-mode.mode-map .receiver-map-section .map-card,
.receiver-combat-layout.ops-mode.mode-map .receiver-map-section .map-layout {
    height: 100%;
}

.receiver-combat-layout.ops-mode.mode-map .receiver-map-section .map-canvas {
    min-height: 82vh;
}

.receiver-combat-layout.ops-mode .receiver-slot {
    display: none;
}

.receiver-combat-layout.ops-mode .receiver-slot.active-slot {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.receiver-combat-layout.ops-mode .receiver-slot.active-slot .card-head,
.receiver-combat-layout.ops-mode .receiver-slot.active-slot .share-link-field,
.receiver-combat-layout.ops-mode .receiver-slot.active-slot [data-slot-input],
.receiver-combat-layout.ops-mode .receiver-slot.active-slot .button-row,
.receiver-combat-layout.ops-mode .receiver-slot.active-slot .receiver-slot-status {
    display: none;
}

.receiver-combat-layout.ops-mode .receiver-slot.active-slot .receiver-video-wrap {
    flex: 1;
    min-height: 420px;
    margin-top: 0;
}

.receiver-combat-layout.ops-mode .receiver-video-placeholder {
    font-size: 0.94rem;
}

.receiver-combat-layout:fullscreen,
.receiver-combat-layout.ops-mode:fullscreen {
    width: 100vw;
    height: 100vh;
    padding: 10px;
    grid-template-columns: minmax(160px, var(--receiver-map-panel-width)) var(--receiver-resize-handle-width) minmax(0, 1fr);
    gap: 10px;
    background: #06111d;
    align-items: stretch;
}

.receiver-combat-layout.ops-mode.mode-all:fullscreen {
    grid-template-columns: minmax(160px, var(--receiver-map-panel-width)) var(--receiver-resize-handle-width) minmax(0, 1fr);
    align-items: stretch;
}

.receiver-combat-layout:fullscreen .receiver-map-section,
.receiver-combat-layout.ops-mode:fullscreen .receiver-map-section,
.receiver-combat-layout:fullscreen .receiver-grid,
.receiver-combat-layout.ops-mode:fullscreen .receiver-grid {
    margin-top: 0;
}

.receiver-combat-layout:fullscreen .receiver-map-section .card-head,
.receiver-combat-layout.ops-mode:fullscreen .receiver-map-section .card-head,
.receiver-combat-layout:fullscreen .receiver-map-section .card-copy,
.receiver-combat-layout.ops-mode:fullscreen .receiver-map-section .card-copy {
    display: none;
}

.receiver-combat-layout:fullscreen .receiver-grid,
.receiver-combat-layout.ops-mode:fullscreen .receiver-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(0, 1fr);
}

.receiver-combat-layout.ops-mode:fullscreen .receiver-map-section,
.receiver-combat-layout.ops-mode:fullscreen .receiver-map-section .map-card,
.receiver-combat-layout.ops-mode:fullscreen .receiver-map-section .map-layout {
    height: 100%;
}

.receiver-combat-layout.ops-mode:fullscreen .receiver-map-section .map-layout {
    margin-top: 0;
    grid-template-rows: 1fr;
}

.receiver-combat-layout.ops-mode:fullscreen .receiver-map-section .map-side {
    max-height: none;
}

.receiver-combat-layout.ops-mode:fullscreen .receiver-map-section .map-canvas {
    min-height: calc(100vh - 20px);
    height: 100%;
    border-radius: 18px;
}

.receiver-combat-layout.ops-mode.mode-map:fullscreen {
    grid-template-columns: minmax(0, 1fr);
}

.receiver-combat-layout.ops-mode.mode-map:fullscreen .receiver-grid,
.receiver-combat-layout.ops-mode.mode-map:fullscreen .receiver-resize-handle {
    display: none;
}

.receiver-combat-layout.ops-mode.mode-map:fullscreen .receiver-map-section .map-canvas {
    min-height: calc(100vh - 20px);
}

.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(140px, var(--receiver-video-top-row-height)) minmax(140px, calc(100% - var(--receiver-video-top-row-height) - 6px));
    grid-auto-rows: minmax(0, 1fr);
    gap: 6px;
    align-content: stretch;
    align-items: stretch;
    height: 100%;
    min-height: 0;
    position: relative;
}

.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-slot {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    justify-content: stretch;
    overflow: hidden;
}

.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-slot .receiver-video-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    margin-top: 0;
    border-radius: 10px;
    width: 100%;
    max-height: none;
    aspect-ratio: auto;
    align-self: stretch;
}

.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-video-resize-handle {
    position: absolute;
    left: 8px;
    right: 8px;
    top: calc(var(--receiver-video-top-row-height) - (var(--receiver-video-resize-handle-height) / 2));
    height: var(--receiver-video-resize-handle-height);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: row-resize;
    user-select: none;
    touch-action: none;
    z-index: 14;
}

.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-video-resize-handle::before {
    content: "";
    width: min(22vw, 220px);
    height: 4px;
    border-radius: 999px;
    background: rgba(204, 95, 47, 0.82);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.receiver-combat-layout.ops-mode.video-resizing {
    user-select: none;
}

.receiver-combat-layout.ops-mode.video-resizing .receiver-video-resize-handle::before {
    background: rgba(204, 95, 47, 1);
}

.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-callsign {
    top: 6px;
    left: 6px;
    padding: 4px 8px;
    font-size: 0.7rem;
}

@media (max-width: 1440px) {
    .receiver-combat-layout.ops-mode.mode-all:fullscreen {
        padding: 4px;
        gap: 4px;
    }

    .receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-grid {
        gap: 4px;
    }

    .receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-slot .receiver-video-wrap {
        border-radius: 8px;
    }

    .receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-map-section .map-canvas {
        border-radius: 8px;
        min-height: calc(100vh - 8px);
    }
}

.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-slot .card-head,
.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-slot .share-link-field,
.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-slot [data-slot-input],
.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-slot .button-row,
.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-slot .receiver-slot-status,
.receiver-combat-layout.ops-mode.mode-all:fullscreen .receiver-slot .receiver-video-placeholder {
    display: none !important;
}

.receiver-combat-layout:fullscreen .receiver-slot .receiver-video-wrap,
.receiver-combat-layout.ops-mode:fullscreen .receiver-slot .receiver-video-wrap {
    min-height: calc((100vh - 120px) / 2);
}

.receiver-combat-layout.ops-mode:fullscreen .receiver-slot {
    display: none;
}

.receiver-combat-layout.ops-mode:fullscreen .receiver-slot.active-slot {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.receiver-combat-layout.ops-mode:fullscreen .receiver-slot.active-slot .receiver-video-wrap {
    flex: 1;
    min-height: calc(100vh - 120px);
}

.receiver-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.receiver-grid.receiver-grid-locked {
    opacity: 0.48;
    pointer-events: none;
    filter: grayscale(0.18);
}

.receiver-fullscreen-controls {
    display: none;
}

.receiver-grid:fullscreen {
    width: 100vw;
    height: 100vh;
    margin-top: 0;
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 18px;
    background: #06111d;
    align-content: stretch;
    grid-auto-rows: minmax(0, 1fr);
}

.receiver-grid:fullscreen .receiver-fullscreen-controls {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 20;
    display: flex;
    gap: 10px;
}

.receiver-grid:fullscreen .receiver-slot {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.receiver-grid:fullscreen .receiver-slot .receiver-video-wrap {
    flex: 1;
    min-height: 0;
    margin-top: 0;
}

.receiver-slot-status {
    margin: 16px 0 0;
    color: var(--text-muted);
    min-height: 48px;
}

.receiver-slot.active-slot {
    box-shadow: 0 0 0 2px rgba(204, 95, 47, 0.35), var(--shadow);
}

.receiver-grid:fullscreen .receiver-slot.active-slot {
    box-shadow: 0 0 0 3px rgba(204, 95, 47, 0.8), 0 28px 70px rgba(22, 50, 79, 0.45);
}

.receiver-grid:fullscreen .card-head,
.receiver-grid:fullscreen .share-link-field,
.receiver-grid:fullscreen [data-slot-input],
.receiver-grid:fullscreen .button-row,
.receiver-grid:fullscreen .receiver-slot-status,
.receiver-grid:fullscreen .receiver-video-placeholder {
    display: none !important;
}

.receiver-video-wrap {
    position: relative;
    margin-top: 16px;
    min-height: 260px;
    border-radius: 24px;
    overflow: hidden;
    cursor: default;
    background:
        linear-gradient(135deg, rgba(22, 50, 79, 0.92), rgba(33, 68, 105, 0.96)),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03) 12px, transparent 12px, transparent 24px);
}

.receiver-video-wrap video,
.receiver-video-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.receiver-video-wrap video {
    object-fit: contain;
    background: #0c1a29;
    transform-origin: center center;
    transition: transform 140ms ease;
    cursor: inherit;
    user-select: none;
}

.receiver-slot.slot-zoomed .receiver-video-wrap {
    cursor: grab;
}

.receiver-slot.dragging-video .receiver-video-wrap {
    cursor: grabbing;
}

.receiver-slot.dragging-video .receiver-video-wrap video {
    transition: none;
}

.receiver-video-wrap audio {
    display: none;
}

.receiver-video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: rgba(255, 255, 255, 0.82);
    text-align: center;
}

.receiver-slot.has-video .receiver-video-placeholder {
    display: none !important;
}

.receiver-slot:fullscreen {
    width: 100vw;
    height: 100vh;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #06111d;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.receiver-slot:fullscreen .card-head,
.receiver-slot:fullscreen .share-link-field,
.receiver-slot:fullscreen [data-slot-input],
.receiver-slot:fullscreen .button-row,
.receiver-slot:fullscreen .receiver-slot-status,
.receiver-slot:fullscreen .receiver-video-placeholder {
    display: none !important;
}

.receiver-slot:fullscreen .receiver-video-wrap {
    flex: 1;
    min-height: 100vh;
    margin-top: 0;
    border-radius: 0;
}

.receiver-callsign {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(6, 17, 29, 0.78);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.03em;
    backdrop-filter: blur(8px);
}

.map-card {
    grid-column: 1 / -1;
}

.sender-map-card .card-copy,
.receiver-map-card .card-copy {
    display: none;
}

.sender-map-card .card-head,
.receiver-map-card .card-head {
    margin-bottom: 10px;
}

.map-layout {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 10px;
    margin-top: 12px;
    position: relative;
}

.map-artillery-summary-static {
    display: none !important;
}

.map-layout.tools-collapsed {
    grid-template-columns: minmax(0, 1fr);
}

.map-layout.tools-collapsed .map-side {
    display: none;
}

.map-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    min-width: 168px;
    min-height: 40px;
    padding: 10px 14px;
    background: rgba(204, 95, 47, 0.96);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: 0 18px 38px rgba(6, 17, 29, 0.34);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.map-floating-toolbar {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2100;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: calc(100% - 24px);
}

.map-collapse-btn:hover,
.map-collapse-btn:focus {
    background: rgba(158, 69, 30, 0.98);
    outline: none;
}

.map-notify-modal {
    position: absolute;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.map-notify-modal[hidden] {
    display: none;
}

.map-notify-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 17, 29, 0.56);
    backdrop-filter: blur(3px);
}

.map-notify-card {
    position: relative;
    z-index: 1;
    width: min(420px, calc(100% - 24px));
    padding: 22px 20px 18px;
    border-radius: 22px;
    border: 1px solid rgba(183, 66, 66, 0.5);
    background: linear-gradient(180deg, rgba(183, 66, 66, 0.96), rgba(136, 28, 28, 0.96));
    box-shadow: 0 24px 60px rgba(6, 17, 29, 0.42);
    color: #fff;
}

.map-notify-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.map-notify-body {
    margin-top: 14px;
    white-space: pre-line;
    line-height: 1.6;
    font-size: 0.96rem;
}

.map-notify-ok {
    margin-top: 18px;
    border: 0;
    border-radius: 14px;
    min-width: 120px;
    min-height: 42px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.94);
    color: #8f2222;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.map-notify-ok:hover,
.map-notify-ok:focus {
    background: #fff;
    outline: none;
}

.map-side {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 520px;
    overflow: auto;
    padding-right: 4px;
    font-size: 0.92rem;
}

.map-canvas {
    min-height: 560px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(22, 50, 79, 0.12);
}

.map-side .share-link-field {
    margin-top: 10px;
    font-size: 0.84rem;
}

.map-side input,
.map-side select {
    margin-top: 6px;
    min-height: 40px;
    padding: 9px 12px;
    font-size: 0.88rem;
}

.map-textarea {
    min-height: 64px;
    resize: vertical;
    margin-top: 6px;
    padding: 10px 12px;
    width: 100%;
    border: 1px solid rgba(22, 50, 79, 0.15);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
    font: inherit;
}

.map-comments {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(22, 50, 79, 0.06);
    min-height: 68px;
    max-height: 120px;
    overflow: auto;
    font-size: 0.84rem;
}

.map-helper-text {
    margin: 8px 0 0;
    color: var(--text-muted);
    line-height: 1.45;
    font-size: 0.76rem;
}

.map-artillery-toggle {
    width: 100%;
    margin-top: 8px;
    font-weight: 800;
    min-height: 44px;
}

.is-hidden-artillery-toggle {
    display: none !important;
}

.map-floating-artillery-btn {
    width: auto;
    margin-top: 0;
    min-width: 170px;
    min-height: 40px;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(183, 66, 66, 0.96);
    color: #fff;
    box-shadow: 0 18px 38px rgba(6, 17, 29, 0.34);
    backdrop-filter: blur(10px);
    font-weight: 800;
    font-size: 0.84rem;
    letter-spacing: 0.02em;
}

.map-artillery-toggle.is-active,
.map-artillery-actions .btn-flat.is-active {
    background: rgba(204, 95, 47, 0.14);
    color: var(--accent-dark);
    border-color: rgba(204, 95, 47, 0.32);
}

.map-floating-artillery-btn.is-active {
    background: rgba(204, 95, 47, 0.98);
    color: #fff;
}

.map-artillery-panel {
    margin-top: 8px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(6, 17, 29, 0.92);
    border: 1px solid rgba(204, 95, 47, 0.28);
    box-shadow: 0 18px 36px rgba(6, 17, 29, 0.24);
}

.map-artillery-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.map-artillery-actions .btn-flat {
    min-height: 34px;
    min-width: 46px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.01em;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 8px;
    font-size: 0.74rem;
}

.map-artillery-actions .map-artillery-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
}

.map-artillery-status {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #06111d;
    white-space: pre-line;
    line-height: 1.45;
    font-size: 0.78rem;
    font-weight: 700;
}

.map-artillery-overlay {
    position: absolute;
    top: 64px;
    right: 12px;
    z-index: 2050;
    width: min(420px, calc(100% - 24px));
    margin-top: 0;
    box-shadow: 0 18px 38px rgba(6, 17, 29, 0.24);
}

.map-artillery-summary {
    position: absolute;
    left: 12px;
    top: 64px;
    z-index: 2040;
    width: min(420px, calc(100% - 24px));
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(6, 17, 29, 0.88);
    color: #fff;
    white-space: pre-line;
    line-height: 1.5;
    font-size: 0.86rem;
    font-weight: 700;
    box-shadow: 0 18px 38px rgba(6, 17, 29, 0.28);
    pointer-events: none;
}

.map-symbol-palette {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

.map-palette-section {
    border: 1px solid rgba(10, 22, 36, 0.12);
    border-radius: 10px;
    padding: 7px;
    background: rgba(255, 255, 255, 0.62);
}

.map-palette-section-own {
    border-color: rgba(224, 0, 0, 0.24);
}

.map-palette-section-enemy {
    border-color: rgba(21, 101, 192, 0.24);
}

.map-palette-section-title {
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
}

.map-palette-section-own .map-palette-section-title {
    color: #b80000;
}

.map-palette-section-enemy .map-palette-section-title {
    color: #0d47a1;
}

.map-palette-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.map-palette-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 3px;
    border-radius: 10px;
    background: rgba(10, 22, 36, 0.05);
    border: 1px solid rgba(10, 22, 36, 0.16);
    cursor: grab;
    text-align: center;
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.map-palette-item:hover,
.map-palette-item.active {
    transform: translateY(-1px);
    border-color: rgba(204, 95, 47, 0.45);
    box-shadow: 0 10px 24px rgba(22, 50, 79, 0.12);
}

.map-palette-item:active {
    cursor: grabbing;
}

.map-palette-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.map-comments-empty,
.map-comment {
    color: var(--text-main);
    line-height: 1.5;
}

.map-comment + .map-comment {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(22, 50, 79, 0.08);
}

.map-symbol-wrap {
    background: transparent;
    border: 0;
}

.map-military-icon-wrap {
    background: transparent;
    border: 0;
}

.map-military-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

.map-military-icon svg {
    width: 30px;
    height: 30px;
}

.map-symbol {
    min-width: 46px;
    padding: 8px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 10px 20px rgba(22, 50, 79, 0.18);
}

.map-symbol-pilot {
    background: #1d7f57;
}

.map-symbol-tank {
    background: #8b3d2e;
}

.map-symbol-vehicle {
    background: #b8691f;
}

.map-symbol-ew {
    background: #5b4fa6;
}

.map-symbol-personnel {
    background: #367a8a;
}

.map-symbol-comms {
    background: #1d6fa5;
}

.map-symbol-airdefense {
    background: #4b6a2f;
}

.map-symbol-uav {
    background: #525252;
}

.map-symbol-target {
    background: #b74242;
}

.map-symbol-note {
    background: #627286;
}

.map-measure-label {
    background: transparent;
    border: 0;
}

.map-measure-label div {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(6, 17, 29, 0.82);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.map-popup {
    min-width: 220px;
    line-height: 1.45;
}

@media (max-width: 960px) {
    .hero-panel,
    .workspace-grid,
    .receiver-grid {
        grid-template-columns: 1fr;
    }

    .receiver-combat-layout.ops-mode {
        grid-template-columns: 1fr;
    }

    .sender-combat-layout.ops-mode {
        grid-template-columns: 1fr;
    }

    .sender-combat-layout.ops-mode .sender-resize-handle,
    .sender-combat-layout:fullscreen .sender-resize-handle {
        display: none;
    }

    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-symbol-palette {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .viewer-viewport {
        min-height: 420px;
    }
}

@media (max-width: 640px) {
    .app-shell {
        width: min(100% - 20px, 100%);
        padding: 16px 0 24px;
    }

    .hero-panel,
    .card-block,
    .status-panel {
        border-radius: 22px;
        padding: 18px;
    }

    .hero-copy h1 {
        max-width: none;
        font-size: clamp(2rem, 12vw, 3rem);
    }

    .viewer-viewport {
        min-height: 320px;
        border-radius: 22px;
    }

    .receiver-video-wrap {
        min-height: 220px;
    }

    .device-summary,
    .viewer-footer {
        grid-template-columns: 1fr;
    }

    .badge-chip {
        min-width: 0;
    }

    .card-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
