@layer overrides {
  :root {
    --view-switcher-height: 36px;
  }

  .call-screen:not(.baby-mode-active) .call-grid {
    padding-top: calc(
      max(var(--space-4), var(--safe-top)) + var(--view-switcher-height) + var(--space-2)
    );
  }

  .call-screen:not(.baby-mode-active) .grid-item.grid-item-pinned,
  .call-screen:not(.baby-mode-active) .split-peer-tile.grid-item-pinned,
  .call-screen:not(.baby-mode-active) .grid-item.full-bleed {
    top: calc(
      max(var(--space-4), var(--safe-top)) + var(--view-switcher-height) + var(--space-2)
    );
    height: auto;
  }

  .soartana-view-switcher {
    position: fixed;
    top: max(var(--space-4), var(--safe-top));
    right: max(var(--space-4), var(--safe-right));
    z-index: calc(var(--z-bar) + 10);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .soartana-view-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--view-switcher-height);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-separator);
    background: rgba(17, 24, 39, 0.86);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--color-label);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: var(--shadow-1);
    transition:
      background-color 160ms var(--ease-enter),
      border-color 160ms var(--ease-enter);
  }

  .soartana-view-switcher-btn:hover {
    background: var(--color-bg-elevated-secondary);
  }

  .soartana-view-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 196px;
    z-index: calc(var(--z-bar) + 20);
    padding: 6px;
    border-radius: var(--radius-md);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-separator);
    box-shadow: var(--shadow-2);
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .soartana-view-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 0;
    background: transparent;
    color: var(--color-label);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color 140ms var(--ease-standard);
  }

  .soartana-view-menu-item:hover {
    background: var(--color-bg-elevated-secondary);
  }

  .soartana-view-menu-item.is-active {
    background: var(--color-accent-tint);
    color: var(--color-link);
    font-weight: 600;
  }

  .soartana-view-menu-separator {
    height: 1px;
    margin: 4px 6px;
    background: var(--color-separator);
  }

  .soartana-rec-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: var(--radius-capsule);
    background: rgba(255, 66, 69, 0.16);
    border: 1px solid rgba(255, 66, 69, 0.45);
    color: #ff6b6e;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
    box-shadow: var(--shadow-1);
  }

  .recording-indicator {
    position: fixed;
    top: calc(var(--space-3) + var(--safe-top));
    left: calc(var(--space-3) + var(--safe-left));
    z-index: calc(var(--z-lock) + 1);
    background-color: var(--color-bg-elevated);
    box-shadow: var(--shadow-2);
    pointer-events: none;
  }

  .call-grid.call-speaker-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    gap: var(--space-3);
    padding-bottom: calc(max(var(--space-4), var(--safe-bottom)) + 4.75rem);
  }

  .call-speaker-stage {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
  }

  .call-speaker-stage > .grid-item {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
  }

  .call-speaker-strip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: var(--space-2);
    height: clamp(6.5rem, 16vh, 9.5rem);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }

  .call-speaker-strip:empty {
    display: none;
  }

  .call-speaker-strip > .grid-item {
    flex: 0 0 auto;
    width: clamp(10.5rem, 18vw, 15rem);
    height: 100%;
    border-radius: var(--radius-md);
  }

  @media (max-width: 37.49em) {
    .call-screen:not(.baby-mode-active) .call-grid {
      padding-top: calc(
        max(var(--space-2), var(--safe-top)) + var(--view-switcher-height) + var(--space-2)
      );
    }

    .call-screen:not(.baby-mode-active) .grid-item.grid-item-pinned,
    .call-screen:not(.baby-mode-active) .split-peer-tile.grid-item-pinned,
    .call-screen:not(.baby-mode-active) .grid-item.full-bleed {
      top: calc(
        max(var(--space-2), var(--safe-top)) + var(--view-switcher-height) + var(--space-2)
      );
      height: auto;
    }

    .soartana-view-switcher {
      top: max(var(--space-2), var(--safe-top));
      right: max(var(--space-2), var(--safe-right));
    }

    .call-grid.call-speaker-layout {
      padding-bottom: calc(max(var(--space-2), var(--safe-bottom)) + 4.5rem);
    }

    .call-speaker-strip {
      height: 5.75rem;
    }

    .call-speaker-strip > .grid-item {
      width: 9rem;
    }
  }

  .self-view.self-view-hidden {
    width: 0;
    height: 0;
    border-color: transparent;
    background-color: transparent;
    box-shadow: none;
    overflow: visible;
    pointer-events: none;
  }

  .self-view.self-view-hidden > .host-video-wrapper,
  .self-view.self-view-hidden > .self-view-placeholder,
  .self-view.self-view-hidden > .screen-share-preview,
  .self-view.self-view-hidden > .connection-led,
  .self-view.self-view-hidden > .device-settings-menu-button {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
  }

  .self-view.self-view-hidden > .controls,
  .self-view.self-view-hidden > .scrim,
  .self-view.self-view-hidden > .call-more-backdrop {
    pointer-events: auto;
  }
}
