* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: #fff;
  color: #333;
}

.viewer-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Content area - grows with content, parent iframe handles scrolling */
.viewer-content-area {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}

/* Placeholder - only shown when empty */
.viewer-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #999;
  gap: 12px;
  text-align: center;
  font-size: 13px;
}

.viewer-placeholder i {
  font-size: 32px;
  opacity: 0.4;
  color: #6c757d;
}

/* Content items */
.viewer-item {
  position: relative;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Fullscreen button */
.viewer-fs-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.viewer-item:hover .viewer-fs-btn {
  opacity: 1;
}

/* Fullscreen state */
.viewer-item:fullscreen {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-item:fullscreen .viewer-fs-btn {
  opacity: 1;
}

.viewer-item:fullscreen img {
  max-width: 100%;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.viewer-item:fullscreen iframe {
  width: 100%;
  height: 100vh;
}

.viewer-item:fullscreen .data-view {
  width: 100%;
  height: 100vh;
  overflow: auto;
}

/* Plot styles */
.viewer-item img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Widget iframe styles - fixed height */
.viewer-item iframe {
  display: block;
  width: 100%;
  height: 550px;
  border: none;
  background: #fff;
}

/* Data view styles */
.data-view {
  padding: 12px;
}

.data-view h4 {
  font-weight: 500;
  margin-bottom: 8px;
  color: #333;
  font-size: 12px;
}

.data-view pre {
  margin: 0;
  padding: 10px;
  background: #f5f7f9;
  border-radius: 4px;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===========================================
   Unified Placeholder System
   =========================================== */

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 20px;
  text-align: center;
  color: #666;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: #ccc;
}

.placeholder-text {
  font-size: 13px;
  line-height: 1.4;
}
