#viewer {
  --bg: #253247;
  --panel: #303f55;
  --ink: #edf2f9;
  --muted: #bac6d8;
  --accent: #91b8ff;
  --border: #47576e;
}
dialog {
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  width: 90vw;
  max-width: 90vw;
  height: 90dvh;
  max-height: 90dvh;
  margin: auto;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px #0008;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog::backdrop {
  background: #111e;
}
@media (max-width: 760px) {
  dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
}
.viewer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.viewer-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}
.viewer-mark {
  font:
    bold 30px "Manrope",
    sans-serif;
  color: var(--accent);
}
.viewer-heading h2 {
  font-size: 15px;
  margin: 0 0 4px;
}
.viewer-heading div > span {
  font-size: 12px;
  color: var(--muted);
}
.viewer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.viewer-actions button,
.viewer-actions a {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  padding: 9px 12px;
}
.viewer-actions a {
  color: var(--accent);
}
.device-buttons {
  display: flex;
  gap: 4px;
}
.device-buttons button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg);
}
.viewer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 10px 20px;
  color: var(--muted);
  font-size: 12px;
}
.viewer-info button {
  background: none;
  border: none;
  color: var(--muted);
  padding: 4px;
}
.frame-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  position: relative;
  background: #223046;
  padding: 0;
  overflow: hidden;
}
iframe {
  border: 0;
  background: #fff;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  transition: width 0.3s;
}
iframe.mobile {
  width: 390px;
  max-width: 100%;
}
.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  z-index: 2;
  pointer-events: none;
  background: #303f55;
}
.loading.hidden {
  display: none;
}
body.viewer-open {
  overflow: hidden;
}
@media screen {
  .cv-project-variant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 14px 0;
  }
  .cv-project-variant h4 { margin: 0 0 4px; font-size: 14px; }
  .cv-project-variant p { margin: 0; }
  .destination-actions { flex-shrink: 0; }
  .destination-actions button, .destination-open {
    display: inline-block;
    font: inherit;
    font-size: 14px;
    color: #253247;
    background: #91b8ff;
    border: 1px solid #91b8ff;
    border-radius: 6px;
    padding: 9px 14px;
    cursor: pointer;
    text-decoration: none;
  }
  #viewer h2 { border: 0; padding: 0; text-transform: none; letter-spacing: normal; color: var(--ink); }
  #viewer button { cursor: pointer; }
  @media (max-width: 650px) {
    .viewer-toolbar { flex-wrap: wrap; padding: 12px; }
    .viewer-actions { flex-wrap: wrap; gap: 6px; }
    .viewer-info { padding: 10px 12px; }
  }
}
@media print {
  #viewer, .destination-actions { display: none !important; }
  .cv-project-variant h4 { margin: 4px 0; }
}
