/* The desktop review frame uses the same portrait canvas on every screen. */
body[data-preview] {
  margin: 0;
  padding: 0;
  min-height: 0;
  display: block;
}

body[data-preview] > main {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100dvh;
  height: var(--visible-height, 100dvh);
  min-height: 0;
  margin: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  container-type: size;
}

/* The header and the primary controls remain in view as content scrolls. */
[data-preview="companion"] .brandbar,
[data-preview="chat"] .compose-area,
[data-preview="live"] .composer,
[data-preview="call"] header,
[data-preview="call"] .commands {
  flex: none;
}

[data-preview="companion"] .home-content {
  flex: 1;
  min-height: 0;
  padding-bottom: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

[data-preview="companion"] .contact-hero {
  height: clamp(174px, calc(100cqh - 575px), 365px);
}

.bottom-nav {
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 2px;
  min-height: 60px;
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #dce9ec;
  background: #fcffff;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 46px;
  border: 0;
  color: #506771;
  font-size: clamp(10px, 2.6cqw, 11px);
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}

.bottom-nav [data-icon] {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
}

.bottom-nav svg {
  width: 100%;
  height: 100%;
}

.bottom-nav .create-icon {
  width: 29px;
  padding: 2px 5px;
  border-radius: 7px;
  background: #087da6;
  color: white;
}

.bottom-nav a[aria-current="page"] {
  position: relative;
  align-self: stretch;
  color: #172a33;
  font-weight: 750;
}

.bottom-nav a[aria-current="page"] svg {
  stroke-width: 2.35;
}

.bottom-nav a:focus-visible {
  outline: 2px solid #087da6;
  outline-offset: -4px;
}

.bottom-nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 25px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: #d83995;
}

/* Retain the original A1 option in its named comparison frame. */
[data-home-review="a1"] .bottom-nav a[aria-current="page"] {
  border-radius: 8px;
  background: #fff2f8;
}
[data-home-review="a1"] .bottom-nav a[aria-current="page"]::before { content: none; }

@container (max-height: 610px) {
  .bottom-nav { min-height: 52px; padding-top: 3px; padding-bottom: calc(3px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav a { min-height: 44px; }
  .bottom-nav a[aria-current="page"]::before { top: -3px; }
}

[data-preview="live"] .roomchat,
[data-preview="live"] .log {
  min-height: 0;
}

[data-preview="live"] .log {
  max-height: none;
}

[data-preview="live"] .stage {
  height: 39%;
  flex: 0 1 auto;
  min-height: min(105px, 20%);
}

[data-preview="live"] .composer {
  position: static;
  margin: 0;
  border-radius: 0;
}

[data-preview="call"] .content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  justify-content: flex-start;
}

[data-preview="call"] .content > * {
  flex: none;
}

[data-preview="call"] .caption {
  margin-top: auto;
}

@media (min-width: 600px) and (hover: hover) and (pointer: fine) {
  body[data-preview] {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background: #eaf0f3;
  }

  body[data-preview] > main {
    width: var(--preview-width);
    height: var(--preview-height);
    border-radius: 26px;
    outline: 1px solid #d6e2e7;
    box-shadow: 0 10px 40px #203e4b1c;
    transform: scale(var(--preview-scale, 1));
  }
}
