.contact-sheet-preview {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.contact-sheet-preview[hidden] {
  display: none !important;
}

.contact-sheet-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.contact-sheet-preview-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100vw - 24px));
  max-height: min(92vh, 980px);
  background: #121214;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

.contact-sheet-preview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cg-brand, #a3e635), transparent);
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
}

.contact-sheet-preview-export:disabled {
  opacity: 0.45;
  cursor: default;
}

.contact-sheet-preview-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #0b0b0c;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3c transparent;
}

.contact-sheet-preview-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.contact-sheet-preview-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.contact-sheet-preview-scroll::-webkit-scrollbar-thumb {
  background: #3a3a3c;
  border-radius: 3px;
}

.contact-sheet-preview-scroll::-webkit-scrollbar-thumb:hover {
  background: #48484a;
}

.contact-sheet-preview-loading {
  padding: 48px 24px;
  text-align: center;
  color: #8e8e93;
  font-size: 13px;
}

.contact-sheet-preview-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-sheet-preview-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #f5f5f7;
}

.contact-sheet-preview-sub {
  margin: 6px 0 0;
  font-size: 12px;
  font-family: 'SF Mono', ui-monospace, monospace;
  color: #8e8e93;
}

.contact-sheet-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 20px;
}

.contact-sheet-cell {
  min-width: 0;
}

.contact-sheet-cell-frame {
  background: #0a0a0b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 0;
  overflow: hidden;
}

.contact-sheet-cell-frame img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.contact-sheet-cell-label {
  margin-top: 4px;
  font-size: 9px;
  font-family: 'SF Mono', ui-monospace, monospace;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-sheet-thumb-only {
  padding: 12px 16px 16px;
  line-height: 0;
}

.contact-sheet-thumb-only img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 720px) {
  .contact-sheet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
