.preview-shell {
  max-width: 1120px;
  padding-block: clamp(26px, 5vw, 64px);
}
.preview-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 18px 24px;
  margin-bottom: 22px;
}
.preview-heading h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.1;
}
.preview-heading p { margin-top: 7px; }
.preview-actions, .share-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.preview-tabs {
  border-bottom: 1px solid var(--line);
  gap: 18px;
  margin-bottom: 22px;
}
.preview-tabs a {
  position: relative;
  text-decoration: none;
  font-weight: 550;
}
.preview-tabs a[aria-current='page']::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--ink);
  content: '';
}
.preview-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 250px);
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
}
.preview-stage {
  display: grid;
  min-width: 0;
  justify-items: center;
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--muted);
}
.preview-viewport {
  inline-size: min(100%, 390px, max(320px, calc((100dvh - 160px) * .55)));
}
.preview-notes { padding: 6px 0; }
.preview-notes h2 { font-size: 1.125rem; letter-spacing: -.02em; }
.preview-notes p { font-size: .875rem; margin-top: 8px; }
.expo-access { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.expo-access h3 { font-size: .9rem; font-weight: 650; }
.expo-access button { margin-top: 12px; }
.expo-access a { display: inline-flex; gap: 5px; align-items: center; min-height: 44px; font-size: .8125rem; }

.share-dialog {
  width: min(400px, calc(100% - 28px));
  max-block-size: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 70px #0004;
}
.share-dialog::backdrop { background: #0008; }
.share-content { padding: 19px 22px 17px; }
.share-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.share-heading h2 { font-size: 1.35rem; letter-spacing: -.026em; }
.share-heading form { margin: 0; }
.share-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
}
.share-close:hover { background: var(--muted); }
.share-content > p { font-size: .9rem; max-width: 34ch; }
.share-qr { display: grid; min-height: 224px; place-items: center; margin-block: 16px; text-align: center; }
.share-qr canvas { display: block; max-width: 100%; height: auto; border-radius: 7px; background: white; }
.share-status { display: block; min-height: 1.25em; margin-top: 9px; font-size: .8125rem; color: var(--secondary); }

@media (max-width: 760px) {
  .preview-workspace { grid-template-columns: 1fr; }
  .preview-stage { padding: 18px; }
  .preview-notes { padding-inline: 2px; }
}
@media (max-width: 480px) {
  .preview-shell { width: calc(100% - 32px); padding-block: 21px 40px; }
  .preview-actions .button, .share-actions .button { min-height: 44px; }
  .preview-heading { gap: 13px; margin-bottom: 16px; }
  .preview-heading p { font-size: .875rem; }
  .preview-stage { padding: 6px; border-radius: 13px; }
  .preview-viewport { inline-size: 100%; }
  .preview-viewport .phone-frame {
    --phone-rim: 1px;
    --phone-bezel: 3px;
    --phone-radius: 21px;
    block-size: max(29rem, calc(100dvh - 13rem));
    aspect-ratio: auto;
    box-shadow: 0 10px 22px -20px #0008;
  }
  .preview-viewport .phone-frame::before,
  .preview-viewport .phone-frame::after { display: none; }
}
