.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: 4px;
  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-grid.is-no-labels .contact-sheet-cell-label {
  display: none;
}

.contact-sheet-info-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 2px;
  padding: 0 10px 0 8px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #aeaeb2;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.contact-sheet-info-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.contact-sheet-info-toggle .contact-sheet-info-switch {
  position: relative;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.contact-sheet-info-toggle .contact-sheet-info-switch::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f5f5f7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.contact-sheet-info-toggle:has(input:checked) {
  color: #f5f5f7;
  border-color: rgba(163, 230, 53, 0.35);
  background: rgba(163, 230, 53, 0.08);
}

.contact-sheet-info-toggle:has(input:checked) .contact-sheet-info-switch {
  background: var(--cg-brand, #a3e635);
  border-color: transparent;
}

.contact-sheet-info-toggle:has(input:checked) .contact-sheet-info-switch::after {
  transform: translateX(12px);
  background: #0a0a0b;
}

.contact-sheet-info-toggle:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: #f5f5f7;
}

.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));
  }
}
