/* GriGsi VMCR — split part 6/10 — PIP/split panes, Display (OBS output) page, mix-fullscreen buttons. Part of website/css/vmcr.css, cut in original order (2026-09-23); load all 10 vmcr-*.css files together in order, never reorder. */
/* Persistent PIP frame + resize grip (mouse-only place/size) */
.vmcr-pip-frame {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  box-sizing: border-box;
  left: var(--pip-x, 69%);
  top: var(--pip-y, 68%);
  width: var(--pip-size, 28%);
  height: var(--pip-size, 28%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.vmcr-pip-frame[hidden] {
  display: none !important;
}

.vmcr-pip-frame::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  border-right: 3px solid rgba(255, 255, 255, 0.95);
  border-bottom: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 1px;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

/* Independent Split panes — drag move / corner resize like PIP */
.vmcr-split-frame {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.vmcr-split-frame[data-pane="a"] {
  border-color: rgba(74, 143, 212, 0.85);
}

.vmcr-split-frame[data-pane="b"] {
  border-color: rgba(240, 179, 90, 0.9);
}

.vmcr-split-frame.is-selected {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.3);
}

.vmcr-split-frame[hidden] {
  display: none !important;
}

.vmcr-split-frame::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  border-right: 3px solid rgba(255, 255, 255, 0.95);
  border-bottom: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 1px;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

/* Independent Split grid panes (3-6 way) — separate from the a/b split above */
.vmcr-grid-frame {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

.vmcr-grid-frame.is-selected {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.3);
}

.vmcr-grid-frame[hidden] {
  display: none !important;
}

.vmcr-grid-frame::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  border-right: 3px solid rgba(255, 255, 255, 0.95);
  border-bottom: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 1px;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

.vmcr-grid-frame__label {
  margin: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Split popup: Off / 2 / 3 / 4 / 5 / 6 */
.vmcr-grid-menu {
  position: fixed;
  z-index: 140;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(47, 95, 138, 0.2);
  background: #fff;
  box-shadow: 0 18px 48px rgba(20, 36, 56, 0.28);
}

.vmcr-grid-menu[hidden] {
  display: none !important;
}

.vmcr-grid-menu__item {
  min-width: 42px;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(47, 95, 138, 0.2);
  background: #f5f8fb;
  color: var(--vmcr-ink, #1a2733);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.vmcr-grid-menu__item:hover,
.vmcr-grid-menu__item:focus-visible {
  border-color: rgba(47, 95, 138, 0.5);
  background: #eaf1f8;
}

.vmcr-grid-menu__item.is-active {
  border-color: rgba(74, 143, 212, 0.85);
  background: rgba(74, 143, 212, 0.15);
}

.vmcr-program.is-split-edit.is-pip-move-hover,
.vmcr-preview-mon.is-split-edit.is-pip-move-hover {
  cursor: grab;
}

.vmcr-program.is-split-edit.is-pip-resize-hover,
.vmcr-preview-mon.is-split-edit.is-pip-resize-hover {
  cursor: nwse-resize;
}

/* Resize grip on the PIP inset (bottom-right) when B is selected */
body.vmcr-layout-pip .vmcr-region-target[data-target="b"]::after,
body.vmcr-layout-pip.vmcr-layout-assign-b .vmcr-region-target::after {
  content: none;
}

/* Split / PIP region assign target (tap pane → next Cam/Media goes there) */
.vmcr-region-target {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  box-sizing: border-box;
}

body.vmcr-layout-assign .vmcr-preview-mon,
body.vmcr-layout-assign .vmcr-program {
  cursor: crosshair;
}

body.vmcr-layout-split.vmcr-layout-assign-a .vmcr-region-target {
  inset: auto;
  left: var(--split-a-x, 1%);
  top: var(--split-a-y, 2%);
  width: var(--split-a-w, 47.5%);
  height: var(--split-a-h, 96%);
  border: 2px solid rgba(74, 143, 212, 0.95);
  box-shadow: inset 0 0 0 1px rgba(74, 143, 212, 0.35);
  background: rgba(74, 143, 212, 0.1);
}

body.vmcr-layout-split.vmcr-layout-assign-b .vmcr-region-target {
  inset: auto;
  left: var(--split-b-x, 51.5%);
  top: var(--split-b-y, 2%);
  width: var(--split-b-w, 47.5%);
  height: var(--split-b-h, 96%);
  border: 2px solid rgba(240, 179, 90, 0.95);
  box-shadow: inset 0 0 0 1px rgba(240, 179, 90, 0.35);
  background: rgba(240, 179, 90, 0.1);
}

body.vmcr-layout-pip.vmcr-layout-assign-a .vmcr-region-target {
  border: 2px solid rgba(74, 143, 212, 0.85);
  box-shadow: inset 0 0 0 1px rgba(74, 143, 212, 0.3);
}

body.vmcr-layout-pip.vmcr-layout-assign-b .vmcr-region-target {
  inset: auto;
  left: var(--pip-x, 69%);
  top: var(--pip-y, 68%);
  width: var(--pip-size, 28%);
  height: var(--pip-size, 28%);
  border: 2px solid rgba(240, 179, 90, 0.95);
  box-shadow:
    0 0 0 1px rgba(240, 179, 90, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  background: rgba(240, 179, 90, 0.12);
}

/* Layout chrome only — never .vmcr-region-target (that also carried data-layout). */
button[data-layout].is-active {
  background: linear-gradient(180deg, #2f5f8a 0%, #1e4060 100%);
  color: #fff !important;
  border-color: rgba(30, 64, 96, 0.45);
}

/* Display / OBS output page */
.vmcr-display-page {
  margin: 0;
  min-height: 100vh;
  background: #000;
  color: #fff;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
}

.vmcr-display-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  z-index: 1;
}

.vmcr-display-chrome {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.vmcr-display-chrome.is-visible,
.vmcr-display-page:not(.has-feed) .vmcr-display-chrome {
  opacity: 1;
  pointer-events: auto;
}

.vmcr-display-label {
  margin: 0;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vmcr-display-status {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
}

.vmcr-display-status.is-error { color: #ff8f7a; }
.vmcr-display-status.is-ok { color: #8fd4b0; }

.vmcr-display-fs {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}

.vmcr-url-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 10px;
}

.vmcr-url-row input {
  flex: 1;
  min-width: 0;
}

.vmcr-stream-hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(47, 95, 138, 0.08);
  border: 1px solid rgba(47, 95, 138, 0.16);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--vmcr-muted);
}

.vmcr-stream-hint strong {
  color: var(--vmcr-ink);
  font-weight: 650;
}

.vmcr-rec-group {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(47, 95, 138, 0.16);
  background: rgba(255, 255, 255, 0.45);
}

.vmcr-rec-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.vmcr-rec-group__title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vmcr-accent-deep);
}

.vmcr-rec-group__head .vmcr-rec-group__title {
  margin: 0;
}

.vmcr-rec-iso-tools {
  display: inline-flex;
  gap: 6px;
}

.vmcr-btn--tiny {
  padding: 6px 10px;
  font-size: 0.78rem;
  min-height: 0;
}

.vmcr-rec-opts--iso {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vmcr-rec-opts--iso .vmcr-check.is-offline {
  opacity: 0.55;
}

@media (max-width: 520px) {
  .vmcr-rec-opts--iso { grid-template-columns: 1fr; }
}

.vmcr-rec-opts {
  display: grid;
  gap: 2px 12px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 10px;
}

@media (max-width: 520px) {
  .vmcr-rec-opts { grid-template-columns: 1fr; }
}

.vmcr-rec-track {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.vmcr-rec-dest-tag {
  justify-self: end;
  max-width: 9rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(47, 95, 138, 0.28);
  background: rgba(255, 255, 255, 0.75);
  color: var(--vmcr-accent-deep, #1e4060);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vmcr-rec-track:not(:has(input:checked)) .vmcr-rec-dest-tag {
  opacity: 0.35;
}

.vmcr-rec-dest__lead {
  margin: 0 0 10px;
  font-size: 0.82rem;
}

.vmcr-rec-dest-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.vmcr-rec-dest-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vmcr-rec-dest-btn.is-active {
  background: linear-gradient(145deg, #7b5fb8 0%, #3d2860 55%, #2a1b45 100%) !important;
  color: #fff !important;
  border-color: rgba(61, 40, 96, 0.55) !important;
}

#vmcr-rec-dest-status {
  margin-bottom: 10px;
}

#vmcr-rec-dest-status strong {
  color: var(--vmcr-accent-deep, #1e4060);
}

.vmcr-rec-proof {
  padding-top: 2px;
}

.vmcr-rec-proof .vmcr-meta-line a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vmcr-rec-files .vmcr-rec-proof-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(106, 90, 205, 0.14);
  color: #4a3d9a;
  border: 1px solid rgba(106, 90, 205, 0.28);
}

.vmcr-rec-files .vmcr-rec-proof-tag.is-miss {
  background: rgba(229, 72, 77, 0.12);
  color: #a33;
  border-color: rgba(229, 72, 77, 0.28);
}

body.vmcr-dir-page.vmcr-mix-fs .vmcr-rec-files .vmcr-rec-proof-tag {
  background: rgba(166, 147, 239, 0.18);
  color: #e2e8f0;
  border-color: rgba(166, 147, 239, 0.35);
}

.vmcr-rec-timer {
  margin: 12px 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--vmcr-muted);
}

.vmcr-rec-timer.is-live {
  color: #b42318;
}

#vmcr-rec-take-files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vmcr-rec-take-download {
  margin: 0;
}

.vmcr-rec-files {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.vmcr-rec-files li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--vmcr-line);
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

.vmcr-rec-files li span {
  flex: 1;
  min-width: 0;
  color: var(--vmcr-muted);
  word-break: break-all;
}

.vmcr-page.vmcr-recording .vmcr-program {
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.55);
}

/* --------------------------------------------------------------------------
   Director — mobile / tablet
   Order: Preview|Program → narrow transport row → Cams / Media / Overlay
   On phone (esp. landscape) cams become tap buttons matching transport.
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .vmcr-dir-page .vmcr-wrap--director {
    width: min(100% - 16px, 1280px);
    padding: 14px 0 max(28px, env(safe-area-inset-bottom));
  }

  .vmcr-dir-page .vmcr-shell-top {
    margin-bottom: 12px;
    gap: 8px;
  }

  .vmcr-dir-page .vmcr-shell-top h1 {
    font-size: 1.2rem;
  }

  .vmcr-dir-page .vmcr-card {
    padding: 14px;
    border-radius: 14px;
  }

  .vmcr-dir-page .vmcr-shell-top__tools {
    gap: 8px;
  }

  .vmcr-dir-page .vmcr-monitors {
    gap: 10px;
  }

  .vmcr-dir-page .vmcr-preview-mon,
  .vmcr-dir-page .vmcr-program {
    border-radius: 12px;
  }

  /* Narrow transport — one row under monitors */
  .vmcr-dir-page .vmcr-controls--bar {
    position: static;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    margin: 0 0 10px;
    padding: 6px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.72);
  }

  .vmcr-dir-page .vmcr-controls--bar .vmcr-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 34px;
    padding: 4px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    justify-content: center;
    white-space: nowrap;
  }

  .vmcr-dir-page #vmcr-take-btn,
  .vmcr-dir-page .vmcr-btn--take {
    flex: 1.55 1 0;
    min-width: 4.5rem;
    font-size: 0.78rem;
    font-weight: 780;
    padding-left: 10px;
    padding-right: 10px;
  }

  .vmcr-dir-page #vmcr-voice-toggle,
  .vmcr-dir-page .vmcr-btn--voice {
    flex: 0 0 auto;
    min-width: 1.7rem;
    width: 1.7rem;
    padding: 4px 0;
    font-size: 0.72rem;
  }

  .vmcr-dir-page .vmcr-pip-controls {
    margin-bottom: 10px;
    gap: 8px;
  }

  /* Cameras as tap buttons (same family as transport) */
  .vmcr-dir-page .vmcr-workbench {
    margin-top: 0;
  }

  .vmcr-dir-page .vmcr-cams-panel .vmcr-panel-head .vmcr-lead,
  .vmcr-dir-page .vmcr-cams-panel .vmcr-panel-head__hint {
    display: none;
  }

  .vmcr-dir-page .vmcr-workbench .vmcr-panel-head h2,
  .vmcr-dir-page .vmcr-workbench > .vmcr-card > h2 {
    font-size: 0.92rem;
    margin-bottom: 8px;
  }

  .vmcr-dir-page .vmcr-previews--row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }

  .vmcr-dir-page .vmcr-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 40px;
    min-width: 0;
    padding: 6px 4px;
    margin: 0;
    border-radius: 10px;
    border: 1px solid rgba(47, 95, 138, 0.28);
    background: rgba(255, 255, 255, 0.88);
    color: var(--vmcr-ink);
    box-shadow: none;
    outline: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .vmcr-dir-page .vmcr-preview video,
  .vmcr-dir-page .vmcr-preview .vmcr-level,
  .vmcr-dir-page .vmcr-preview .vmcr-cam-audio-viz {
    display: none !important;
  }

  .vmcr-dir-page .vmcr-preview .vmcr-cam-mute-badge {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    color: #b42318;
    font-size: 0.62rem;
    left: auto;
    right: auto;
    bottom: auto;
  }

  .vmcr-dir-page .vmcr-preview .vmcr-cam-mute-badge[hidden] {
    display: none !important;
  }

  .vmcr-dir-page .vmcr-preview__meta {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    width: 100%;
    padding: 0;
    background: transparent;
    text-align: center;
  }

  .vmcr-dir-page .vmcr-preview strong {
    font-size: 0.72rem;
    font-weight: 780;
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: inherit;
  }

  .vmcr-dir-page .vmcr-preview span {
    font-size: 0.58rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--vmcr-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .vmcr-dir-page .vmcr-preview.is-online {
    border-color: rgba(47, 160, 110, 0.55);
    background: rgba(47, 160, 110, 0.12);
  }

  .vmcr-dir-page .vmcr-preview.is-selected {
    outline: none;
    border-color: rgba(47, 95, 138, 0.55);
    background: linear-gradient(180deg, #2f5f8a 0%, #1e4060 100%);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  }

  .vmcr-dir-page .vmcr-preview.is-selected span {
    color: rgba(255, 255, 255, 0.78);
  }

  .vmcr-dir-page .vmcr-preview.is-program {
    border-color: rgba(196, 95, 18, 0.7);
    box-shadow: inset 0 0 0 2px rgba(240, 179, 90, 0.85);
  }

  .vmcr-dir-page .vmcr-preview.is-program.is-selected {
    background: linear-gradient(180deg, #c45f12 0%, #8a3f08 100%);
    border-color: rgba(138, 63, 8, 0.55);
    color: #fff;
    box-shadow: none;
  }

  .vmcr-dir-page .vmcr-preview:active {
    transform: scale(0.97);
  }

  .vmcr-dir-page .vmcr-hotkeys {
    display: none;
  }
}

@media (max-width: 720px) {
  /* Keep Preview | Program as the user likes (PGM first on narrow portrait) */
  .vmcr-dir-page .vmcr-monitors {
    display: flex;
    flex-direction: column;
  }

  .vmcr-dir-page .vmcr-monitors > .vmcr-monitor:nth-child(2) {
    order: -1;
  }

  .vmcr-dir-page .vmcr-monitor__src {
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .vmcr-dir-page .vmcr-shell-top__tools {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .vmcr-dir-page .vmcr-shell-top__tools .vmcr-chip,
  .vmcr-dir-page .vmcr-shell-top__tools .vmcr-btn {
    flex: 0 0 auto;
  }

  /* 6 cam buttons — two rows of three on portrait phones */
  .vmcr-dir-page .vmcr-previews--row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .vmcr-dir-page .vmcr-preview {
    min-height: 44px;
    padding: 8px 4px;
  }

  .vmcr-dir-page .vmcr-preview strong {
    font-size: 0.8rem;
  }

  .vmcr-dir-page .vmcr-preview span {
    font-size: 0.62rem;
  }

  .vmcr-dir-page .vmcr-pip-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .vmcr-dir-page .vmcr-pip-corners {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .vmcr-dir-page .vmcr-pip-corners .vmcr-btn {
    width: 100%;
    min-height: 40px;
    padding: 6px;
  }

  .vmcr-dir-page .vmcr-pip-size {
    width: 100%;
    justify-content: space-between;
  }

  .vmcr-dir-page .vmcr-pip-size input[type="range"] {
    flex: 1;
    width: auto;
  }

  .vmcr-dir-page .vmcr-pip-hint {
    margin: 0;
    font-size: 0.78rem;
  }

  .vmcr-dir-page .vmcr-url-row {
    flex-wrap: wrap;
  }

  .vmcr-dir-page .vmcr-url-row input {
    flex: 1 1 100%;
  }

  .vmcr-dir-page .vmcr-url-row .vmcr-btn,
  .vmcr-dir-page .vmcr-url-row a.vmcr-btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    min-height: 40px;
  }

  .vmcr-dir-page .vmcr-actions {
    gap: 8px;
  }

  .vmcr-dir-page .vmcr-actions .vmcr-btn,
  .vmcr-dir-page .vmcr-actions label.vmcr-btn {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .vmcr-dir-page .vmcr-tools {
    margin-top: 12px;
    gap: 12px;
  }

  .vmcr-dir-page .vmcr-program-placeholder,
  .vmcr-dir-page .vmcr-preview-mon .vmcr-program-placeholder {
    padding: 16px;
  }

  .vmcr-dir-page .vmcr-program-placeholder p,
  .vmcr-dir-page .vmcr-preview-mon .vmcr-program-placeholder p {
    font-size: 0.85rem;
  }

  .vmcr-dir-page .vmcr-media-panel .vmcr-lead,
  .vmcr-dir-page .vmcr-overlay-panel .vmcr-lead {
    font-size: 0.74rem;
  }
}

@media (max-width: 480px) {
  .vmcr-dir-page .vmcr-wrap--director {
    width: calc(100% - 12px);
    padding-top: 10px;
  }

  .vmcr-dir-page .grigsi-top-bar .btn-nav:not([href="/vmcr/"]) {
    display: none;
  }

  .vmcr-dir-page .vmcr-controls--bar .vmcr-btn {
    font-size: 0.7rem;
    padding: 6px 5px;
    min-height: 38px;
  }

  .vmcr-dir-page .vmcr-previews--row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.vmcr-source-strip {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  /* Locked: do not trap wheel/touch scroll — page scrolls when pointer is over cams + Media/BG/Overlay */
  overflow: visible;
  overscroll-behavior: auto;
  touch-action: pan-y;
}

.vmcr-source-strip .vmcr-preview,
.vmcr-source-strip .vmcr-preview video,
.vmcr-source-strip .vmcr-action-extras,
.vmcr-source-strip .vmcr-strip-btn {
  touch-action: pan-y;
}

.vmcr-strip-btn {
  display: none;
}

/* Action Media / Background / Overlay strip under cams — removed */
.vmcr-action-extras {
  display: none !important;
}

.vmcr-action-extras .vmcr-strip-btn {
  appearance: none;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: #fff;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.vmcr-action-extras .vmcr-strip-btn__icon {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  font-size: 0.8rem;
  color: #fff;
}

.vmcr-action-extras .vmcr-strip-btn__copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.vmcr-action-extras .vmcr-strip-btn strong {
  font-size: 0.82rem;
  font-weight: 780;
  letter-spacing: 0.01em;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  line-height: 1.1;
}

.vmcr-action-extras .vmcr-strip-btn .vmcr-preview__state,
.vmcr-action-extras .vmcr-strip-btn span {
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.82) !important;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vmcr-action-extras .vmcr-strip-btn--media {
  background: linear-gradient(145deg, #3a7eb8 0%, #2f5f8a 48%, #1e4060 100%);
  box-shadow:
    0 10px 24px rgba(30, 64, 96, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.vmcr-action-extras .vmcr-strip-btn--bg {
  background: linear-gradient(145deg, #3f9a6a 0%, #2e7d55 48%, #1c5a3c 100%);
  box-shadow:
    0 10px 24px rgba(28, 90, 60, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.vmcr-action-extras .vmcr-strip-btn--overlay {
  background: linear-gradient(145deg, #d4893a 0%, #c45f12 48%, #8a3f08 100%);
  box-shadow:
    0 10px 24px rgba(138, 63, 8, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.vmcr-action-extras .vmcr-strip-btn:hover,
.vmcr-action-extras .vmcr-strip-btn:focus-visible {
  filter: brightness(1.07);
  transform: translateY(-2px);
  outline: none;
}

.vmcr-action-extras .vmcr-strip-btn--media:hover,
.vmcr-action-extras .vmcr-strip-btn--media:focus-visible {
  box-shadow:
    0 14px 30px rgba(30, 64, 96, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.vmcr-action-extras .vmcr-strip-btn--bg:hover,
.vmcr-action-extras .vmcr-strip-btn--bg:focus-visible {
  box-shadow:
    0 14px 30px rgba(28, 90, 60, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.vmcr-action-extras .vmcr-strip-btn--overlay:hover,
.vmcr-action-extras .vmcr-strip-btn--overlay:focus-visible {
  box-shadow:
    0 14px 30px rgba(138, 63, 8, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.vmcr-action-extras .vmcr-strip-btn:active {
  transform: translateY(1px) scale(0.985);
  filter: brightness(0.96);
}

.vmcr-action-extras .vmcr-strip-btn--media.is-selected,
.vmcr-action-extras .vmcr-strip-btn--bg.is-active,
.vmcr-action-extras .vmcr-strip-btn--overlay.is-active {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.55),
    0 12px 28px rgba(30, 64, 96, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  filter: brightness(1.08);
}

.vmcr-action-extras .vmcr-strip-btn--bg.is-active {
  box-shadow:
    0 0 0 2px rgba(210, 255, 230, 0.7),
    0 12px 28px rgba(28, 90, 60, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.vmcr-action-extras .vmcr-strip-btn--overlay.is-active {
  box-shadow:
    0 0 0 2px rgba(255, 236, 210, 0.7),
    0 12px 28px rgba(138, 63, 8, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

body.ios-theme.vmcr-page .vmcr-action-extras .vmcr-strip-btn strong,
body.ios-theme.vmcr-page .vmcr-action-extras .vmcr-strip-btn .vmcr-preview__state,
body.ios-theme.vmcr-page .vmcr-action-extras .vmcr-strip-btn span {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

body.ios-theme.vmcr-page .vmcr-action-extras .vmcr-strip-btn .vmcr-preview__state {
  color: rgba(255, 255, 255, 0.82) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.82) !important;
}

.vmcr-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.vmcr-sheet-head h2 {
  margin: 0;
}

.vmcr-sheet-close {
  display: none;
}

/* Landscape phone (not mix FS): legacy strip. Mix FS uses desktop Action|Prepare layout. */
@media (max-width: 900px) and (orientation: landscape) {
  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-monitors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 6px;
    min-height: min(52vh, 320px);
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-monitors > .vmcr-monitor:nth-child(2) {
    order: 0;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-preview-mon,
  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-program {
    min-height: min(46vh, 280px);
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-controls--bar {
    margin-bottom: 6px;
    padding: 4px 6px;
    gap: 4px;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-controls--bar .vmcr-btn {
    min-height: 34px;
    padding: 4px 6px;
    font-size: 0.7rem;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-action-panel {
    padding: 6px !important;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-action-panel .vmcr-panel-head {
    display: none !important;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-workbench {
    display: grid !important;
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 0.36fr) minmax(9.25rem, 0.85fr) minmax(9.25rem, 0.85fr) !important;
    gap: 6px;
    margin-bottom: 8px;
    align-items: stretch;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-workbench > .vmcr-card {
    height: 100%;
    align-self: stretch;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-workbench > .vmcr-media-panel,
  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-workbench > .vmcr-overlay-panel {
    display: flex !important;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 6px;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-source-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    align-items: stretch;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-source-strip .vmcr-previews--row {
    display: contents;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-action-extras {
    display: none !important;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-strip-btn {
    display: none !important;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-preview {
    min-height: 34px;
    padding: 4px 2px;
    border-radius: 8px;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-preview strong {
    font-size: 0.66rem;
  }

  body.vmcr-dir-page:not(.vmcr-mix-fs) .vmcr-preview span {
    font-size: 0.5rem;
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .vmcr-dir-page .vmcr-monitor__head {
    padding: 4px 8px;
  }

  .vmcr-dir-page .vmcr-monitors {
    min-height: min(58vh, 260px);
  }

  .vmcr-dir-page .vmcr-preview-mon,
  .vmcr-dir-page .vmcr-program {
    min-height: min(52vh, 230px);
  }
}

/* Mix fullscreen button — desktop + landscape phones/tablets */
.vmcr-btn--mix-fs {
  display: none;
  background: linear-gradient(145deg, #7b5fb8 0%, #3d2860 52%, #2a1b45 100%) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border-color: rgba(61, 40, 96, 0.65) !important;
  box-shadow:
    0 8px 18px rgba(61, 40, 96, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-weight: 750;
}

.vmcr-btn--mix-fs:hover,
.vmcr-btn--mix-fs:focus-visible {
  filter: brightness(1.08);
  box-shadow:
    0 10px 22px rgba(61, 40, 96, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  outline: none;
}

.vmcr-btn--mix-fs:active,
.vmcr-btn--mix-fs.is-active {
  background: linear-gradient(145deg, #9a7fd4 0%, #5a3d8f 48%, #3d2860 100%) !important;
  filter: brightness(1.05);
  box-shadow:
    0 0 0 2px rgba(166, 147, 239, 0.55),
    0 8px 18px rgba(61, 40, 96, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body.ios-theme.vmcr-page .vmcr-btn--mix-fs,
body.ios-theme.vmcr-page .vmcr-btn--mix-fs span,
body.ios-theme.vmcr-page .vmcr-btn--mix-fs i {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

@media (min-width: 901px) {
  .vmcr-btn--mix-fs {
    display: inline-flex !important;
    flex: 0 0 auto;
    gap: 4px;
    min-width: 2.6rem;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .vmcr-btn--mix-fs {
    display: inline-flex !important;
    flex: 0 0 auto;
    gap: 4px;
    min-width: 2.6rem;
  }
}

html.vmcr-mix-fs,
html.vmcr-mix-fs body.vmcr-dir-page {
  overflow: hidden !important;
  overscroll-behavior: none;
  height: 100%;
  height: 100dvh;
}

/* Mix fullscreen: edge-to-edge — monitors flush top, strip flush bottom */
body.vmcr-dir-page.vmcr-mix-fs {
  overflow: hidden !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
  --vmcr-ink: #e2e8f0;
  --vmcr-muted: #94a3b8;
  color: #e2e8f0 !important;
}

