/* ── REPORT VIEWER ───────────────────────────────────────────────────────── */
.viewer-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}
.viewer-sidebar-panel {
  position: sticky;
  top: 80px; /* offset from nav (56px) + some spacing */
}
.viewer-action-box {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.viewer-action-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--t4);
  letter-spacing: .08em;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.viewer-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--t3);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .15s ease;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}
.viewer-btn:hover {
  border-color: var(--border-h);
  color: var(--tp);
  background: var(--s3);
}
.viewer-btn.primary {
  background: var(--tp);
  color: var(--bg);
  border-color: var(--tp);
}
.viewer-btn.primary:hover {
  background: var(--ts);
  border-color: var(--ts);
  color: var(--bg);
}
.viewer-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.viewer-share-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--t4);
  letter-spacing: .08em;
  margin-top: 12px;
  margin-bottom: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.viewer-share-icons {
  display: flex;
  gap: 8px;
  justify-content: space-around;
}
.viewer-share-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--t4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  cursor: pointer;
  text-decoration: none;
}
.viewer-share-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.viewer-share-btn:hover {
  color: var(--tp);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.viewer-share-btn.fb:hover {
  background: rgba(24, 119, 242, 0.15);
  border-color: #1877F2;
  color: #1877F2;
}
.viewer-share-btn.li:hover {
  background: rgba(10, 102, 194, 0.15);
  border-color: #0A66C2;
  color: #0A66C2;
}
.viewer-share-btn.email:hover {
  background: rgba(234, 67, 53, 0.15);
  border-color: #EA4335;
  color: #EA4335;
}

.viewer-frame-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.viewer-frame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  gap: 16px;
}
.viewer-frame-title-wrap {
  min-width: 0;
  flex: 1;
}
.viewer-frame-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--t4);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.viewer-frame-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--tp);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.viewer-close-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--t4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
  flex-shrink: 0;
}
.viewer-close-btn:hover {
  border-color: var(--border-h);
  color: var(--tp);
  background: var(--s2);
}
.viewer-close-btn svg {
  width: 10px;
  height: 10px;
}

.viewer-iframe-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 200px); /* responsive height */
  min-height: 600px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #ffffff; /* match standard white report bg and prevent flashing */
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
}
.viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

/* ── RESPONSIVE VIEWER OVERRIDES ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .viewer-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .viewer-sidebar-panel {
    position: relative;
    top: 0;
    width: 100%;
  }
  .viewer-action-box {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .viewer-action-title, .viewer-share-title {
    width: 100%;
    margin: 4px 0;
    border: none;
    padding: 0;
  }
  .viewer-share-title {
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
  .viewer-btn {
    width: calc(50% - 4px);
  }
  .viewer-share-icons {
    width: 100%;
    justify-content: flex-start;
    gap: 16px;
  }
  .viewer-iframe-container {
    height: 500px;
    min-height: 400px;
  }
}
@media (max-width: 480px) {
  .viewer-btn {
    width: 100%;
  }
}
