/* Keep dropdowns unboxed where the individual editions set their own controls. */
select { background: transparent !important; border: 0 !important; }
select:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.gtr-cinema-exit:not([hidden]) { display: grid; place-items: center; }
.gtr-cinema-exit::before {
  content: '';
  width: 22px;
  height: 22px;
  background: currentColor;
  -webkit-mask: url('exit-fullscreen.svg') center / contain no-repeat;
  mask: url('exit-fullscreen.svg') center / contain no-repeat;
  pointer-events: none;
}
.gtr-broadcast-empty { opacity: .55; }
[data-broadcast-progress]:empty { display: none; }
body:not([data-live-studio]) #live-tools,
[data-live-studio] #number-settings,
[data-live-studio] .controls:not(#live-tools),
[data-live-studio] .top-right,
#live-tools [hidden] { display: none; }
[data-live-studio] #live-tools a { padding: 8px; color: inherit; }
[data-live-studio] #studio-viewport:fullscreen { display: grid; place-items: center; }
[data-live-studio] #studio-viewport:fullscreen .machine-area { width: min(100vw, 177.77778vh); }
[data-live-studio] #studio-viewport:fullscreen #live-tools {
  position: absolute; z-index: 4; bottom: env(safe-area-inset-bottom); left: 0;
  border: 0; background: #071b2bdb; color: #fff;
}
[data-live-studio] #studio-viewport:fullscreen #live-tools button { color: #253129; }
[data-live-modal] { min-height: 100%; background: #071b2b; }
[data-live-modal] .shell { max-width: none; height: 100%; padding: 0; }
[data-live-modal] .topbar,
[data-live-modal] .stage-meta,
[data-live-modal] #live-tools,
[data-live-modal] #number-settings,
[data-live-modal] .controls { display: none !important; }
[data-live-modal] .workspace,
[data-live-modal] .stage-card,
[data-live-modal] #studio-cinema,
[data-live-modal] #studio-viewport { width: 100%; height: 100%; margin: 0; border: 0; border-radius: 0; }
[data-live-modal] .machine-area { width: 100%; height: auto; aspect-ratio: 16 / 9; }
[data-live-modal] #live-sound { display: none; }
.draw-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-block: 8px; }
.draw-actions a { display: inline-flex; align-items: center; min-height: 32px; padding-inline: 8px; }
.draw-actions a.draw-action-disabled { cursor: default; opacity: .7; background: #eef2ee; color: #7b877e; pointer-events: none; }
.draw-actions a.draw-action-disabled::after { content: attr(data-draw-hint); margin-left: .35em; font-size: .75em; }
.gtr-live-dialog { width: min(960px, calc(100% - 24px), 160vh); padding: 0; border: 0; background: #071b2b; }
.gtr-live-dialog::backdrop { background: #000b; }
.gtr-live-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.gtr-live-frame > iframe { display: block; width: 100%; height: 100%; border: 0; object-fit: contain; }
.gtr-live-close { position: absolute; z-index: 2; top: 4px; right: 4px; display: grid; place-items: center; width: 24px; min-width: 24px; height: 24px; min-height: 24px; margin: 0; padding: 0; border: 0 !important; border-radius: 0; color: #fff !important; background: transparent !important; box-shadow: none !important; text-shadow: 0 1px 4px #000; font: 32px/1 system-ui, sans-serif; cursor: pointer; appearance: none; }
.gtr-live-close:hover, .gtr-live-close:active { border: 0 !important; background: transparent !important; box-shadow: none !important; }
.gtr-live-dialog.gtr-live-phone { position: fixed; inset: 0; width: 100vw; width: 100dvw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; overflow: hidden; }
.gtr-live-phone .gtr-live-window { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; width: 100%; height: 100%; background: #071b2b; }
.gtr-live-phone .gtr-live-frame { width: min(100vw, 177.77778vh); width: min(100dvw, 177.77778dvh); }
@media (orientation: portrait) {
  .gtr-live-phone .gtr-live-frame { width: min(100vh, 177.77778vw); width: min(100dvh, 177.77778dvw); transform: rotate(90deg); }
}

#studio-viewport:fullscreen { background: #071b2b; }
.gtr-studio-inline {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
}
@media (any-pointer: coarse) and (max-width: 700px),
       (any-pointer: coarse) and (max-height: 700px),
       (orientation: portrait) and (max-width: 600px),
       (orientation: landscape) and (max-height: 600px) and (max-width: 900px) {
  #studio-cinema { --gtr-phone-cinema: 1; }
  html:has(.gtr-studio-expanded),
  body:has(.gtr-studio-expanded) {
    overflow: hidden;
    overscroll-behavior: none;
  }
  .gtr-studio-expanded {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #071b2b;
    color: white;
  }
  .gtr-studio-expanded .gtr-cinema-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(100vw, 177.77778vh);
    width: min(100dvw, 177.77778dvh);
    height: auto;
    aspect-ratio: 16 / 9;
    transform: translate(-50%, -50%);
  }
  .gtr-studio-expanded .gtr-cinema-exit {
    position: fixed;
    z-index: 5;
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border: 0;
    color: white;
    background: none;
    filter: drop-shadow(0 1px 3px #000);
    appearance: none;
    font: 14px/1.2 system-ui, sans-serif;
  }
  @media (orientation: portrait) {
    .gtr-studio-expanded .gtr-cinema-screen {
      width: min(100vh, 177.77778vw);
      width: min(100dvh, 177.77778dvw);
      transform: translate(-50%, -50%) rotate(90deg);
    }
  }
  @media (orientation: landscape) {
    .gtr-studio-expanded .cctv-screen,
    [data-live-studio] .cctv-screen { right: max(44px, calc(32px + env(safe-area-inset-right))); }
  }
}
