dialog.cv-preview[open] {
  position: fixed;
  inset: 0;
  margin: auto;
  box-sizing: border-box;
  width: min(900px, calc(100% - 48px));
  height: min(1100px, calc(100dvh - 48px));
  max-height: none;
  padding: 0;
  border: 1px solid #393936;
  border-radius: 14px;
  background: #121211;
  color: #eeece5;
  overflow: hidden;
}

.cv-preview[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  animation: cv-enter 260ms cubic-bezier(.22,.8,.2,1) both;
}

.cv-preview::backdrop { background: rgb(0 0 0 / 76%); }
.cv-preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #393936; }
.cv-preview-toolbar a { color: inherit; }
.cv-preview-back { min-height: 48px; padding: 0 18px; border: 0; border-radius: 8px; background: #eeece5; color: #121211; font: inherit; cursor: pointer; }
.cv-preview iframe { width: 100%; height: 100%; border: 0; background: #eee; }
@keyframes cv-enter { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .cv-preview[open] { animation: none; } }

@media (max-width: 700px) {
  dialog.cv-preview[open] {
    width: min(420px, calc(100% - 24px));
    height: min(640px, calc(100dvh - 24px));
    margin: auto;
  }

  .cv-preview-toolbar { padding: 8px 10px; font-size: 14px; }
}

.cv-preview-page { display: none; }
@media (max-width: 700px) {
  dialog.cv-preview[open] { grid-template-rows: auto minmax(0, 1fr); }
  .cv-preview iframe { display: none; }
  .cv-preview-page {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
  }
}
