* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

header {
  text-align: center;
  padding: 40px 0 30px;
}

header h1 { font-size: 2rem; color: #1a1a2e; }
header p { color: #666; margin-top: 6px; }

.email-box {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.email-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.email-row input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  background: #f8f9fa;
  color: #333;
}

.email-row select {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  background: #4f46e5;
  color: white;
}

button:hover { opacity: 0.85; }
button.danger { background: #ef4444; }

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#autoRefreshLabel { color: #666; font-size: 0.85rem; margin-left: auto; }

#inbox {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  overflow: hidden;
  min-height: 200px;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
}

.email-item {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.15s;
}

.email-item:hover { background: #f8f9ff; }
.email-item:last-child { border-bottom: none; }

.email-item .from { font-weight: 600; color: #333; font-size: 0.9rem; }
.email-item .subject { color: #555; margin: 4px 0; }
.email-item .date { color: #aaa; font-size: 0.8rem; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal.hidden { display: none; }

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 28px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-content h3 { font-size: 1.1rem; margin-bottom: 8px; }
.modal-content p { color: #666; font-size: 0.85rem; margin-bottom: 4px; }
.modal-content hr { margin: 16px 0; border: none; border-top: 1px solid #eee; }
.modal-content pre { white-space: pre-wrap; font-family: inherit; color: #333; font-size: 0.9rem; }

.close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f0f0f0;
  color: #333;
  padding: 6px 12px;
  font-size: 0.8rem;
}

.copied { background: #22c55e !important; }

@media (max-width: 500px) {
  .email-row input { min-width: 100%; }
  .actions { gap: 6px; }
}
